Delete reference to Unity object

Forums 💬 NodeCanvas ⚙️ Support Delete reference to Unity object

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #16449
    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 ?

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

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

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

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

              #16455
              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!

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

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

                    #16452
                    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)

                      #16451
                      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 🙂

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