OnStart called again after conditional abort

Necronomison

New member
Hi there,
I'm seeing a really weird behavior where OnStart (followed by OnEnd) seems to be called again on a task currently running right after a conditional abort higher up aborts the entire branch. Please see the image for reference. This image is taken on the frame that BehaviorDesigner pauses the editor due to the break point set on the JackalShuffle task in the BehaviorDesigner editor window.

Order of observations:
1. "Jackal Shuffle" task is running, (OnUpdate returning TaskStatus.Running every frame)
2. The conditional task "IsBasicCoolingDown" re-evaluates to false, and due to the conditional abort settings, breaks the flow of the entire branch underneath the "Parallel" task. The following set of breakpoints then get hit in this order:
- OnEnd() of the "JackalShuffle" task
- OnStart() of the "JackalShuffle" task (This is the OnStart() method call that I don't understand why its getting hit again)
- OnEnd() of the "JackalShuffle" task again.
- OnStart() of the "BasicProjectileAttack" task

As you can see from that list of breakpoints, I don't understand why the 2nd and third break points are happening. I expect that after the conditional abort, I should see OnEnd() of the "JackalShuffle" task immediately followed by the OnStart() of the "BasicProjectileAttack" task.

Any ideas? :(
 

Attachments

  • AbortBug.PNG
    AbortBug.PNG
    102 KB · Views: 7
Conditional aborts on parallel tasks will lead to undefined behavior. Parallel tasks already reevalute the children beneath it so they should not need a conditional abort. If you remove that conditional abort do things line up better?
 
Right I see. That actually makes sense now that I think about it.

Perhaps what's happening is that when the conditional under the parallel task changes and causes an abort, the parallel task re-evaluates its children, and in that one frame start() gets called on the JackalShuffle task.

I assume this is the case since when I re-structure the tree to get rid of the parallel and use a sequence instead (where the condition comes first, then the Jackal task) I no longer see the problem.

I'll try removing the conditional abort too, and see if that resolves it.

Thanks for the prompt reply Justin! You're always on top of it :)
 
Top