GlobalBlackboard error

Forums 💬 NodeCanvas ⚙️ Support GlobalBlackboard error

  • This topic has 0 replies, 2 voices, and was last updated 7 years ago by Gavalakis.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17378
    psykaw
    Participant

      Hey,

      I got this error when I load a scene with global blackboards not active in scene. Next I load another scene and inspect a task.

      This error occurs because after loading second scene, the list GlobalBlackboard.allGlobals contains null ref. This is due to GlobalBlackboard registration in OnValidate() (called even gameobject is not activated) but is only remove in OnDestroy()(not called when gameobject is not activated).

      I found a workaround by checking null when accessing to the GlobalBlackboard.allGlobal list.
      I tried to simply explain. Thanks.

      #17383
      Gavalakis
      Keymaster

        Hey,

        Thanks for letting me know. I haven’t come across this problem as of yet, but I will try replicate the problem and fix it once I do.
        Just out of curiosity, why would you want a Global Blackboard to be deactivated? 🙂
        Thanks again.

        #17382
        psykaw
        Participant

          For streaming level areas, some areas are activated/deactivated according player position but I figure out after this bug that it’s not a good idea because of BlackBoard deserialization which take a lot of GC alloc/CPU time. I have the same issue on SubGraph initalization, do you plan to add an option to “pre-initialize” sub graphs ?
          Thanks.

          #17381
          Gavalakis
          Keymaster

            Hey,

            “Pre-Initializing” sub-graphs, is indeed something I plan to add. It will probably be an option possible to “tick”, in the GraphOwner inspector 🙂
            Let me know what you think.
            Thanks!

            #17380
            psykaw
            Participant

              I did it with a option in SubTree node (see attachment).

              It seems to work well and its a few lines of code:
              Add this in SubTree:
              [SerializeField]private bool _initOnGraphStart = true;

              And this in OnNodeInspectorGUI method:
              _initOnGraphStart = EditorGUILayout.Toggle("Init On Start", _initOnGraphStart);

              #17379
              Gavalakis
              Keymaster

                Hey,

                I see you opted to have the option per-tree, rather than per BehaviourTreeOwner.
                That’s a nice approach as well. Do you think that this would be a better option to have it per-tree, rather than a “global” option in the BehaviourTreeOwner itself (thus the root graph) ?

                Let me know what you think 🙂
                Thanks.

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