3 ms·
Why is saving the state hard for them? So many games and other software save their state .... Imagine Excel 'replaying' the spreadsheet to return to the latest
by mmooss 4mo ago
Why is saving the state hard for them? So many games and other software save their state .... Imagine Excel 'replaying' the spreadsheet to return to the latest state.
- saidnooneever 4mo agoit sounds so stupid u know i am curious Why on earth people would do this. How it is not possible to dump some memory as save/load. is the game state not known?? :/
- rcxdude 4mo agoSave files are not just memory dumps, you need to have a serialisation/deserialisation mechanism for the game state. But this is not generally a viable way to do RTS multiplayer, so you either need to build both a save game system and a deterministic replay system (which might each make the other more complicated), or go for the latter which you need to do anyway and then reuse it for saving the game as well.
- lsaferite 4mo agoFactorio manages to pull it off and I'd argue they are tracking far more individual entities.
- rcxdude 4mo agoIt's not impossible, it's just a question of if it's worth the effort. Factorio was kind of forced into it, because a) they built a save system before they went multiplayer, and b) it's impractical to replay a factorio save when loading a game, because it lasts a lot longer. (note that factorio does a hybrid: multiplayer works like an RTS but starting from a save game instead of from scratch. If your PC can barely keep up with a server that you're joining, it can take a long time to actually get into the game or actually just not be possible)
- mmooss 4mo agoTo add to my comment above: If the game doesn't know the current state, how does it compute the outcome of the next move? Does it replay from scratch again? (Obviously not.) How do they develop it? The developers must have to save and restart the game more than anyone. I'm curious about how it's designed, which must be different than most other games and software. (I'm not saying they are crazy, etc. I'm certain they've thought about this issue.) I suspect the answer is that we are misunderstanding something and that it can save and restore state relatively efficiently.
- rcxdude 4mo agoThe main thing is that synchronizing the state is hard: with hundreds of units and low latency being important, there's big advantages to having a deterministic simulation and relaying the player's commands instead of the whole game state, in fact unless you know everyone playing the game has a very good internet connection it's the only viable option. As an added bonus, it also allows you to hide small amounts of latency without rollbacks or stuttering by having a small delay on command execution. Once you've got that it's obvious that the best way to make a replay file is to save the stream of commands, and this also doubles as a save file, as opposed to making a seperate mechanism for saving and loading state which might introduce it's own bugs. (It's not impossible to do both: while it's not strictly an RTS, Factorio has the same difficulty of synchronising the whole game state in multiplayer, but also has the disadvantage of quite long-lived and simulation-intensive games. So it uses a hybrid approach: it has a deterministic engine and a game state save, and when someone joins a multiplayer server, the server snapshots and sends the game state, which may take a few minutes, then it sends a replay to catch that player up to the current state of the game. But this is something that took them a lot of work to get into a reliable state and was kind of forced onto them by the constraints they had to work with)
- mmooss 4mo agoThank you for explaining. > there's big advantages to having a deterministic simulation and relaying the player's commands instead of the whole game state, in fact unless you know everyone playing the game has a very good internet connection it's the only viable option. If I understand, running it all on a server and just updating player UIs doesn't work for an RTS because some user Internet connections bottleneck the updates, putting those users at a disadvantage. You need to keep as much on the client as possible.
- rcxdude 4mo agoYeah, the bandwidth requirements quickly become very high. With modern internet connections you could maybe keep up with an old-school RTS.