Unable to get Wander node (A*) to conditional abort for a higher priority node

clive

New member
How do you abort Wander? it completely ignores conditional aborts (low priority)
I have this very simple behaviour, if I swap out Wander with Seek (like the video example) it works perfectly. But Wander never aborts

1643920928385.png

It appears that while Wander is executing, the higher priority Sequence (and thus the "within distance") are never re-evaluated. Once Wander starts that's all that ever runs.

Any advice on how to get Wander to obey the conditional abort rules greatly appreciated.

Thanks.
 
Is your behavior tree active? And Within Distance returns success? Your setup looks correct - here's a repro scene which has a similar functionality.
 

Attachments

  • abort.unitypackage
    5.3 KB · Views: 2
Is your behavior tree active? And Within Distance returns success? Your setup looks correct - here's a repro scene which has a similar functionality.
Hi Justin,

Within Distance is never run the moment Wander is anywhere in the behavior. If Wander is replaced with "Seek" then "Within Distance" executes and shows true. If "Wander" is there, instead of "Seek", "Within Distance" is never true or false -- "Within Distance" is never executed at all. If my example, as provided, is used with "Seek" it works 100% but the moment I put "Wander" in, it stays inside "Wander" nothing else is ever executed or checked so the abort cannot happen because "Wander" doesn't appear to ever even return.

The provided unity package's "scene" scene does not have any objects with behaviors attached to them.
1643966316333.png
I would have guessed that the Cylinder should have had? -- but not.

Thanks,
Clive
 
Here's possibly a better example of what I'm trying to say specifically about the Wander node in AStar (not sure about the normal/navmesh one):
1643974389776.png
... Even if I, at runtime, disable the entire sequence tree in which Wander exists, it never exits, 5-10 minutes later it's still inside Wander having never returned or exited that node.
 
So you disabled an active branch? Disabling an active branch is going to lead to unexpected behavior such as this. Your Within Distance task is reevaluating so as soon as that returns true it will abort wander, assuming the branch is enabled.
 
So you disabled an active branch? Disabling an active branch is going to lead to unexpected behavior such as this. Your Within Distance task is reevaluating so as soon as that returns true it will abort wander, assuming the branch is enabled.
no i was just trying to give ANOTHER example. Within Distance is NEVER re-evaluated regardless of me turning off the other branch or not
 
I'm not sure how to breach the gap in understanding of what I'm trying to communicate. The `Wander` node is broken and never returns and nothing is ever re-evaluated outside of it and no other conditional aborts ever occur. If I swap out the `Wander` node for a different node, then behavior designer behaves as expected, but when the `Wander` node is in play conditional aborts do not function. Same graph, one node difference, completely different resultant behaviours.
 
Last edited:
The conditional abort isn't aware of wander. To it there's not a difference between any other action task. I'm not sure why the previous package didn't load for you but here's another version that was exported with Unity 2021.1.

Based on your description my guess is that Within Distance is reevaluating, but it is never returning true. That's why it never aborts. This is also confirmed by the node - on the bottom right there is a reevaluation icon. It does return true when you use the seek task because it gets within distance. You can verify this by setting a breakpoint within WithinDistance.OnUpdate and see that it is being executed when Wander is active.
 

Attachments

  • abort.unitypackage
    6.3 KB · Views: 1
Top