Unexpected Conditional Abort Behavior

CosmicArbiter

New member
I have the following tree, In which "In Attack Range" and "Can See" are both conditionals that reevaluate. The problem is, even after "In Attack Range" returns a failure, Can See is still be reevaluated, and if it ever returns true, it basically skips in attack range, and starts attacking.

I have tried turning the sequence in the screenshot to lower priority, but that obviously means Idle can not be interrupted by The two conditionals. I also tried paring that putting the two conditionals under a new Sequence, and giving that a Lower prio abort as well, but it just results in the same behavior as the original.

How am I meant to make it so Can See is only evaluated if we are In attack range.
1757188865863.png1757188924520.png
 
To follow up on this, and to add some context, this is the entire combat section of the behavior tree. Similar to the above issue, Conditionals like In Attack Range are being trigged even with In Combat being false.
My assumption is that the "Self" abort type makes All below conditionals reeval, even if conditionals before them return false. Which to me, seems like highly undesired behavior, as I can see very little situations in which you would want that to happen.
1757275160012.png
 
Conditional aborts are great for a wide variety of situations but sometimes you need more control and for that you can use the Perform Interruption task to interrupt a branch at a specific time. With that said, you could try something like:

------Sequence (Both)
InAttackRange----Sequence (Lower Priority)
-------------------CanSee----StopMovement---StartAttacking
 
Conditional aborts are great for a wide variety of situations but sometimes you need more control and for that you can use the Perform Interruption task to interrupt a branch at a specific time. With that said, you could try something like:

------Sequence (Both)
InAttackRange----Sequence (Lower Priority)
-------------------CanSee----StopMovement---StartAttacking
That doesnt work unfortunately. Im a bit confused by the logic of conditional aborts being reevaluated even when the tree should not be able to get to them.

What exactly makes a reevaluate flag true?

To me, it makes more sense that for a sequence, only the first conditional would be reevaluated, and only if that one is Success, would the second one be reevaluated.
 
The current flow exists because In Attack Range and Can See are treated independently for reevaluation. While in your situation it makes sense to have the two tasks linked together, that's not always the case. For example, if you had an action task in between In Attack Range and Can See then with the change your suggesting the action task would also have to be rerun because the In Attack Range status may change.

If the structure I suggested doesn't work you have a couple of options:

- Combine In Attack Range and Can See into a single task
- Use the Perform Interruption task and not use conditional aborts for this use case

It would be nice to provide an ECS task similar to the Stacked Conditional task which would be similar to the first option, but that's not trivial to do with ECS.
 
The current flow exists because In Attack Range and Can See are treated independently for reevaluation. While in your situation it makes sense to have the two tasks linked together, that's not always the case. For example, if you had an action task in between In Attack Range and Can See then with the change your suggesting the action task would also have to be rerun because the In Attack Range status may change.

If the structure I suggested doesn't work you have a couple of options:

- Combine In Attack Range and Can See into a single task
- Use the Perform Interruption task and not use conditional aborts for this use case

It would be nice to provide an ECS task similar to the Stacked Conditional task which would be similar to the first option, but that's not trivial to do with ECS.
I combined the tasks, which works for my current use case.
Definitely would be nice to have some way to combine them automatically, but I do understand the ECS difficulties of that.
 
Back
Top