Hello all,
I thought I'd post how I'm tackling save-games in my project to see if anyone could learn anything from it, or likewise offer some ideas that might help me out. This is the first time I'm dealing with data storage through Unity, using the PlayerPrefs actions. It feels awkward, but doable!
My project has 5 story objectives within it, with 20 collectible items. The game saves the progress after an objective is fully completed, or when a collectible item is picked up.
Progression through story objectives is linear, so I'm using an Int to store the progress for those. If the Int is 0, the game begins with the intro. Each time an objective is completed +1 is added to the Int. This Int is read at runtime and the value determines the state of the world, relative to the objectives completed.
Collectible items can be acquired in any order at any time, and since they are completely independent of the story and main objectives I was going to use one boolean for each item.
Finally, the way I will process these is to read the main story Int, and each of the 20 booleans at runtime/title screen. Then I will load the save-game screen and have strings reflect the state of the games progress. During gameplay, each time an item is acquired or an objective completed, the game will pause momentarily and write to the Int or associated Bool, effectively autosaving the state of the game.
That's as far as I've gotten. I think it should work fine, but I wonder if I'm going about it wrong. I hope this encourages discussion to help my situation and hopefully others too.
As always, thanks for reading!