How to save game into a small file.

Here’s an old question that traversed my mind when I was a student lanning on StarCraft and Age Of Mythologie :

In these two games, there was a possibility to save the party we just played and to replay it all from the begining. That tip was quiet enoying for good players as we were able to see the strategies they used and counter them for the next lan…
Anyway, I was surprized to find back all character’s behaviours for many players in such a tiny file (only few Ko on the hard drive). And the question is:
How is it possible to do that ?
Was everything written in a txt file ?

i dunno exactly how they did it. but some old strategy games had an interesting approach for networking, which might also apply to recording the game.
due to bandwith limitations in the early days of the internet developers were forced to syncronize the simulation input, instead of syncronizing the simulation output.
means as much as. the game only syncronised all user-inputs. what units you selected, where you send them, where the user clicked etc. given predictive-enough game rules and ocassional syncronisation of the objects it was possible to run strategy simulations with hundrets of units even on a modem connection as slow as… well… you dont really want to experience.

so maybe they simply did the same trick for replay. if so the data propably was saved using the proper binary representation of the values received. since they take a lot less storage than textfiles

Chances are the save files are in a binary format instead of plain text. This was when hard drives were much much smaller.

they could also be zipped files. That makes huge text files much much smaller especially if they are computer generated.

In my game i used LockStep Simulation just like Starcraft. And yes my save game files are very small even in text from.

With the magic word “LockStep” I was able to find this article.
In fact, Panda3d is using this notion of “LockStep” which is a PyDatragram.

So, it’s possible to do it if we store all the PyDatagram that the server broadcast to all clients in a text file, correct ?

I read on some roguelike site, tat they have recording of whole game.

Generally, they just get CPU state for random number generation, and then capture all events (altough its only keyboard input in roguelike). And then jst simulate recording with given CPU state.