As my behavior trees become more and more complicated, I am considering using RunBehaviorTree Task with nested subtrees. I am thinking it of some kind of Combination of trees. Let’s say I have a BT called BT_Combat, where combat decisions are, and another BT called BT_Patrol, where patrol decisions are. Now, since BT_Combat only needs to know combat-related BB values, a BB called BB_Combat is assoaicted with BT_Combat, and the same for BT_Patrol. However, I cannot create a BT called BT_Gubelin to combine the two BTs because of the blackboard compatibility problem. The only solution is to use the same BB for BT_Patrol, BT_Combat and BT_Gubelin.
In this case, using nested subtrees BT_Patrol, BT_Combat and BT_Gubelin is IDENTICAL to using only one large tree, except it’s more organized. I cannot reuse the BT_Patrol subtree for those enemies with different combat logics or reuse the BT_Combat for those enemies who don’t patrol.
So, my project now remains supre large BTs within which share a lot of identical logics and supre large BBs within which share a lot of same variables. It’s terrible to maintain them.
Any advice on it? Or should I turn to State Tree? I am not familiar with the State Tree and thus I don’t know if it can bring any help to this problem.