Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to save the current state of a server?

Asked by
BiIinear 104
4 years ago

I'm surprised you clicked on here. This isn't asking for any help on scripts, this is just a question that has gotten me thinking a lot. What I mean by this question is Can you save the current state of a game, such as the position of you and other things, your Gui info, and the state of scripts?

Sounds impossible, I know. After playing single player games for a while, I would always use the keybind "H" to save my game quickly, and when I load back, the game is now back to its current state from when I pressed "H". Obviously I'm seeing impossible-to-jump-through borders here, since you cant save the state of a server. What if you could join the game by yourself, without a server? I might sound stupid but, kind of like playing a Steam game offline, like System Shock, Half-Life, and other single player games.

0
theres a thing called datastore or something but i heard that theyre confusing and loses data a lot, but its the only solution. is it possible for a datastore to do what i explained here? BiIinear 104 — 4y
0
Not sure this would be possible in roblox. I dont think you can run anything on just a client, I believe even in roblox studio the servers still need an internet connection and are emulated. However, I may be wrong. Psudar 882 — 4y
0
im guessing it would take a lot of data to save, the limit is 260,000 and it saves by string value i think, so that would have a lot of saving BiIinear 104 — 4y
0
Depends on how much you have in your game. If you only had to save the positions of parts and such, might not be so bad. Who knows. Psudar 882 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Yes, if you can serialize your game state and save somewhere (ex DataStores). It's the same idea as saving a player's stats, purchases, buildings, etc - you can apply it to multiple players or whatever else the server is managing.

If you have a multiplayer game, you'd have to figure out what you want to do if you're reloading a game that involves players that aren't in the current server, but single player games would be relatively simple, depending on the game.

If you let your server simulate physics, you may need to serialize the CFrames, velocities, and rotational velocities of parts. If your scripts can generate parts dynamically, you'll need to store what type of parts, their colours, and/or anything else that changes. To save space you could try rounding most of the values (ex. a position of 0.4153 vs 0.4 might not matter)

Note: for a Roblox game, even a "single player" game still uses a server (perhaps with MaxPlayers set to 1).

Ad

Answer this question