Delete reference to Unity object

NodeCanvas Forums Support Delete reference to Unity object

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #14787
    Driiade
    Participant

    Hello,

    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.

    Any idea how to clean up these references ?

    #14788
    Gavalakis
    Keymaster

    Hey!

    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.

    Join us on Discord: https://discord.gg/97q2Rjh

    #14789
    Driiade
    Participant

    Hello,

    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.

    #14790
    Gavalakis
    Keymaster

    Hello again,

    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.

    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    #14808
    Driiade
    Participant

    Hello,

    Sorry for the late respond.

    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.

    #14813
    Gavalakis
    Keymaster

    Hello again,

    Hmm.. Are there any steps I can reproduce this behaviour please? If so that would be very helpful into looking at this.

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    #14820
    Driiade
    Participant

    <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.

    #14830
    Gavalakis
    Keymaster

    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.

    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    #14842
    Driiade
    Participant

    Hey !

     

    Cool =) really good news to kill those weird RAM Usage x).

     

    I didn’t receive the mail. It s benoit.constantin@hotmail.com .

     

    I will check to add this on the v2 of the game :p

    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)

    #14847
    Gavalakis
    Keymaster

    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).

    Thanks 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    #14855
    Driiade
    Participant

    Perfect ! I received it =) .
    Thank for the support !

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.