Common Patterns & Examples

Documentation Unreal Engine AI Patterns

Ready-to-use patterns for melee, defensive, and aggressive enemy types.


Pattern 1: Basic Melee Enemy

ActionSet:

  • 2-3 melee attacks at close range (100-300cm)
  • Quick retreat when too close (under 100cm)

Movement:

  • IdealMinDistance: 150
  • IdealMaxDistance: 250
  • Strafe enabled

Actions:

LightAttack:  100-250cm, 2s cooldown, weight 1.0
HeavyAttack:  150-300cm, 4s cooldown, weight 0.8, chains from LightAttack
QuickRetreat: 0-100cm,   3s cooldown, weight 1.5 (defensive)

Pattern 2: Defensive Enemy

ActionSet:

  • Defensive actions score higher
  • Longer cooldowns, stays at distance

Movement:

  • IdealMinDistance: 250
  • IdealMaxDistance: 400
  • Retreat bias: 0.7

Actions:

CounterAttack: 150-250cm, only when Player.Attacking tag (2x multiplier)
Block:         100-300cm, BehaviorTree sequence with shield raise
Retreat:       0-200cm,   high weight, moves away

Pattern 3: Aggressive Rusher

ActionSet:

  • Close-range focused
  • Short cooldowns

Movement:

  • IdealMinDistance: 50
  • IdealMaxDistance: 150
  • Strafe disabled, aggressive approach

Actions:

LungeAttack:   200-400cm, 1s cooldown, high weight (initiator)
RapidSlash:    50-150cm,  1.5s cooldown, chains from LungeAttack
Grapple:       0-100cm,   3s cooldown, BehaviorTree with special animation