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

1.15K 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

In general, programs have variables. If you’ve ever done algebra you might have an idea of what variables are, except in programming variables be several types. A string is any arbitrary word or phrase, an int (or real or double – depending on programming language) is a number you can do math on, or check things like greater or less than, and there’s a boolean which is either True or False (1 or 0, Yes or No).

The example I always give is Zelda, how you name your character is a String, how many rupees you have is an int, whether you have beaten the first level is a boolean.

And then this data is all saved. Except it isn’t just saved to a text file (usually) because they don’t want people just editing the text file to cheat, so they encrypt these variables in some way in the file and decrypt when they load your game.

Keep in mind you’re keeping track of a lot more than a few variables. Every enemy has an x and y coordinate, a health value (0 to 100), any other important stats, etc.

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