How do people design the save game feature in large/complex games?

1.12K views

The save game feature seems simple but it’s mind-blowing how it can return the exact state of a game with all elements/events organised in the correct order. Can anyone explain how it works?

In: 668

39 Answers

Anonymous 0 Comments

I’m not a game designer but I am a software engineer. There’s a pattern called Event Sourcing that basically tracks all of the events that may happen to a system (that are storage worthy).

To put this into simpler terms, imagine you have a piece of paper (a ledger), a basket, and an apple, and that you record every time the apple is added or removed from the basket. Rather than crossing out or erasing the last line and rewriting it, you would simply add a new line to describe what happened. At the end, you would have a series of additions and removals of the apple to and from the basket, but in the end you still have one apple either in, or out of the basket.

Extrapolate that to much larger game systems and you have, obviously, much more than an apple and a basket, but the theory is the same. Everything that took place was recorded and can be replayed to produce the exact same state as before.

This doesn’t apply to all games/software, as some just save a previous state at a given moment and reload it. This would be more akin to a backup than event sourcing.

You are viewing 1 out of 39 answers, click here to view all answers.