Helping understand dynamic behaviour

NodeCanvas Forums Support Helping understand dynamic behaviour

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13223
    denzil
    Participant

    (Cross-posting from Unity forums, only discovered this afterwards)

    Hi,

    I have recently bought Node Canvas and am very happy with it, but I do have a question regarding dynamic that I’m hoping you can help me with. Spent a few hours debugging this but I can’t figure it out.

    So this is a segment of my behaviour tree:

    Peek-2018-06-05-22-51

    Some background info on what I’m trying to achieve here. My start sequencer node is marked dynamic because I want it to be reactive on the first node / condition task. This condition checks my blackboard variable “TrackTarget” to check if its set (not null).

    Next, my selector node checks a bunch of conditions which informs my agent to actually track the target, if any of them are true. I have not marked this dynamic, because my desired behaviour here is that once this selector returns success, it will stay like that and not re-evaluate until the tracking task is done (replaced here by running forever). This is at least what I understood from the docs.

    However, this does not seem to work this way and this selector is always reactively processed. Even though my tracking task (or “running forever” node) is still running here, it is interrupted when all of the tasks under the selector returns false, completely ignoring the fact that the selector is not marked dynamic.

    If I set the start node to also not be dynamic, then everything works fine, except then it also does not react to changes on the very first condition task (the null check one).

    Am I misunderstanding something or is something else going on here?

    EDIT: I thought perhaps dynamic would treat all children under that node in the tree all the way down as dynamic as well. Is this the case? If so, there’s another oddity at play here, because this particular tree is a subtree which is under a dynamic node in the “parent” tree. Another thought, it is not something wrong in the parent tree causing this behaviour because this sub tree is the first (leftmost) node under a dynamic sequencer in the root / parent tree.

    Attachments:
    You must be logged in to view attached files.
    #13225
    timv
    Participant

    After control flow has reached the action node with ‘Run Forever’, the dynamic sequencer reevaluates every child node to the left of that node. (i.e. both the leftmost initial condition and the selector node are reevaluated)

    If you want the dynamic behavior only for the first condition you´ll have to place a regular sequencer under the dynamic sequencer. (See attachment)

    Attachments:
    You must be logged in to view attached files.
    #13227
    denzil
    Participant

    Oh that makes complete sense, thank you for the advice!

    #13246
    Gavalakis
    Keymaster

    @timv, thanks a lot for helping out! 🙂



    @denzil
    , if you have any further questions or need any further clarifications, please let me know!

    Thanks!

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

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