Hey everyone! I’m currently working on the architecture of enemy AI in my Unreal Engine project, and I’d appreciate some advice regarding how best to organize the system.
To clarify, I’m not struggling with how to implement individual features—my main concern is the high number of possible combinations creating a messy explosion of Blueprints, AIControllers, and Behavior Trees.
Here’s the scenario:
Enemies have two main behavior categories:
1. Origin (defines enemy initial and general behavior)
-
Spawner: Patrol, aggro/reset logic
-
Totem: Spawn/despawn based on player actions
-
Triggered: Idle until activated by an external event
-
Chaser: Initially pursues a specific NPC, switches to player if attacked
-
Neutral: Idle until attacked by player
2. Combat (defines enemy attack behavior)
-
Melee: Circles around the player (strafing) and attacks up-close
-
Ranged: Keeps distance, finds strategic positions, and shoots at the player
Additionally, certain weapons grant special skills (like blocking & counter-attacking for shielded enemies, or melee strikes and evasions for ranged enemies carrying rifles). These skills slightly modify behavior but don’t fundamentally change the melee/ranged behavior trees.
AI perception is handled by AIPerception component, and I want it to be cleanly integrated into whatever architecture I use.
My question is: how would you structure such a system in Unreal to minimize Blueprint, Behavior Tree, and AIController explosion?
-
Would you suggest a single flexible AIController or multiple specialized controllers?
-
Should I rely more on components, enums, or behavior tree subtrees to keep things modular?
-
How would you approach integrating small behavior differences (like weapon-based special skills) without creating dozens of slight variations of Behavior Trees?
Thanks a lot—I’d love to hear how you’ve handled similar challenges!