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
- Add a navigation mesh covering the level.
- Build a State Tree: idle, alert, chase, attack, hurt, dead.
- 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:
- You confirm itThe enemy patrols, notices, chases, attacks, reacts and dies
- You confirm itIt paths around obstacles
- You confirm itIts attacks can be seen coming and dodged
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
Start freeIncluded in Creator, Academy and Studio. Duke drafts it with you and checks it before step 20 opens.