-
Notifications
You must be signed in to change notification settings - Fork 1
SGS The Save Game System
It's a system that lets you save and restore scene data to allow the implementation of a save game system.
It serializes data into bytes. The generated format is not human-readable. In the serialization pipeline we have
ProtoBuf and the standard C# BinarySerializer, both working together to create save files.
Future releases might see compressed bytes written to file too.
No. You can serialize anything that common sense implies is serializable without creating any schemas. There's no overhead in writing structure information or anything along these lines. The SGS is fully dynamic. It works based on attributes instead of relying on schema files.
No currently you can't but it's a feature I am looking at.
However, since you can create your own ProtoContracts you are able to serialize also complex object trees easily.
Anything, really. You can save the state of a whole scene or just some meta data. Any data that you might have, no matter how deep inside the scene structure it is can be saved and re-created when the scene is loaded again.
Conversely storing meta data, such as number of played levels, ranks, play time, current progression level etc is a easy thing to do and you needn't rely on PlayerPrefs.
Data integrity.
As we will discuss at a later point, we can't save everything. For instance the invocation list of a delegate. It would be highly unreliable even if we would save it.
That means you'll have to think about these non-saveable pieces of your component and how to handle them after a save-game was loaded successfully. SGS provides events to listen to for several events such as post-load. You can hook into that if you want and need special post-processing. Keep that in mind and think about this from the beginning and you'll have solid save-games in no time.
I hope that will answer the most immediate questions.