Conditional abort lower priority condition single pass request

thtronnn

New member
I think it would be useful to have an option either in the full tree behavior or just in the individual composite nodes to only run through the condition triggering the conditional abort once when the abort is successful during a lower priority abort. The current way that it operates is that it runs through the condition once when triggering the abort, and then a second time when traversing the path of the overriding composite node.

The example I was encountering that made me think of this is that I was using a custom cooldown timer condition and random probability condition (among other conditions) to occasionally trigger a blocking behavior when an attack was incoming. What would happen though is that the stacked conditional node containing the individual conditions was being called once for the abort and once for the actual run of the sequence that was overriding the lower priority sequence.

The result of this was that the timer would reset on the initial conditional abort success and then fail on the second run through. A similar effect was occurring with the random probability not succeeding on the second run-through.

I have my own solution by setting the conditions upon the initial success to simply override as true and then reset to the standard behavior with an event as the final action in the sequence. It just seems like an overly convoluted procedure and that having the condition evaluated only once would be a more streamlined approach that would prevent others from encountering the potential confusion and workarounds I encountered. I am not entirely sure if there is a reason that the conditions are being evaluated twice, although there could be an obvious answer to that which I am just blind to.

Included is a screenshot of my solution to hopefully help demonstrate the issue.

Also on a different note the Stacked Conditional node should be mentioned in the Conditional Aborts documentation page. It took me more time than was necessary to realize that I had to use a stacked conditional node. I wasted time testing several configurations of conditions until I realized that only the first condition would be called under any circumstance, which eventually led me to stumbling upon the stacked conditional node as the real solution.

I hope you consider these suggestions. I've found conditional aborts to be one of the trickier behaviors to properly implement, and I believe that there is room for improvement.

Thanks.
 

Attachments

  • Screenshot 2024-05-01 at 1.04.49 PM.png
    Screenshot 2024-05-01 at 1.04.49 PM.png
    212.8 KB · Views: 0
The proper way to fix this would be to add a OnConditionalUpdate method and have conditional aborts call that method instead of OnUpdate. This however would break a lot of existing projects so at this point I don't plan on changing it in version 1. In version 2 there is a separate method that is called specifically for conditional aborts so you know exactly when it is called.
 
Top