STEP 19 OF 67 · YOU ARE THE NPC AND AI DESIGNER

Create one enemy

Waiting, noticing you, approaching, attacking, reacting to damage and dying. A State Tree holds its behavior and a navigation mesh lets it walk around obstacles.

How to do it

  1. Add a navigation mesh covering the level.
  2. Build a State Tree: idle, alert, chase, attack, hurt, dead.
  3. Check its attacks are readable and avoidable.
How AI speeds this up

Ask Duke to list the State Tree states and transitions for your enemy.

Example from a sample game

Ashfall: Veyl sentry. Patrols, hears footsteps within 8 m, telegraphs a spear thrust for 0.6 s.

Before you move on

In Duke Forger, this step's gate checks:

Words to know

State Tree
Unreal's system for NPC behavior: states like idle, alert, chase and attack, and the rules for switching between them.
Navigation mesh
An invisible map of where characters can walk, so NPCs can find routes around obstacles.
NPC
Non-player character: anyone in the game the player does not control.
Do step 19 on your own game

Included in Creator, Academy and Studio. Duke drafts it with you and checks it before step 20 opens.

Start free