May
08
2015

Makinom handles saving and loading the game for you – learn more about it.

Saving the player’s progress is mandatory for most games. Makinom includes a complete save game system that will save and load game data. Save games can either be saved actively by the player selecting a save game file, or by using Auto Save Slots to automatically save the progress.

The save game system can be expanded to save custom data (e.g. from 3rd party products) along the save data by adding Custom Save Data.

Using Save Games

The save game system is accessed through schematics. Saving, loading and displaying save game menus is handled by nodes (found in Add > Game > Save Game). The settings for the save game systems can be found in the Makinom editor in Menus > Save Game Menu.

What will be saved

The save game system can save the following data in a save game:

  • Game Time
    The current game time.
    The game time is the time since the player started a New Game, i.e. using a Start Game node.
  • Player Position
    The current scene, position and rotation of the player.
    The position and rotation can only be saved when a player is set.
    Respawning the player when loading the game is only possible when you’ve defined a player prefab in the Makinom editor (Game > Game Settings).
  • Music
    The currently playing music and track position.
  • Block States
    The currently blocked input keys and HUDs.
  • Variables
    The global and object variables (non-local).
    You can optionally exclude defined variable keys from being saved, or only save defind variable keys.

All data is saved optionally, i.e. you can enable/disable which data should be saved in the Makinom editor. By default, everything will be saved.

Save games don’t save the current state of the scene (e..g positions of all game objects, spawned prefabs, etc.) or running machines/schematics.

Saving

Save games are stored as XML-formatted text and can optionally be encrypted. The save game is either stored in:

  • File
    Placed in Unity’s persistant data path.
  • PlayerPrefs
    Placed in Unity’s PlayerPrefs.

The location of files and PlayerPrefs vary based on the operating system and the company/game name you’ve defined in Unity. E.g. in Windows, the files are stored in sub-folders of the user’s folder and the PlayerPrefs are stored in the registry.

Save Menu

The player can actively save the game by using a Save Game Menu node displaying the Save menu type. The save menu will display a list of available save game files the player can save to.

The save menu and number of available save game files are defined in the Makinom editor.

Auto Save Slots

You can automatically save the game by using an Auto Save node. The auto save node will automatically save to the current auto save slot or store the save game as Retry save data. A retry save game will only be available while the application is running. Once the player closes the game, the retry save game will be gone.

The player can optionally select an auto save slot that should be used using the Auto Save Slot Dialogue node. This allows multiple players to use auto saving without overriding each other’s save games.

The number of available auto save slots are defined in the Makinom editor.

Loading

The player can load the game when a save game is available or retry data has been saved.

Load Menu

The player can actively load the game by using a Save Game Menu node displaying the Load menu type. The load menu will display a list of available save games (including auto save slots).

Auto Load

The game can be automatically loaded by using an Auto Load node. The save game stored in the current auto save slot or retry save game will be loaded (if available) without the player selecting a file.

This can be used to e.g. automatically return to the last auto save upon game over.

Custom Save Data

Add custom save data (e.g. 3rd party product data) to Makinom save games by registering a class (e.g. a component) to the save game system. The class must implement the ISaveData interface.

You can learn more about using custom save data in this scripting tutorial.