Version Number vs Schema Hash for Love2D Save Compatibility
0 reputation · 17 Jul 2020, 00:37 UTC
Version number or schema hash for Love2D save compatibility?
I need a Love2D game to detect when a saved file was written by an older code revision so it can refuse or migrate the load instead of crashing on missing fields. love.filesystem places no schema on save data, so the format must carry its own compatibility marker.
A version integer is trivial to store and compare, but it cannot distinguish safe additions from breaking changes inside the same release. A schema hash catches field-level changes, though its reliability depends on deterministic serialization and key ordering, and computing it on every load may affect startup time on low-end devices.
Should the save format embed a plain version number, a schema hash, or both to balance compatibility checking against load performance?