Game dev
Saved & recent

Hierarchical task network

Also called: HTN

Related terms: planning, task decomposition, methods, GOAP

An AI planner that breaks a high-level task into smaller tasks until it reaches actions the character can execute. Designers supply methods describing alternative ways to perform a task, with conditions for choosing each method. A blocked route might make the planner try another decomposition.

Unlike GOAP, which searches combinations of action effects toward a goal, an HTN follows authored task decompositions. This gives designers structure while allowing plans to adapt to the situation. Killzone 2 uses HTN planning for its multiplayer bots; a task hierarchy describes how work breaks down, not merely which behavior has priority.

Game example
Guerrilla: Killzone 2 multiplayer bots
Further reading
T. J. Verweij: A Hierarchically-Layered Multiplayer Bot System for a First-Person Shooter
deliver parcel travel handoff bridge method ferry method bridge closed walk to pier board ferry selected steps
The delivery task breaks into travel and handoff. With the bridge closed, the travel task expands the ferry method into a walk to the pier and boarding.

View in the full Game dev collection