Bot AI: Blueprints or Behaviour Tree or PawnSensing Component or AI Perception?

Hi,

This is more of a general / best practices question:

What should I use to implement Bot AI? There seems to be a lot of different options and combinations between: Blueprints, or Behaviour Tree, or PawnSensing Component, or AI Perception, Blackboards, Structs, etc.

I am confused. I watched and read various tutorials, many implement the same standard behaviour, patrol, follow character, walk randomly, etc, in a lot of different ways between all the previously mentioned tools.

I’m not sure where to starts, is there a preferred, or recommended way to do Bot behaviour or is it just for grabs however works for you?

In general yeah, pick what suits you best. But regarding character-based bots I recommend using Behavior Trees with Blackboards and AI Perception component. The only problem here is that AIPerceptionComponent lacks docs/tutorials and a final polish, but it’s the way to go in the long term - PawnSensing is a legacy solution and it’s not being developed anymore.

Cheers,

–mieszko

I’m no pro, but I personally prefer just doing everything inside the blueprint editor rather than opening and closing multiple windows for behaviour trees. The main advantage is clarity and easier debugging. There does’t seem to be too much CPU overhead when you time the events and set up the branches/gates correctly (I can have 100+ NPCs running around and performing tasks in a large forest&fortress map with 80fps) so I think I’ll stick to this method.

Hi Mieszko, I have a query related to the question asked here. I see the tooltip that the pawn sensing component does not work on network clients. Does this mean that it will not work on multiplayer? And if so, does the A.I. perception component have any similar limitations?

There are no network limitations to AI perception system that I know of, and if there are then that’s a bug.

Thanks, then I’ll probably shift to AI perception soon.

I have tryed it both ways and recently after learning blackboards and setting up AI perception in the behavior tree I found a serious issue. You can not set units as enemies to your AI within Blueprints so you must have a very descent idea of how to use C++. Your AI will see everything as neutral so if you set his perception to detect neutral he will detect every single object in your world. I have spent hours trying to figure out how to set the team id to make enemies for my AI so he stops detecting every single object and have gotten nowhere. I have no clue how to use C++ so I have been stuck on this issue for over a week now. Do not use behavior tree till this issue is fixed. I find it insane there is no way to set teams through blueprint by now!