We are on optimization and found that having all animation references on graph was loading all our atlas.
We managed to put them on prefab blackboard, however it seems that NodeCanvas keep referencing them.
Hmm. As far as I know, this is just how Unity works. If an object (eg AnimationClip) has a serialized reference to another object (eg atlas), then when the object is loaded so will all it’s references. NodeCanvas does not do anything special in this regard really.
It was not clear, sorry. We referenced asset in our graph. now we are pooling it, we wanted to change this by referencing blackboard variables. But the graph is still keeping reference to previous asset, causing them to load.
Changing from asset to blackboard doesn’t delete reference id in json.
Are you certain that the asset in question, is not referenced anywhere in the graph? If it is not, then when the graph serialize it should clear all references that are not really referenced anymore.
Could it be that you are using the local graph blackboard instead of the GraphOwner blackboard component for referencing the asset in question? If so, the local graph blackboard is serialized together with the graph (same json). It seems like this could be the case here, but let please me know.
Yes we are pretty certain it keep referencing non blackboard asset if you don’t put to null / save first.
Setting as blackboard value just add a name on the json file, but don’t dleete the asset refernce key. Now it’s too late for a NodeCanvas update for us (because I hacked a lot for optimization) but can you double/triple chekc this part ? Because it’s a big issue.
<p style=”text-align: left;”>For us it was just putting an action referencing asset in a graph asset (not bound). Putting in an asset. Saving. Making an app and profile memory. You will see the asset loaded.</p>
After this, we replaced the asset by putting a variable value (not a graph blackboard variable), changing the reference on the action by a blackboard reference.
Load the game, load the graph without graph owner assignation. See that the asset is in memory with the profiler and as you never assigned it to a blackboard through graphowner, it don t have to be referenced !
It s a lot of work to see it. We had this because we are pooling the used graph for a level.
But you could see that referencing the blackboard value really don t override the referencing asset id in graph the json.
Oh, now I understand what you mean. Thanks for the information.
Indeed when changing from using a value to a variable instead, the value is not cleared (returned to default). I’ve just fixed this and I am sending you the updated file to your registered email.
Have you added some “cleaning” code when saving again the graph ? Because the game is like 120 differents graph, 1 years and 3 months of work. So i doubt i can go throught each references and remove / add again balckboard variable to clean the json x)
Hey,
I have just resent the email (please check your spam as well).
Yes, they should be auto cleaned when the graph gets serialized (no manual action required other than the graph needs to be serialized).