Ali Sheikhpour
Ali Sheikhpour

Reputation: 11096

Looking for enhanced algorithms : Save game state

I used to serialize objects states and save them to a database (or XML file) to load later however I have no idea how some games preserve game state in any time without heavy saving actions or a background scheduled auto save. I used File.WriteAllBytes and File.ReadAllBytes in C# + unity3d and I have similar experience using Java serialization but both of them are time consuming and need some seconds to write data into file or database.

In some City Management Games, any time I close the game it is closed instantly and there is no boring saving and no background process after closing as I have in a simple game. There are too many characters in the game and I have noticed they are loaded later by all minor details as well as an incomplete laugh voice! I wonder how this amount of data is being saved instantly in any time?

Are there enhanced algorithms to keep live state of too many characters at every time?

Upvotes: 1

Views: 264

Answers (1)

Loading
Loading

Reputation: 1120

In unity you can use scriptable objects. Just store each saveable thing the moment it happens. This way you dont have any exit time.

Upvotes: 1

Related Questions