I gave up on behavior trees

I did want to also add, that I think the most frustrating part of the BehaviorTree, is that keeping the Blackboard in sync with everything else is a bit on the difficult side – there’s not an obvious pattern for it. What I currently do is implement a Blueprint Interface that exposes a function to call for notifying the Controller of what is happening – let’s say the AI decides to use it’s one Special Move. I create a BPInterface that has a “DoSpecialMove” function (and maybe a “AbortSpecialMove”). The Controller and the Character then both implement that interface. The BehaviorTreeTask calls the Controller’s DoSpecialMove, the Controller calls the Character’s DoSpecialMove.

So, basically, the way I’m doing things right now, the Blackboard is telling the Tree if it can perform any particular task. The Tree decides which task to perform. The Task tells the Controller that it is presently performing this Task, and the Controller tells the Character that it is presently performing this Task. Any special logic that needs to happen in regards to the Controller or the Pawn entering these tasks can be handled there.

And now that I’ve explained what I’m doing, I have a better understanding of what I’m doing as well :smiley:

1 Like