From another discussion someone was asking about storing data that would cross story file versions. We know that if you alter your story and compile it, previously saved games will not work with the new story file.
I started thinking about this and poked around I6 for a potential implementation, but I have questions before I do anything. Or, I have a set of requirements, hoping they can either be validated or shot down…
Provide an I7 extension called “External Storage”:
- has simple syntax for storing data, for now key/value pairs (let’s leave serialization/deserialization of objects off the table for now (or forever)
- replace Save/Restore
- on save, append the external storage data.
- on restore, slice off appended storage data.
- after restore is completed
- restore key/value pairs (the author would have to provide the mechanism to actually make this restored data useful)
The author would be to be able to:
Check saving the game:
write the strength of The Minotaur to external storage;
write the health of The Minotaur to external storage;
write the wisdom of The Minotaur to external storage.
Report restoring the game:
read the strength of The Minotaur from external storage;
read the health of The Minotaur from external storage;
read the wisdom of The Minotaur from external storage.
And this data would simply be appended to the save file as a list of key/value pairs.
Obviously if the author changes “The Minotaur” to “The Cyclops”, that’s a breaking change. Or if any of the existing properties of The Minotaur are changed, that’s a breaking change. But this could be a useful way to enable cross-version support for save files.
Thoughts?