BonsaiBehaviourTree
BonsaiBehaviourTree copied to clipboard
The editor looks good, but it works in a wrong way.
At least Conditional Abort and Timer are bad which are essential in behaviour tree development.
Hey. Feel free to list feedback and potential improvements. I would appreciate it.
I think this is a problem that previus author talked about.
If we arrange conditions like that:
We expect it will execute task Print when all conditions are true (as we can see there are all conditions are the same).
If we format it like that, it will work just fine:
So, there are a problem in iterator, that will return failure if condition does not have any leafs. This is strange to me, I thought that BT work great as on first picture.
Now I thinking about why is this work that way? If this is an error I need to fix that for me, or is it intentional, and i'am just bad at BT :)
After podering some time, I fixed that by testing conditionalResult in ConditionalAbort if there no children nodes like that:
_conditionalResult must be initialized by called Condition(); in OnStart and Evaluate methods.
Idk this is intentional behaviour, or error. But I feel this is more appropriate working than before.
Hello @WeslomPo If you have a fix, could you create a PR? I would be happy to merge it. I really appreciate it!
To give a bit more context, yes, conditional aborts returned failure if they did not have any children.
It would make more sense if they could work "childless" and just return their evaluated condition result.