Hello, I have been reading and watching tutorials about this but still a bit confused.
Ok, so in the engine you can have different maps (or levels) where any specific data related to them is lost when transitioning from one level to another. Additionally you can use your own GameInstance to store persistent data among levels.
Now let’s say I have a strategy-building game where I have 3 main levels:
- Your colony where you have all your buildings together with a lot of info about each one. Let’s say 1000 buildings with their coords, state, health, etc.
- An outside map of your colony where there are plenty of units around, resources, etc.
- Cinematics and dialogue with the player for quests, diplomacy, etc.
If in the middle of a game the player switch to the outside map, and after a few seconds switch back to the colony map. Am I supposed to load/save the thousands of variables involved in the different maps?
What about if I also want to store another bunch of state variables like, how are your relations with the rest of the factions; the spawn list for incoming new resources to the map, incoming events, how is the weather, etc… Where am I supposed to store them to be persistent?
How would be loaded/saved to a file the vars from all the levels?