https://egmatic.com/blog/save-game-progress-save-system-guide

Save Systems Explained: How to Save Game Progress

July 10, 2026 (updated October 22, 2026) · Vladislav Kovnerov · 10

A save system has one job: take the player's game state, turn it into data, write that data to storage, and read it back later to restore the game exactly as it was. The reading and writing are simple. The hard parts are three: deciding what counts as state worth saving, writing in a way that can never corrupt the file, and keeping old saves working after you change the game.

This guide is the practical version for solo developers and small studios. It covers what belongs in a save, the serialization formats to choose from, the one pattern that prevents corruption, and how to version your data so an update does not break every save your players have made. Everything here reflects how storage and serialization actually behave — no invented retention numbers.

One scope note before the design work: a save system is part of what makes a game count as finished, not a reason to postpone finishing. If the project itself keeps stalling, the discipline of finishing your first game comes first, and the rest of this guide will be waiting when there is something worth saving. If you are still deciding whether your game needs a backend at all, does my game need a database? settles that question first.

Save state, not derived data

The first decision is what to save. The rule is simple: save the data that defines the player's progress, and recompute everything else.

Save the things the player earned or chose — character position, inventory, current level, completed objectives, unlocked abilities, story choices, and settings like audio levels and control mappings. Do not save anything you can derive: cached enemy positions, precomputed totals, transient visual state.

Save itRecompute it
Player position, health, inventoryCamera position, current animation frame
Level completed flags, unlocked contentPathfinding caches, derived score totals
Story choices, settingsParticle positions, temporary effects

The reason to leave derived data out is not just size. If you store a value that can be recalculated, and your game logic changes, the stored value becomes a contradiction. A save that holds both the source data and a stale derived total will disagree with itself. Save the source, recompute the rest, and the save is always internally consistent.

Choose a serialization format

Serialization is the act of turning your in-memory objects into bytes you can store, and back again. Three formats cover almost every game.

FormatReadableSizeSpeedBest for
JSONYes (text)LargerModerateDevelopment and most small games
BinaryNoSmallFastLarge saves, performance-sensitive loads
Protocol Buffers (protobuf)No (but schema)SmallFastStrict schemas, cross-language

The honest recommendation for a small game is JSON. A save file you can open in a text editor and read is worth far more than the bytes a binary format saves you — when a save breaks in the wild, you will want to read it. Reach for binary or protobuf only when your saves are large enough, or your loads slow enough, that the size actually matters. For most 2D games it never does.

One note on the readability trade-off: a human-readable save file is also a file a curious or malicious player can edit. That is fine for a single-player game, and arguably a feature for the modding community. Treat it as a consideration, not a blocker.

The atomic write pattern

This is the single most important technique in the whole guide, and the one most indie games get wrong.

The naive approach is to open the save file and write to it directly. The problem is that writing is not instantaneous, and if the game crashes, the device loses power, or the OS interrupts the process mid-write, you are left with a file that is half old data and half new — a corrupt save the game cannot read.

The fix is to never write to the live file. Instead:

  1. Write the new save data to a temporary file.
  2. Rename the temporary file over the real one.

Renaming a file is an atomic operation on the same volume — it either completes in full or does not happen at all. A crash during the write leaves the temporary file partial, but the real save file is untouched and still valid. A crash during the rename is safe because the OS guarantees the rename itself is atomic. Either the player keeps their old save, or they get the new one — never a broken half.

Failure momentResult
Crash while writing temp fileOld save intact, temp file is garbage (discard it)
Crash during renameOne of the two files is whole, never a blend
Clean completionNew save replaces old

This pattern costs almost nothing to implement and removes essentially all save corruption from power loss and crashes. Combined with keeping one or two backup slots, it makes lost saves a rare event instead of a recurring support ticket.

Version your save format

The day you ship is the day your save format becomes a contract. Players will have saves sitting on their devices across every version of your game you ever release, and each one has to load.

Store a version number in every save file, and never assume the shape of the data on load:

The discipline is to change the format only through a migration. Add a field, bump the version, write the migration that fills the default for older saves. Never silently change what an existing field means, because a player's old save will load the old meaning under the new code and break.

ChangeSafe migration
Add a new fieldDefault value for older saves
Remove a fieldStop reading it; ignore in old saves
Rename a fieldMap old name to new in the loader
Change a value's meaningNew version number, explicit conversion

A versioned, migrated save format is what separates a game whose updates keep old saves working from one whose updates wipe player progress. Players do not forgive the second. That discipline protects your players' saves; versioning the project itself, so your own work survives edits and disasters the same way, is a separate habit covered in the version control and backups guide.

When and where to save

Two independent questions: where the data lives, and how often you write it. The first is bigger than saves alone — whether a game needs a database sets the outer boundary.

Where is partly a platform decision. Local files are the baseline — with quirks of their own in the browser, which how browser games save data covers in full. Platform cloud systems (the console networks, platform-specific sync) replicate saves across devices, which players expect but which adds conflict rules — when a cloud save and a local save disagree, you need a policy, usually "newest wins." Design for the conflict before you hit it. How those replication systems are actually wired on each store and service is a question of its own; the guide to cloud saves and player accounts without a backend walks it route by route, and leaderboards without a backend follow the same pattern when ranking is what you need. Asynchronous multiplayer pushes the same problem further — two devices writing turns to one shared match — and the async multiplayer without a server guide lays out the ordering rules that keep it sane.

How often is a design choice with technical consequences:

The technical rule that covers all three: never save on the hot path in a way the player can feel. Serialization and disk writes take time; do them where the frame budget has room.

Common mistakes

Where Egmatic fits

Egmatic is built around versioned JSON data. The editor produces game data as structured JSON that the engine consumes, so serialization is already a first-class concern in the architecture rather than something bolted on at the end. That same discipline carries straight into saves: a clean, versioned, human-readable format you can inspect when something goes wrong and migrate when your game changes. Egmatic's live preview lets you save, reload, and confirm the state restores exactly — turning the most boring part of save development, testing that saves round-trip, into a fast cycle instead of a slow rebuild loop.

For the serialization habits this article assumes, our guide to MonoGame explains the C# foundation Egmatic is built on, and the 2D performance guide covers the discipline of keeping work off the hot path — the same rule that keeps saving from hitching the game.

Conclusion

A save system is not a feature you add in the last week. It is the discipline of saving source state rather than derived data, choosing a format you can debug, writing atomically so a crash can never corrupt a file, and versioning the format so updates never break a player's progress. Get those four things right and your saves stop being a support burden and start being invisible — which is exactly what they should be.

FAQ

What is a save system in a game?

A save system is the code that converts the player's current game state into data, writes that data to storage, and reads it back later to restore the game exactly as it was. The simple part is reading and writing; the hard parts are deciding what counts as state, writing in a way that never corrupts the file, and keeping old saves working after you update the game.

What should I save and what should I leave out?

Save the state that defines the player's progress — position, inventory, level, unlocked content, choices they made. Leave out anything you can recompute: the positions of non-essential objects, cached values, and derived totals. If a value can be recalculated from other saved values, storing it risks creating contradictions when your game changes.

JSON or binary for save files?

Use JSON while you develop, because you can read and debug a save in a text editor, and switch to a more compact form only if size or speed demands it. Binary is smaller and faster but unreadable when something goes wrong. For most small games the size and speed difference is irrelevant, and JSON's debuggability is worth far more than the bytes it costs.

How do I prevent corrupt save files?

Never write directly to the live save file. Write the new data to a temporary file first, then rename the temporary file over the real one in a single step. Renaming is an atomic operation on the same volume — it either completes fully or does not happen at all — so a crash or power loss mid-write can never leave a half-written save. This one pattern removes almost all corruption.

How do I keep old saves working after an update?

Store a version number in every save file and never assume the shape of the data. When you load a save, read the version and migrate older formats to the current one step by step. Missing fields get default values, renamed fields map to new names. Once you ship, treat your save format as a contract with the player and only change it with a migration in place.

How does Egmatic approach saving?

Egmatic is built around versioned JSON data — the editor produces game data as structured JSON that the engine consumes, so serialization is already a first-class part of the architecture rather than something bolted on. That same discipline applies to saves: a clean, versioned, human-readable format you can inspect and migrate. The live preview lets you save, reload, and confirm state restores correctly without a slow rebuild.