GlobalBlackboard error

NodeCanvas Forums Support GlobalBlackboard error

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13201
    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.

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

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

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

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

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

    #13257
    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);

    Attachments:
    You must be logged in to view attached files.
    #13269
    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.

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

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