Why use behaviour trees for AI?

I’ve been trying to make AI and i tried doing them both with a behavior tree and blueprints, and i find blueprints way easier and better for me. So my question is why use a behavior tree at all? Is there some performance related reason? Or do people just prefer the workflow?

Behavior trees are optimized for multiple ai it is just faster.
Also when you are making simple AI it is easier in blueprints, but with AI that has more complex behavior or you want some randomness, behavior trees are actually easier.

Hmm I would say it’s personal preference. I am creating a quite complex AI right now in blueprint only (including randomness) and it works perfectly fine for me, actually for me it’s much easier because I have better control over how things work.
I find Behavior Trees just an overly complicated workflow to be honest, for me blueprints are much more direct and efficient. But I guess for some people BehaviorTrees will be better.

I haven’t seen any performance impact really, it seems to be just as fast as Behavior Tree AI, although it could be in an intense testing. But I think it depends on how well you create your blueprints.

I did some testing. On basic AI that walked to randomly chosen destination, then to next and so on.
With blueprint AI (if i remember correctly) i could do 40-50 of those walking randomly.
Then using blackboard i could almost double it.
And up to 200-300 when i did blackboard without collision.

I also remember there was some hard coded limit (64 i think) of how many AIs could be run.

But all that was around 4.10 so few years ago.

I suggest you make very simple AI (like my walker ai) and test it yourself with new engine.

Wow. This interests me as I’ve been trying to create walking NPC’s for the last week but am struggling with FPS. I created a system where the NPC’s will choose the nearest spline path and follow it. Using BP scripting I was only getting 30fps with only about 5 NPCs (but this is in an open world map with buildings, roads and everything, not an empty scene), I switched the system to using the Behavior Tree and am now only getting 7fps. I don’t understand why the FPS is so low. Do you have any tips about behavior trees that I may be missing? Any settings in the Project or Editor settings I should know about maybe?

This stuff was probably changed/polished in thosae 5 years since i did anything with them.

One tip that sometimes makes life miserable is wrong setup for navmesh. So press “N” and if floor is not green your navmesh does not work, thus AI does not move.

Maybe try using a navmesh invoker? that is specifically built to have AI perform better in open world settings

Yeah that is what I’m using. I’ve just built a new PC. My other one was 10 years old so hopefully that will fix the FPS.