Plan for saving more data in saved games

From OHRRPGCE-Wiki
Jump to navigation Jump to search

Ideas for things that could be added to saved games.

See also Plan for saving NPC locations in savegames.

Reload Node Description
version Contains the game's version number (optional: incremented by the game author) Obsolete game version number would show a warning before loading to tell the player they are using a save that may contain incorrect data for the new version of the game. (Unless the game author provides a on-obsolete-save script for this situation, which game authors can write. It would be run before the on-load script to automatically update things)
mapstates Map saved state containing the same data that is used for temporary map state saving (Note that the current temporary format takes twice as much space as necessary, presumably we'd get around to fixing it). See Plan for saving NPC locations in savegames
scriptobjs Persistant storage of all non-integer script variables, including things like NPC extras, eg. strings, arrays, user defined objects. Would probably be same format as the lump doing the same thing in .RPG files.
scrinterpreter A resumable dump of the script interpreter's state.

Script interpreter state[edit]

Resuming the script interpreter state will in general not be possible if scripts have been edited, unless a copy of each running script is saved in the RSAV.

Instead, it would just allow the interpreter state to be thrown away. If it's thrown away, the existing ```load game script``` is run. If it's not thrown away, instead the ```resume game script``` is run.

Also, there would be a bit to prevent this from happening if the game author doesn't want to deal with this scenario: you will not be able to load a saved game with a different version of the game.

before-save scripts[edit]

A "before save" script trigger should be provided. As an argument it would get the slot number that the player has chosen to save into. This would make it easy for game authors to tie together the saving of shared data with the normal save system. (although there is no reason why shared data couldn't be read or written at other times too)