Behaviour Trees or C++

Hi there fellow devs! I have been looking into NPCs, in particular, driving NPC behaviour with 1) normal Blueprint with variables for state on the character or in the AIController and then using OnTick, 2) Behaviour Trees, and 3) C++ (also using OnTick and state variables but just in C++). My conclusion is that C++ is the best for this; it is most expressive, easiest to change and easiest to follow. I find Blueprint unwieldy for complex A.I. But I am a C++ programmer so perhaps I am just biased? So my question is; does Behaviour Trees offer something to implementing A.I. that I am missing, is it recommended to implement A.I. with them, or are they simply as I expect, bringing state machine functionality to Blueprint for non-C+±developers, and for a developer they offer nothing that the C++ guy can not do easier and quicker in code?

So basically, I am trying to learn if Bahaviour Trees are innately better suited to A.I. and preferred, than just pure C++.

Thanks!

1 Like

i wish unreal engine could support c#

Behaviour Trees offer for sure an easier interface to program complex AI behaviours, which can be used and understood also by non-programmers in your team. As far my experience in Unreal goes, you program in C++ Behaviour Trees Nodes (Tasks, Decorators, etc… ), but the tree itself, you build it with the editor. As a result, you will have the fully expressiveness of C++ for a granular control of the single “actions and checks” that the AI performs, but the big picture is handled by the Behaviour Tree.

Hope this help clarifying your doubts, if you have other questions, don’t hesitate to ask.

Keep in mind that in the end, you need to find the way that works for you and your team, Unreal just offers different tools to achieve same results, and sometimes it’s just matter of preference.