Save/load system

Almost every game needs to have the ability to save and load it’s state and the time has come for the ship control to get this feature. At first I thought that I should not reinvent the wheel and use some ready solution for this purpose, but, unfortunately, I could not find suitable. Most ready-made solutions have drawbacks: some are not able to store certain types of variables, others are too complex for such a game, third require modifications applied to assets to be able to work.
The biggest problem is that objects which should keep the state do not exist originally, and instead are procedurally generated at the beginning of the game, which imposes even greater restrictions. It requires to save many whole classes those are not even serializeable, or a significant part of their parameters and the need to re-assign the fields when they are re-created.
In any case, my very own basic version of the system that does it finally came to live and almost ready to to be integrated into the loading screen, which will appear in the 0.28 version of the game.

Funny fact: saving and loading performed almost instantly, while the generation of the loaded world takes a lot of time.

Leave a Reply