Files
blind-nature-bible/Game Design/SaveGame.md
2025-12-01 11:41:47 +01:00

9 lines
836 B
Markdown

The save system has to keep track of persistent variables for certain important entities, world flags and the location of dynamic objects in the world.
## Implementation
We create a class `SaveGame` that calls the `Save()` and `Load()` functions of all singleton systems in the game that implement them. Then the saving and loading is deferred to each component. The resulting dictionary data for each component is bundled in another dictionary that groups them under the component name.
It is unnatural to let this system actually define the variables used by all those various systems, and it is not a bother to implement this functionality either. For the player we will have to create a component that stores the persistent data.
World flags are managed by the world system, and they are saved to and from a dictionary as well.