Conditional abort optimization

arenoo

Member
If I understand it correctly the conditional task under a conditional abort gets reevaluated multiple times per tick. Is it because the lower priority nodes are getting executed instantly in one tick (the "Instant" boolean is checked on the task) and therefore forcing the conditional abort to reevaluate? If yes then this does not make sense to me, cause if the node is set to be executed instantly, then it should not be expected to trigger the reevaluation, because it has already been evaluated this tick. Is there a way to disable this specific case (reevaluating multiple times in the same tick) ? Or maybe a workaround like checking in OnUpdate of the conditional if is in the same tick then return the cached result?
 
If I understand it correctly the conditional task under a conditional abort gets reevaluated multiple times per tick.
No, it only gets executed once when it's not active. If the abort triggers then it will be rerun when the task starts but that's a one time operation versus every frame. There isn't a way to avoid this unless you modify the source code since conditional aborts use the same OnUpdate callback. In version 2 there is now an update specifically for conditional aborts but I'm not going to change it for version 1 since it would change the functionality of a lot of projects.
 
Yeah sorry, you are right. For some reason aborts get triggered multiple times when I move around different windows in the editor (loses window focus?), thats why I was confused.
 
Back
Top