You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this is a dead library, so I'm writing this more for other devs who might stumble on this issue, but I'd be thrilled if it was to get fixed. I'm using the 1.8.2 version of gdx-ai (latest version as of now).
I've found the problem in the library... and while there's a simple obvious fix to solve for my configuration, I'm unsure if it'd break other configurations.
My issue presents as my tree running once and then freezing up.... subsequent Tree.step() calls appear to do nothing.
I'm setting my trees up using parser with the external .btree file. My Behavior tree appears like so: (I'm not including paths or detailed descriptions of my leafs as that's unimportant):
(I'll include this as a screenshot so indents show up)
It appears that when the parallel task has its first success, it resets all its children. (com/badlogic/gdx/ai/btree/branch/Parallel.java line 223). However, when the inner sequence is reset though, it removes all children (com/badlogic/gdx/ai/btree/BranchTask.java, line 76). Children never get re-added.
In the debugger pics below, you can see that on the first pass, the sequence contains the two leafs. In the 2nd pic, you can see the sequence about to clear its children. In the 3rd pic, you can see that on the 2nd run, that task has no children.
So to summarize, in my app after the parallel task succeeds, the inner sequence's children (getTarget & rotateToTarget) are removed, and thus my inner sequence has no children, and thus tree.step() does nothing. As a workaround, I'm going to suggest that sequences (and probably other task that subclasses off BranchTask) never live nested directly under a parallel task.
The text was updated successfully, but these errors were encountered:
I believe this is a dead library, so I'm writing this more for other devs who might stumble on this issue, but I'd be thrilled if it was to get fixed. I'm using the 1.8.2 version of gdx-ai (latest version as of now).
I've found the problem in the library... and while there's a simple obvious fix to solve for my configuration, I'm unsure if it'd break other configurations.
My issue presents as my tree running once and then freezing up.... subsequent Tree.step() calls appear to do nothing.
I'm setting my trees up using parser with the external .btree file. My Behavior tree appears like so: (I'm not including paths or detailed descriptions of my leafs as that's unimportant):
root
sequence
parallel policy:"Sequence" orchestrator:"Join"
cooldown
sequence
getTarget Range:10
rotateToTarget Range:10 RotateSpeed:360
turretShootLeaf
(I'll include this as a screenshot so indents show up)
It appears that when the parallel task has its first success, it resets all its children. (com/badlogic/gdx/ai/btree/branch/Parallel.java line 223). However, when the inner sequence is reset though, it removes all children (com/badlogic/gdx/ai/btree/BranchTask.java, line 76). Children never get re-added.
In the debugger pics below, you can see that on the first pass, the sequence contains the two leafs. In the 2nd pic, you can see the sequence about to clear its children. In the 3rd pic, you can see that on the 2nd run, that task has no children.
So to summarize, in my app after the parallel task succeeds, the inner sequence's children (getTarget & rotateToTarget) are removed, and thus my inner sequence has no children, and thus tree.step() does nothing. As a workaround, I'm going to suggest that sequences (and probably other task that subclasses off BranchTask) never live nested directly under a parallel task.
The text was updated successfully, but these errors were encountered: