First of all, I’d like to compliment you on the quality of your product. It’s definitely done wonders in speeding up my workflow and I have found no meaningful problems with it, at least up until a little bug that I ran into tonight. (Or maybe I’m not understanding something correctly)
#Edit#
I’ve found that when you deactivate and re-activate a branch in a behavior tree through a nested dynamic composite, the branch doesn’t start executing again from the left most node (resetting the tree); Instead, it will resume the branch from the node that was last active before being interrupted. Below is a more detailed description.
In the use case below, I have a set of nested dynamic composites.
– At start, the first branch fails the condition and it continues to execute the second branch (Capture02.png)
– If I change the properties such that the first branch activates, it will run through as expected. (Capture03.png)
– Now, I readjust the properties so that the first branch deactivates and the second branch starts executing again. (Capture04.png)
– Finally, I once again adjust the properties to reactivate the first branch (Capture05.png). Here is where the strange behavior comes into play. It doesn’t start executing at the left most node again. It goes directly to the last active node (being the right most in this case). Messaging events aren’t sent and the break point is skipped.
I have used Behavior Designer in the past, based on my experiences with it (and other BT assets), I would expect the entire branch to be reset and be executed again… that said, I can think of a couple corner cases where it might be advantageous to go back to the last executed node. Is this expected behavior, or a bug?
I have found a work around. If I move everything following the condition under a new static sequence, it resets all children as expected and the full branch executes again.
Thanks a lot for your positive feedback as well as of course for the error report.
This is indeed an “unexpected behavior” and I was able to pinpoint the cause.
To fix this quickly, please open up Sequencer.cs and change the closure at line #43..
From this:
1
2
3
4
5
if(dynamic&&i<lastRunningNodeIndex){
outConnections[lastRunningNodeIndex].Reset();
}
To this:
1
2
3
4
5
6
7
if(dynamic&&i<lastRunningNodeIndex){
for(varj=i+1;j<=lastRunningNodeIndex;j++){
outConnections[j].Reset();
}
}
Please let me know if that works for you as expected and once again thank you for the clean report as well as your positive feedback!
If you encounter anything else, please let me know.