Fix execution order of Parallel Tasks

abc123

Member
As shown in this thread, parallel branches run their children in the "wrong" order, contrary to the rest of the tree. It happens on the 2nd run and remains like that. This is done intentionally:

The parallel branch works by adding a new element to the list of branches to run. On subsequent runs this branch is executed from the last element to the first element. This is done so you can have later branches interrupt earlier branches.

In the past I have thought about changing this so it executes in the left to right order but have decided against it to keep the tree execution consistent across updates.

Hm.. I'd rather give interruption priority to the early branches. It seems more logical and follows the general rule, from left to right. I find reversed order of parallels quite questionable and misleading solution. Even the icon suggests the direction, may be it should look like this?

22.PNG

It turns out that If you want uniform order in your tree, you need to place all tasks under the parallel branches in reverse. Or you can write custom classes for every parallel task. And still, on the first iteration, the order will be reversed. To be honest, none of these solutions I like.

@Justin, maybe you could implement this mechanics natively? Add a checkbox to the tree settings, in which direction to run parallel branches. Make it unchecked by default, nothing will conflict with earlier versions. It seems easier for you to inverse execution list in the source, than for us to copy-code each parallel class and hack currentChildIndex..

And please, for mercy's sake, make it consistent between the frames.
 
Last edited:
I have marked this one down. I'm half debating if I should just make the switch completely since it makes sense for the parallel tasks to evaluate from left to right.
 
I have marked this one down. I'm half debating if I should just make the switch completely since it makes sense for the parallel tasks to evaluate from left to right.
I'm glad you considering this, it really makes sense. If/when you have a prototype ready before the next release, I would be happy to get the dlls.
 
Top