Page 1 of 1
loading game in subscenes
Posted: Tue Mar 26, 2019 6:52 pm
by GorkaGames
Hi Tony,
Regarding the save / load system, once the scene loads where the save system is located it "listen" all the savers components to initialize your game objects. That's ok, but does it work also if you stream later more scenes async (for instance new terrain / islands/ etc...) where you have also more gameobjects with savers?
Thanks
Re: loading game in subscenes
Posted: Tue Mar 26, 2019 8:45 pm
by Tony Li
Hi,
Not yet, but this is something I'm looking into. Currently I think each saver will have a "Restore State On Start" checkbox. If ticked, the saver's Start method will load the saver's state from the current saved game state. To prevent unexpected changes in existing projects, this checkbox will default to unticked.
When you additively stream in a new subscene, its savers will check "Restore State On Start" and restore their state.
Before unloading a scene, you will need to call SaveSystem.RecordSavedGameData().
Re: loading game in subscenes
Posted: Wed Mar 27, 2019 12:13 pm
by GorkaGames
Are you adding this to the next update?
I'm going to need it as we are using additive scenes now.
Thanks.
EDIT:
PS: I wouldn't need to call SaveSystem.RecordSavedGameData() if I don't need to save the game's state on that moment, would I?
I mean I'm only saving the game automatically by script every time one quest node changes state.
Re: loading game in subscenes
Posted: Wed Mar 27, 2019 2:52 pm
by Tony Li
I will try my best to add this to the next update. If I can, I'll send you a beta version to test beforehand.
You're correct that you won't need to call SaveSystem.RecordSavedGameData(). However, as your game grows and you add more savers, check the performance of saving the game after every node change. Make sure that the performance stays acceptable.
Re: loading game in subscenes
Posted: Wed Mar 27, 2019 4:14 pm
by GorkaGames
At the moment its acceptable just for the same reason, I do have a small amount of scenes (and therefore savers) active and loaded at any given time, as we load them when the player reaches new areas / island in additive way (additive scenes)
Re: loading game in subscenes
Posted: Thu Mar 28, 2019 5:44 am
by GorkaGames
Just thinking on this above....in a given time, I save the game with lets say only 10% of the total scenes (and therefore savers), do I lose info (the total project / savers) on the save file?
I mean, if I'm loading / saving in chunks, do the total project is stable or do I lose information?
I understand that if 100% of the savers are available at start everything works as expected, but if you are loading / saving in chunks?......
Re: loading game in subscenes
Posted: Thu Mar 28, 2019 9:48 am
by Tony Li
As long as you've ticked Save Across Scene Changes, the saved data will remain even if the saver is no longer present. They won't take any extra time when saving, either, because only existing savers do work when saving a game.
The Save Across Scene Changes checkboxes exist because you might not need to restore everything to their exact state when returning to a scene. It's important to save quest info and the alive/dead state of bosses exactly. But, for example, say you save the position of a bird flying in the air. If the player saves and immediately loads the game, the bird should reappear in its exact place. But if the player leaves the scene and returns later, it's okay if the bird isn't in its exact place. This allows you to keep the saved game data smaller.
Re: loading game in subscenes
Posted: Thu Mar 28, 2019 12:04 pm
by GorkaGames
okkkkk