Auto Save in multi scene setup

Discussion and help for Easy Save 3
Post Reply
Torsteinara
Posts: 3
Joined: Thu Aug 17, 2023 11:21 am

Auto Save in multi scene setup

Post by Torsteinara »

Hey, I've run into some problems using ES3 auto save for our setup. It seems like they're incompatible, but maybe I've missed something?

So, our workflow has the player object and some managers in a scene that's always loaded (similar to DontDestroyOnLoad), while level content exists in other separate scenes. So there's always at least two scenes loaded, and they each have a Reference Manager and Auto Save Mgr that are supposed to take care of saving the state of their respective scenes.

But ReferenceMgr uses a singleton setup that merges all the multiple managers into one. So I end up with only one manager, which sits in the scene that's always loaded, and it's trying to manage objects in all the other scenes I load and unload. And that doesn't work very well. Is there some way to work around this? And have each scene actually manage their own objects, even with multiple scenes loaded.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Auto Save in multi scene setup

Post by Joel »

Hi there,

We've had no reports of issues with additive scenes and Auto Save, and merging of the reference managers is intended behaviour in this circumstance.
and it's trying to manage objects in all the other scenes I load and unload. And that doesn't work very well
Could you explain how it doesn't work well?

Also note that most issues with additive scenes relate to the order in which things are called. In some cases changing the Load event to Start rather than Awake resolves issues because it ensures loading is called after initialisation.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Torsteinara
Posts: 3
Joined: Thu Aug 17, 2023 11:21 am

Re: Auto Save in multi scene setup

Post by Torsteinara »

Sure! Thanks for responding so quickly 😀

I have a permanently loaded “core scene”, and a then additively load scenes for “level 1” and so on. Each scene has a set of ES3 ref manager and auto save manager. When I load a level scene, its ref manager is merged into the one in the core scene. Which then manages objects across all scenes.

I have some pre-existing gameobjects in each level scene, with components that are set to be managed by auto save. On load ES3 creates new copies of those gameobjects rather than modifying the already existing ones. Maybe not strange since the objects live in a different scene from the manager. Though the new copies are created in the correct level scene, as long as it’s available when ES3 loads. If not, they are created in the core scene. Either way it creates duplicates, which breaks the game. And if they are created in the core scene it’s even more problematic, since it should stay clean.

We also instantiate a lot of prefabs (managed by auto save) in the level scenes. On load they all get reinstantiated, but in the core scene. It doesn’t seem to matter if the level scene is available? This similarly breaks our scene structure.

Auto Save has been very nice for us so far while prototyping everything in one scene. But we plan to load and unload a lot of different level scenes. So we need a system that can save/load the data of each scene individually, only into those scenes, when each scene is loaded/unloaded. But per-scene loading like that may be a bit outside the scope of Auto Save?

Thanks,
Torstein
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Auto Save in multi scene setup

Post by Joel »

Hi there,

The reference manager isn't what manages saving and loading, this only contains a list of everything which can be referenced and it's reference ID, which means it doesn't matter what scene it's in (it can be accessed from any scene). The Auto Save Manager is what manages saving, and these are not merged and will be one in each scene in which you're saving.

This sounds more to me like an order issue (i.e. something being loaded in a scene before it's reference manager has been initialised), in which case setting your Load Event to Start should resolve the issue.

If this doesn't, if you private message me your invoice number I can create a version of Easy Save for you which doesn't merge the reference managers.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Torsteinara
Posts: 3
Joined: Thu Aug 17, 2023 11:21 am

Re: Auto Save in multi scene setup

Post by Torsteinara »

Oh wow, that's very kind! Since you think it should be possible to make it work with some tweaking I'll try that 🙂
Post Reply