Skip to content

Saving

A game keeps what a player made, such as a park they built or the coins they earned, between visits: its save. A script keeps its part of it as a slice, with a version, as the engine’s save explains.

Play in the editor keeps a save of its own. The players of the published game keep theirs, and nothing you do in the editor reads or changes it.

The Save panel is at the bottom, beside the Console. While the game plays it shows the save as it is written, and between plays the save the next play comes back to:

  • when it was saved, and its size;
  • each slice, with its version, its size and what it holds;
  • the data of the slice you click.

Save now writes the save at once, while the game plays. The game writes it itself shortly after a change, and when the page is hidden.

  • Play from a fresh start plays as a new player, with no save.
  • Come back after, then Continue, plays again from the save as a player who was away that long: 10 minutes, an hour, 8 hours or 3 days. The game’s save.away is that many seconds, so what grows while a player is away can be seen at once.
  • Clear save forgets the editor’s save: the next play starts as a new game. A game that is playing stops first, as it would save again at its next change.

The Agent reads the save with get_save, and plays from it with play_from_save: a day later, from no save, or from a save it writes itself, such as one of an older version of a slice, to check that it is upgraded. Ask it, for example, “I added decorations to the park: check that a player coming back the next day still gets their park”. It uses the editor’s save, never your players’.