There are many ways.
At one extreme a saved game is nothing more than a memory memory dump. You take all of the bits that are in memory and write it to a file. When you reload the game, you are just loading that saved state into memory again. It’s easy to implement and is perfect. The drawback is that the save file is generally measured in gigs. This is exactly how “quick resume” works on Xbox.
At the other extreme you have “saves” for read-only cartridges. The game can’t keep any records of what you’ve previously done since it can’t write anything to storage. If you only care about what level you are on, the health bar and number of lives when you started the level you could encode that information in just a few characters. For carts where there is no save file at all, you just encode relevant information for resuming the game in something like an 8 character string.
These two extremes are the only two trivial solutions. Everything else takes effort.
The other methods require you define what information is important to keep and what information is not. For example, the location of an NPC might or might not be important for a game save. These games can maintain a database of records of state and events that are important to keep such as items, NPC conversations, completed quests, locations of moveable objects, changeable stats, and such while they do not keep information that is not important to keep.
Latest Answers