Saturday, July 2, 2016

state - Distinction between constant and changeable game objects in save/load game?


Do you distinguish constant and changeable game objects when you save/load game? If yes, how do you do it?


If not to save constant objects (for example, mountains and trees), we optimize memory usage and save/load time. But functional requirements for the game can change. Now you want trees to be mutable and destroyable. It can screw up all previous game states. Trees were not saved => saved game map is interpreted as the prairie without trees.



Answer



Saved games should either:



  • Completely describe everything, whether mutable or not. This is the safest way, and easy, but does use a lot more space. It doesn't really use more memory, since you need the trees either way. It just uses more persistent storage, which there is plenty of on anything that's not a Nintendo DS. It also means you can't fix bugs in levels without players having to restart the game to get the bug fix.

  • Describe differences between the default map state and its current state. This solves the tree example you give. The save game says nothing about trees; therefore the trees are in their default place on the map. It means you cannot do the reverse - change something from mutable to fixed - but there is obviously no way to do that and preserve the save file accurately.



No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...