Page 1 of 1

Calling "Optimize" at runtime

Posted: Mon Jan 17, 2022 5:43 pm
by funtomata
Hello,
my game has a persistent scene and each level is loaded additively, you can sometimes go back and forth between scenes, but there are some points where you can no longer go back. My Reference Manager is on my persistent scene, and it works perfectly fine, but as the game goes on, the number of references keep increasing more and more.

I was wondering if it was possible to clean unnecessary references at runtime, by calling the Optimize method on the Reference Manager. Is that its intended purpose, or will something backfire if I do that? And if it isn't the proper way, how can I best deal with this?

Re: Calling "Optimize" at runtime

Posted: Mon Jan 17, 2022 8:05 pm
by Joel
Hi there,

Having a large reference list is unlikely to affect performance as its simply a Dictionary of reference IDs, which in the context of a game engine is negligible.

I recommend only pursuing this if the Profiler is telling you that this is an issue.

All the best,
Joel