Time to join the conversation, I guess (people who know me probably were waiting for this to happen ).
First of all, let me tell you that it is a good thing that there are multiple solutions available in the community to solve the problem of task planning.
If SMACC can offer that, it is great. Letâs also remember RAFCON, for the sake of completeness.
Secondary, I donât have any particular interest in saying that Behavior Trees are great. Actually, I have the feeling that they are different from Hierarchical State Machines, but not necessary better.
I have no agenda and even if I spent 1 year in my career developing trying to implement the absolute best implementation of BT, BehaviorTree.CPP, but I will be happy to throw it in the garbage as soon as I find a better solution.
Said that, I must reply to the comments about the SMACC vs BT comparison mentioned earlier and the comments from @brettpac.
I am trying to be as fair as I can and not âpartisanâ in any way
Orthogonality/Concurrency
It is not true that BT canât provide it, in fact, the number one priority of BT.CPP was to find a valid model of Reactive Behaviors, using ReactiveSequence, ParallelNode, etc.
We may argue which approach is better or more intuitive, but eventually the user is the ultimate judge.
I donât have a strong opinion myself and maybe SMACC can do that better, who knows ?
Poor scalability, no real-time, many threads etc.
Again, mostly false or implementation dependent. BT.CPP discourage those Actions that spawns their own thread, even if that is possible.
On the other hand, I admit that the event-based approach is better than the âpollingâ (AKA âcheck conditions in a loopâ) approach.
But there is no reason why that canât be implemented in BT too (who knows, maybe in the future).
Readability
Some things are more readable in Behavior Trees, others are in State Machines.
The argument and example of âbake a cakeâ, provided in the page, is unfair and misleading, to say the least.
BT force you to think about what happen if an action fails. If you add that to State Machines too (you should) your SM will be equally or more complex that a BT.
âStates really do existâ
Here I agree with the author. I realized that this is something where BT struggle.
No problem admitting that it is the biggest weakness of BT.
âOnly for gamesâ and ânot used on real robotsâ
Donât tell my boss, because we use them on our 1 tonne robot.
SummarizingâŚ
Everybody is entitled to have his/her own opinion ÂŻ_(ă)_/ÂŻ,
My opinion is: use the paradigm and the implementation that makes you more productive.