References created/kept for unused sprites.

Discussion and help for Easy Save 3
Post Reply
Abelius
Posts: 11
Joined: Sat Apr 14, 2018 12:26 am

References created/kept for unused sprites.

Post by Abelius »

Hello there,

Looking into the alarming size growth of my game, I discovered that almost every sprite I've used as a placeholder before migrating them to sprite atlases, has been included in my build, even when they're not being legitimately used/referenced anymore in the whole project.

I have an asset hunter plugin called "Maintainer" that's telling me the only references for those sprites are located in:

- ES3 Reference Manager itself in the Main scene (I don't use more scenes).
- The global references scriptable object in Assets.

Image

First thing I did was to click "Optimize". Nothing changed.

Secondly, I read the documentation and searched in the forum for similar issues, and came to the (possibly erroneous?) conclusion that I don't need global references as I only use one scene. So, I unchecked "Auto Update References" and "Use Global References", deleted "ES3GlobalReferences" scriptable object in Assets, and hit "Refresh" in the ES3RefMgr component in the scene...

Image

Image

...and I still have one reference for those sprites. Not from the global references asset anymore, ofc, but from the Manager itself, which seems to insist on keeping a reference for them for no legitimate reason.

Image

Curiously enough with another reference ID number. Is it because I deleted the Global Refs asset...?

Anyway, I know I could force-remove the Manager, and add it again (I need it for 4 custom types I created). Then the problem is solved...:

Image

Then I can hit "Refresh" and those ghost references aren't recreated anymore, and all is fine and dandy regarding those sprites.

Those custom types... I guess they're getting their data into their components because I'm using "Load Into" Playmaker actions. If not, I guess I'd have a problem.

So, even though I've solved my problem, I'd still would like to know why I needed to recreate the whole ref DB. I know I could have deleted those refs manually, but I have more than 34K references, so it's just scroll down that list.

My versions are...:

Unity 2019.4.9f1
ES3 3.3.2f7 (last version in my change log file)

Additional info: those sprites were originally referenced inside a prefab.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: References created/kept for unused sprites.

Post by Joel »

Hi there,

As I don't appear to be able to replicate this at my end, please could you create a new project with a simple scene which replicates the issue and private message it to me with instructions so I can understand what is happening?

I also recommend using the latest version of Easy Save as there have been a few updates and bug fixes regarding the reference manager since the version you are using.

Also just to clarify, the Refresh button will add any new references from your scene into the manager. It won't delete references which are already in there. This is why you needed to delete the manager to remove the old entries.

Another thing to note is that the Global References list is only used in the Editor, is not used at runtime, is not included in builds, and only stores references to things which are already in your project. When a reference is added to the ES3ReferenceMgr in your scene, it will first look at the Global References list to see if an ID already exists for that object. This allows the same ID to be used across scenes.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Abelius
Posts: 11
Joined: Sat Apr 14, 2018 12:26 am

Re: References created/kept for unused sprites.

Post by Abelius »

Hello Joel,

I appreciate your quick reply, thanks.
Joel wrote: Fri Jul 01, 2022 12:18 pm Hi there,

As I don't appear to be able to replicate this at my end, please could you create a new project with a simple scene which replicates the issue and private message it to me with instructions so I can understand what is happening?
I'll probably leave it at this, because it's working now and I'm afraid I have my hands (and feet, lol) full with this project.
Joel wrote: Fri Jul 01, 2022 12:18 pm I also recommend using the latest version of Easy Save as there have been a few updates and bug fixes regarding the reference manager since the version you are using.
Will do. I need to be careful with updates because I was stupid and modified some scripts without making notes.
Joel wrote: Fri Jul 01, 2022 12:18 pm Also just to clarify, the Refresh button will add any new references from your scene into the manager. It won't delete references which are already in there. This is why you needed to delete the manager to remove the old entries.
Yes, but I was wondering about the "Optimize" button. That was my first option to remove those orphaned references, but it didn't considered them orphaned because they had references created. A Catch22 situation.

Thank you!
Post Reply