ElapsedTime in nested Behavior Trees is not correct.

NodeCanvas Forums Support ElapsedTime in nested Behavior Trees is not correct.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15926
    son
    Participant

    It seems there is a bug with elapsedTime in nested Behavior Trees if the Behavior Tree has an updateInterval set.

    This way only the last frame deltaTime will be passed to nested BT when it should pass the accumulated time since the last update.

    This makes the Wait Action to run slower in the nested BT then it runs in parent BT which is not correct.

    said Daniel in Discord.

    In addition, the cooldown decorator also doesn’t work in a subtree for this reason you said.

    It seems that the parent graph is repeatedly entering/exiting the subgraph and as a result the subgraph is reset (along with its nodes) each time it re-starts. I could probably make the Cooldown node independent of that and dependant on Time alone.

    Is this feature under development?

    I attached png ‘edit01’ for the elapsedTime issue and ‘edit02’ for the cooldown issue. I’m not sure whether this is the right way.

    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #15938
    Gavalakis
    Keymaster

    Hello and sorry for the late reply.

    To be totally honest I was almost about to remove the “update interval” option that Behaviour Trees have a couple of versions back. No other type of graph in NodeCanvas has such an update interval and because of that (as you can see) it creates more problems than benefits (I think). Is keeping the “update interval” option critical for you and would it be a problem if it was actually removed?

    Please let me know your thoughts.
    Thank you!

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

    #15982
    son
    Participant

    Is keeping the “update interval” option critical for you and would it be a problem if it was actually removed?

    Not critical for me. I can handle this by myself. Thanks for asking.

    #18081
    danilo.delponte
    Participant

    Bumping this up as I just faced this same exact problem with the Cooldown filter.

    I had a big behaviour tree that I just split in subtrees and then some of them didn’t work as intended as the cooldown is reset everytime the subtree stops. This behaviour makes this decorator unusable on subtrees as this will happen everytime a success is returned down the graph.

    Right now what I’m doing to workaround this is to create a custom decorator based on the filter and commenting out the currentTime reset in the OnGraphStoped() function.

    Attached is a screenshot of the the working code for this particular scenario.

    Please let me know if I’m missing something here or if there are major concerns with this approach.

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