Narrat Docs
Saving and Reloading

Saving and Reloading

How saving works

Narrat supports automatic saving and reloading, but there are some important details worth knowing about.
How saves works:
  • All relevant bits of the state are extracted into one object. This includes
  • This object gets stored in the browser's Local Storage
  • On game load, the local storage gets read for a save, and if present all the data above gets placed in the state to continue playing
Because there is no way to identify which specific line of dialogue the player is on, saving only saves the last label the player started, not the exact line they reached

Save Slots

A save slot is an individual save file. Each game can have any amount of save slots. There are two different ways save slots are managed, depending on how the game is configured:
  • game-slots: This is the default mode, where starting a new game will create an Autosave slot for that playthrough, which will keep getting overwritten as the player goes. Starting a new game creates a separate new autosave slot for that playthrough. When the player loads a slot, autosaves will overwrite that slot automatically TLDR: One save slot per playthrough. Example: Zelda, Dark Souls
  • manual: In this mode, there is a single global auto save used no matter which save gets loaded, but manual saves won't be overwritten unless the player chooses to overwrite them. TLDR: Only one global autosave. Example: Disco Elysium, Bethesda Games
This value can be changed in config.json in saves.mode:
"saves": {
"mode": "manual"
If using manual mode, you should give the player a chance to create manual saves sometimes, as there is only one autosave which can get overwritten by starting a new game

Manual saving

To let the player save manually, there are two commands:
Because save data is only generated when jumping to a new label, save prompts should ideally be at the start of a label. Otherwise, the data saved will be outdated.

The problem with saving a specific line

Why we can only save on label change