The save system saves game data (quests, inventory, etc.) to a JSON file.
The file is currently saved in Unity's persistent data path %AppData%\\..\\LocalLow\\DefaultCompany\\24-25 Production
with the name CriticalDensity.json
Using The Save Manager
The save manager class has two static methods of note, SaveGame
and LoadGame
, and ClearSaveData
. All three methods use the primary save file where the method LoadGameEx
allows for loading based on an arbitrary string and is used only by the debug menu.
Save File Format
As previously stated the save file uses the JSON format. The high-level overview of the save file is listed below:
- Quest Data: the list of quests known by the quest manager, quest event log, and the currently focused quest. Note that both quest progress and configuration are saved. This allows for procedural quests created at runtime to be used.
- Inventory Data: the list of scraps (items) known by the inventory manager and the players tonsks (currency). Both item counts and properties are saved to allow for more flexibility if needed.
- Quest Event Listener Data: the unique name of the listener and the last event it received from the quest event log.
- Dialogue Data: a single string containing the serialized data from the dialogue system.
- Character Info: the player’s name, stats, the current day number, and time (day/night).
- Current Scene: the name of the currently loaded scene.
- Last Visited Scene: the name of the last visited scene. Used by the
SceneTracker
.