tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
177 stars 41 forks source link

Generic state update handlers? #234

Open tmedwards opened 1 year ago

tmedwards commented 1 year ago

Currently, there's no way to update the game state if the game and state versions desynchronize in-play. For example, if the game is network-hosted and is updated with state breaking changes during someone's play session.

Between-play updates, via saves, are handled via Config.saves.version and Save.onLoad handlers.

Moving the Save machinery to State, as a more generic mechanism that can handle in-play updates too, seems like a good idea.

That said. There's probably no real need for a State equivalent to Save.onSave handlers, so that's a conundrum.