Reference Manager: What is it?

Discussion and help for Easy Save 3
Post Reply
christoph
Posts: 4
Joined: Thu Oct 29, 2020 11:29 pm

Reference Manager: What is it?

Post by christoph »

So I'm still a rookie in developing and I use Playmaker for my games. When I started to use Unity I also immediately started to use Easy Save. I just now have a problem that my Unity main scene is bigger than 100mb and I can't upload anymore to git. Researching the reasons of why this is happening seems that the Easy Save Reference Manager in my scene bloats the size up all over 100mb. When I delete the Manager my scene goes down to 11mb.

What is the Reference Manager for? I read that Joel said somewhere else here on the forum: The reference manager is only required if you're saving reference types (or value types with fields containing reference types). If you are only saving value types then you won't be prompted to add it. What does that exactly mean? What are reference types? Can someone explain as if I were 5?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Reference Manager: What is it?

Post by Joel »

Hi there,

Have you tried pressing the Optimize button on the ES3ReferenceMgr Component of the Easy Save 3 Manager in your scenes? This will remove anything which is no longer referenced by your scene.

The reference manager basically keeps a list of everything which your scene uses and assigns a unique ID to it. This allows Easy Save to then load a reference to those things. Sometimes you'll add something to your scene and then remove it, but this will still be in the reference manager. Pressing the Optimize button removes anything which is no longer being used by your scene.

If this doesn't resolve your issue, try removing the reference manager and re-adding it. You will also need to delete any save data (Tools > Easy Save 3 > Open Persistent Data Path) as doing this will generate new unique IDs for your references.

If this doesn't resolve your issue, your next option would be to manually manage the references. You can do this by deleting the manager from your scene and then going to Tools > Easy Save 3 > Settings and unchecking Auto Update References and Auto Add Prefabs to Mgr. Then you can re-add the manager to your scene. You will then need to add reference types which is being saved by reference to the manager manually by right-clicking it and selecting Easy Save 3 > Add References to Manager. For example if you are saving a GameObject, you will need to right-click this GameObject and select Easy Save 3 > Add References to Manager. If you are unsure of what a reference is then I would avoid this approach unless absolutely necessary however.

Regarding more specifically what a reference is in Unity and C#, it may be worth looking at a guide for more information on this:
https://www.codecademy.com/learn/learn- ... cheatsheet

For example, all Unity scripts and GameObjects are reference types. Primitive types and structs such as ints, floats, bools, strings, Vector3s, etc are value types. If you are saving or loading references, Easy Save will throw a warning if there is no manager in your scene. If you don't receive this warning then you don't need a manager in your scene.
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
christoph
Posts: 4
Joined: Thu Oct 29, 2020 11:29 pm

Re: Reference Manager: What is it?

Post by christoph »

Thanks so much for taking the time to write all this. I actually think I do not need a manager since I do not save any gameobjects, prefabs or scripts in my game (at least I do not remember that I do). I must have added it at the very beginning of my journey when I thought I needed to save level prefabs. But in the end I solved this saving the index from an array instead.

Are there no other downsides of not using the Manager? Maybe slower saving/loading times ofr value types?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Reference Manager: What is it?

Post by Joel »

If you're not saving reference types, there's no advantage to using the manager :)
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply