Game dev
Saved & recent

GOAP

Also called: goal-oriented action planning

Related terms: planner, preconditions, effects

The AI is given a goal and a set of actions. Each action lists what it needs and what it changes. A planner then searches for a chain of actions that leads from the current situation to the goal. It is pathfinding through actions instead of through places.

Designers do not script sequences. They add actions, and plans emerge, including ones nobody expected. It costs more CPU and is harder to control than a behavior tree.

Further reading
Jeff Orkin: Applying Goal-Oriented Action Planning to Games
get key needs — adds has key 1 unlock door needs has key adds unlocked 2 open door needs unlocked adds door open 3 goal satisfied empty inventory
The planner finds a sequence that makes the door open. Each action adds a fact that the next one needs.

View in the full Game dev collection