Behavior Tree Subtrees always fail

When using the ‘Run Behavior’ or ‘Run Dynamic Behavior’ in the behavior tree system, I find that these nodes continually fail without ever entering them. It’s completely mystifying. It doesn’t matter which I use, the tree execution just rolls over it again and again. In the images attached, the main tree should be executing the branch shown and running the HarvestResources subtree. You can see in the subtree nothing out of the ordinary – in fact, if I have my AIC use that BT directly it works great. But when trying to run it as a leaf task from the main tree, it never works. What gives?

The BTs you’re showing use different BB assets - are those related? I mean, is BB_Leader_Harvesting an extension of BB_Leader_Base? I’m afraid we don’t support using multiple different BB assets by a single BT agent. I know we probably shouldn’t allow you to plug those in in the first place. I’ll take a note of this :wink:

Cheers,

–mieszko

1 Like

Yes, that was the answer. The subtree was using a BB asset that had the master BT’s BB as its parent, but was not the actual same BB asset. I had assumed that if one BB is parented to another, it could be used as a subtree, but as you state: that is not the case. Reworking the subtree to use the exact same BB allowed it to run.

But what is the point of having subtrees if you have to use same BB asset? Let’s assume I have a Bot - it implements base of moving around, avoiding dangers etc. And then I want to have specialized Bots - so for every specialized bot I need to increase a BB asset for the basic bot? So basically each time I create new specialized bot I risk breaking exisiting bots? Am I missing something here or is it implemented like this for some reason like lack of time or resources?

BBs can be inherited. Maybe you can use a base BB in for your Default Bots and a derived one for the specialized bots. Never tried it though :slight_smile: