a related suggestion, i suppose: maybe exclude some globals from being serialized to avoid trashing? from my testing, it seems that story modules get executed on every launch. this makes serializing any globals set in module body pointless (or even harmful/confusing), as they will be overwritten on game start. you could allow the game to set a glob string to filter globals by (flat or recursive). example:
prog = {money = 700, day = 1}
events = {
{ id = "merchant", day = 3, is_available = function() <...> end }
}
--only save children of prog recursively;
-- default glob would be ** for backwards compat
setSaveDataGlob("prog/**")