A save file can be valid JSON and still describe a world your current game no longer understands. Perhaps coins became wallet, an item changed its display name, or a level moved to a different scene path. Parsing succeeded; interpretation failed.
Give the save format an explicit version, store durable identifiers for game content, and migrate older records into the current shape before applying them to the world. This article focuses on that data contract. It does not attempt to solve interrupted disk writes, cloud conflicts or every possible corrupted file.
Godot's saving-games tutorial shows how to identify persistent objects and serialize selected values. It also explains JSON's limitations, including its lack of native Vector2 support. Treat that example as a starting point for deciding what the game needs to remember.
Save meaning, not incidental node structure
Suppose an illustrative puzzle game has a door named Door2 in the editor. Its position in the scene tree is convenient today, but a designer may rename or regroup it tomorrow. A record keyed by World/Room/Door2 makes an editor organization decision part of the save contract.
Instead, assign a durable game ID, such as observatory_east_door. The loader maps that ID to an object in the current build. You still need a policy for a removed door, but a harmless rename no longer changes the meaning of a save.
Use the same distinction for items. item_id: "copper_key" is a reference to content. display_name: "Copper Key" is presentation, and may change with localization. Store quantities and essential state separately from a label the player sees.
Not every object needs a global identity. A short-lived particle effect probably does not need to be saved at all. Deciding what can be reconstructed is often more valuable than serializing every property.
A small migration with an observable result
Here are two versions of a deliberately tiny format:
{"format_version": 1, "coins": 12, "room_id": "workshop"} {"format_version": 2, "wallet": 12, "room_id": "workshop"} The migration renames a field while preserving its value. This pure Python example demonstrates the contract independently of a game engine:
def migrate_save(record): if not isinstance(record, dict): raise ValueError("save must be an object") result = dict(record) version = result.get("format_version") if type(version) is not int or version not in (1, 2): raise ValueError("unsupported save version") if version == 1: if "coins" not in result or "wallet" in result: raise ValueError("ambiguous version 1 wallet") result["wallet"] = result.pop("coins") result["format_version"] = 2 if type(result.get("wallet")) is not int or result["wallet"] < 0: raise ValueError("invalid wallet") if result.get("room_id") not in {"workshop", "observatory"}: raise ValueError("unknown room") return result The exact type checks deliberately reject Boolean values, because Python treats bool as a subclass of int. This is an illustrative schema, so the allowed rooms and nonnegative wallet are explicit game rules rather than universal save requirements.
A version-one record with 12 coins becomes a version-two record with wallet 12. A record from a future version is rejected rather than guessed at. Local Python checks verified those outcomes, invalid-value rejection and preservation of the original input dictionary. Translate that same policy into your game's language; do not transplant Python into a GDScript project just to migrate two fields.
Validate before changing the live world
Separate reading, migration, validation and application. Parse into temporary data, migrate it, then verify the resulting identifiers and value ranges. Only after the full record is acceptable should the game replace the active session.
Otherwise a loader can move the player to a new room, discover an invalid inventory halfway through, and leave a world assembled from two different saves. A useful error is “this save cannot be loaded by this build,” while keeping the current session intact.
Unknown fields need a policy too. Keeping them can help round-tripping within a supported format; dropping them can simplify a tightly controlled schema. Neither choice makes an unsupported future version safe to load. A higher version number may represent changed meanings, not merely extra fields.
Before any destructive conversion, retain an untouched copy. Jitsumi's guide to backing up Steam game saves explains why a recoverable older version is different from another synchronized copy of the same mistake.
Keep fixtures from released versions
Save one small example from every format you support. Check that the oldest fixture migrates to the same current meaning as a newly created save. Include a removed item ID, an unknown room, a negative quantity and an unsupported future version.
Then test the game-level result: the correct door remains open, the correct room loads, and the inventory contains the intended item. A structurally valid object is only the first half of the contract.
You do not need an elaborate migration framework for a small project. A version field, a sequence of named transformations and a handful of old fixtures can be enough. Add those while the format is small, when “what did this field mean?” still has an answer.
