Different levels of "persistent" saving
Posted: Fri Jan 28, 2022 1:51 pm
I previously asked a variant of this question with a slightly different use case, but now I'm trying to set up a save system for my game that has two types of items: normal items and "quest" items. I have a somewhat usual plan for the saving system where saving and reloading is a form of time travel in that quest items travel back in time (similar to persistent items in Majora's Mask).
I have everything working for normal items using a persistent inventory component on the inventory containing normal items. I can do something like the following:
1. Start a new game.
2. Obtain an item.
3. Save and quit.
4. Reload the game.
5. The item I obtained is still in the inventory.
I can also do this:
1. Start a new game.
2. Save the game.
3. Obtain an item.
4. Reload the save from step 2.
5. I no longer have the item.
Both of these are correct for normal items, but for quest items, I want the item to still be present after reloading the earlier save (unless the whole save file is erased). Would it make sense to save quest items to some persistent slot like -1? If so, what methods can I use to save only the persistent inventory (or whatever component I should use instead) and reload from it (on top of other things I'm reloading from the specific slot) to get back the quest items? Alternately, is there a way to save just the persistent quest inventory (and nothing else) to the slot I'm about to load from right before I load it?
I have everything working for normal items using a persistent inventory component on the inventory containing normal items. I can do something like the following:
1. Start a new game.
2. Obtain an item.
3. Save and quit.
4. Reload the game.
5. The item I obtained is still in the inventory.
I can also do this:
1. Start a new game.
2. Save the game.
3. Obtain an item.
4. Reload the save from step 2.
5. I no longer have the item.
Both of these are correct for normal items, but for quest items, I want the item to still be present after reloading the earlier save (unless the whole save file is erased). Would it make sense to save quest items to some persistent slot like -1? If so, what methods can I use to save only the persistent inventory (or whatever component I should use instead) and reload from it (on top of other things I'm reloading from the specific slot) to get back the quest items? Alternately, is there a way to save just the persistent quest inventory (and nothing else) to the slot I'm about to load from right before I load it?