Saving the entire state?

Discussion and help for Easy Save 3
Post Reply
doodlinbee
Posts: 23
Joined: Sat Sep 05, 2020 12:53 pm

Saving the entire state?

Post by doodlinbee »

When playing some older games I realized that the save button take a snapshot of the entire state of the game. When you load the save file it put you in the EXACT same state. Like the NPC's that were in the middle of an animation are loaded in this exact animation frame; the dynamic puffs of smoke are still there; even all of the sounds that were playing and the music are played back at the exactly where they were.

So the question is, is there a way to replicate this behaviour in Easy Save? If not, how do you think did they achieve that in those games?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving the entire state?

Post by Joel »

Hi there,

Older games had an advantage in the sense that you could copy the entire contents of RAM and load this back in to the device. In Unity (and modern computing in general) this isn't possible. Some OSes have functionality like this to restore the state from sleep, but it works at an OS level rather than an application level so isn't accessible in a way that a game would be able to use it.

The game state of modern games is also disproportionately larger than those of 'older' games, so to automatically save the entire state of the game at a memory level would create extremely large save files.

Instead it's necessary to save and load only the variables which are required to restore the state. In some cases Unity doesn't provide the functionality to be able to restore the state of some of these variables at runtime. For example, certain aspects of Animations are not serializable at runtime, especially those aspects based around Events, as Events cannot be serialized at runtime in a way that could then be reloaded in a new session.

Sometimes attempting to restore everything about the state requires more effort than it would provide benefit to the user, or still would require too much storage/power. This is why things such as checkpoints have become prevalent in modern games. It simplifies the development process and streamlines the process of saving and loading.

Hope this is helpful!

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
doodlinbee
Posts: 23
Joined: Sat Sep 05, 2020 12:53 pm

Re: Saving the entire state?

Post by doodlinbee »

I see that explains a lot of things. Thanks for the explanation :D
Post Reply