What happens when you save a game?

542 views

What happens when you save a game?

In: Technology

6 Answers

Anonymous 0 Comments

The game creates or updates a file that it is using to store your current game state.

This can be a very basic set of information (like what level you were on) or a massive set of information like the positions of hundreds of items you’ve littered all over Skyrim, the contents of numerous storage containers, the quests you’ve completed, the state of every NPC…

Exactly what is saved and in what format varies considerably between games.

Anonymous 0 Comments

Take a very simple game like pong. The way the game works is to have variables that store the position of the two paddles, position of the ball, and the direction and speed the ball is going.

Every time the screen is redrawn, it checks to see if there’s user input to move the paddles, and if so updates their location, and updates the position coordinates of the ball depending on its speed and direction. It then draws everything on the screen.

Therefore to save the game, all it needs to do is store the contents of these variables somewhere. By restoring this information, it can draw everything exactly as it was when the game was saved.

For more modern games, it’s really just the amount of this “state” data that has increased.

Anonymous 0 Comments

When you play a game there are some parts that are the same for every player at all times. For example; the image for the background or information on how much damage a particular weapon causes. Those are just the regular game files. You get them when you get the game and they don’t change.

But as you play there are things that need to be recorded that are specific to you and your current point in the play through. For example; your character’s name or your current level. When you save a game all that stuff gets written to disk somewhere.

When you start the game next time it first loads the stuff that doesn’t change. Then when you load a particular game it reads all the stuff in your save file.

Anonymous 0 Comments

The computer writes all the infomation about your game into a file. Like where you are in the world, where the monsters are, which direction you’re facing, how many bullets and hit points you have, etc. When you load it, it opens the file and looks at all this information and uses it to set up the game the same way it was when you saved it.

Anonymous 0 Comments

An analogy: If you’re playing chess and need to pack the game away, you can write down a list of where every piece is and whose turn it is, then put the game away and re-set it up later. That paper is your saved game.

Video games do a version of this. They take the current state of the game, simplify it down to the details that they need to reconstruct the current state and save those details on your hard drive.

(There’s usually a lot of details for some games, for others it’s literally just a “the player is at this chapter”. There’s compression and a lot of other stuff going on as well.)

Anonymous 0 Comments

The computer writes down a note with all the important stuff about where you are in your game right then. When you close and open a game, the computer has to re-create everything about it, so it can look at notes from previous times it ran that program to restore your progress. It doesn’t write down everything, just key stuff that’s important for you to feel like things are the same when you come back