loading game in subscenes

Announcements, support questions, and discussion for Quest Machine.
Post Reply
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

loading game in subscenes

Post 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
User avatar
Tony Li
Posts: 20774
Joined: Thu Jul 18, 2013 1:27 pm

Re: loading game in subscenes

Post 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().
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: loading game in subscenes

Post 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.
User avatar
Tony Li
Posts: 20774
Joined: Thu Jul 18, 2013 1:27 pm

Re: loading game in subscenes

Post 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.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: loading game in subscenes

Post 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)
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: loading game in subscenes

Post 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?......
User avatar
Tony Li
Posts: 20774
Joined: Thu Jul 18, 2013 1:27 pm

Re: loading game in subscenes

Post 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.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: loading game in subscenes

Post by GorkaGames »

okkkkk
Post Reply