[V 1.7] Conditional aborts not working

AlexIsCoolYo

New member
Hello,

I've upgraded to the new 1.7 version & my BT appears to have broken.

When I connect the Selector to Idle, as seen in the image, the Sequence never re-evaluates, but when I disconnect IDLE it works fine.

Unity version: 2020.3.21f1
BD Version: 1.7

8ac61d2839ff37e0430b3fd626759884.png
 
I would first update to the most recent version. With that said, the logic for conditional aborts hasn't changed in awhile.

I am not able to reproduce this - I have unit tests that cover about 35 different conditional abort scenarios and they all pass. I recommend making a small repro scene just to see if you can isolate the cause.
 
I would first update to the most recent version. With that said, the logic for conditional aborts hasn't changed in awhile.

I am not able to reproduce this - I have unit tests that cover about 35 different conditional abort scenarios and they all pass. I recommend making a small repro scene just to see if you can isolate the cause.
On the latest version.

Did some testing, appears to only happen with the built-in IDLE task or other tasks that return running. Am I just being an idiot? :p
 
The attached scene uses an idle task and reevaluates correctly. Can you import this scene into a new project and try to reproduce the abort not reevaluating?
 

Attachments

  • Scene.unity
    9.6 KB · Views: 4
The attached scene uses an idle task and reevaluates correctly. Can you import this scene into a new project and try to reproduce the abort not reevaluating?
This seems to work fine, guess it's my BT.

This is the tree I have, the 'Can Use Special Attack' is a conditional & it's only checked 1 time. BT is set to restart on complete.

When I remove the Wander, everything works just fine.

58921e3608c0dd776bcbef28c7142c5a.png
 
I can't say without watching it but if you enable logging on the behavior tree component it should indicate what the problem is. My guess is that one of your tasks is returning a different status than what you're expecting.
 
I can't say without watching it but if you enable logging on the behavior tree component it should indicate what the problem is. My guess is that one of your tasks is returning a different status than what you're expecting.
Ok, so I enabled logging & when I Remove Wander from the Selector at the top, everything works 100% as intended with no issues. When I add Wander back, as seen in the image, the Sequence is no longer evaluated and my logging just stops with "Push Task Wander" and nothing else gets logged and it just stays on Wander forever.

The Wander action is the built-in one from the A* Pathfinding integration. This issue also happens if I replace Wander with Idle.

I can send a video if it helps. I can't seem to see the issue myself.


Any help is much appreciated!
 
That sounds correct. To approach it another way, are you able to modify the tree that I uploaded in order to stop it from working?
 
That sounds correct. To approach it another way, are you able to modify the tree that I uploaded in order to stop it from working?
Did some playing around, seems I have been able to stop the one you sent me from working.

UnityVersion: 2020.3.13f1
BD Version: 1.7

Setup
- Attach BehaviorManager to the camera and set it to Specify Seconds, 0.5 & No Duplicates
- See Image for Tree Setup - Repeat forever

How to
- Set Bool A & B to return False
- Enter play mode, wait a moment for it to tick and should be in the Idle state
- Set Bool A to return True
- Wait a moment for it to tick
- Set Bool B to return True & wait a moment
- It should now be stuck on the top-right Idle & not re-evaluating bool B

Fix
If you then Set A to false, wait, & then back to True, it re-evaluates correctly & you should now be in the Idle next to B.

b641341340d23efec6d026bfdf512d61.png
 
I think that I understand more what you are seeing.

In your screenshot Bool Comparison A is being reevaluated. When you immediately flip the bool on the A comparison task it aborts the top right idle task and moves into the bottom subbranch where you have the B comparison. Because the A comparison returned success the conditional abort will only trigger again when A returns failure. However, if A returns failure then the top Sequence task won't run the children because of that failure. As a result you should have the A comparison task flip back to failure after it has left the top Sequence branch.

The trick to remember with conditional aborts is that they only abort the task when the status changes. If the status doesn't change (as is the case with the A comparison) then the abort won't trigger. In cases like this where you want more immediate control over aborts you can use the Interrupt/Perform Interruption tasks.
 
I think that I understand more what you are seeing.

In your screenshot Bool Comparison A is being reevaluated. When you immediately flip the bool on the A comparison task it aborts the top right idle task and moves into the bottom subbranch where you have the B comparison. Because the A comparison returned success the conditional abort will only trigger again when A returns failure. However, if A returns failure then the top Sequence task won't run the children because of that failure. As a result you should have the A comparison task flip back to failure after it has left the top Sequence branch.

The trick to remember with conditional aborts is that they only abort the task when the status changes. If the status doesn't change (as is the case with the A comparison) then the abort won't trigger. In cases like this where you want more immediate control over aborts you can use the Interrupt/Perform Interruption tasks.
Aha, I see. Sorry for the false-positive

Thanks for the help!
 
Top