Download

Blueprint Ai or Behavior Trees?

I have just started in UE4 and i am really enjoying it. WHile watching Youtube videos and such on AI, my favorite so far has been VirtusEdu, but he does Ai in the actual blueprints via Move-to nodes and other things, but i was wondering if AI is best handled with Behavior trees. I have never worked with them and continuing to use just nodes in the blueprints is going to get clustered fast.

Use behavior trees. You can do most stuff in BP, but it’ll be simpler in behavior tree.

However, you do NEED to use BP to get variables and things like that, then call them from the AI. I still haven’t figured out how to cast in a behavior tree.

Depends on what you are doing, but generally Trees are the way to go.

If you’re building something like a person, a Tree better handles complexity.

If it’s an ant or something simple that doesn’t have alot of different states then just a BP will work fine.

For casting look into EQS and EQS Service. Looking at a lot of tutorials on Unreal now and that seems to be the way most location finds are done.

1 Like

Depends, you can create an interface for querying variables in bp from bt task.
Bt service can also handle some stuff like detecting enemies and setting bt keys to drive the tree without doing it in pawn bp.

I usually put one off events, like AIPerception On Target Perception Update in the AI BP, like player seen/unseen and repeating logic in the BT, like player location. The BT acts somewhat like a tick during runtime.

Use custom Services for updating player location when active.