Game dev
Saved & recent

Behavior tree

Also called: BT

Related terms: AI, finite state machine, FSM, selector, sequence

A tree of checks and actions that chooses what an AI character does. Nodes return success, failure or running. A selector tries alternatives until one succeeds or is still running; a sequence proceeds until a child fails or is still running.

For example, try to see, chase and attack the player; otherwise patrol. Running actions can continue across updates. A finite state machine organizes behavior around explicit states and transitions instead.

Further reading
Unreal Engine: Behavior Tree Quick Start Guide
selector sequence patrol fallback visitor seen? approach greet success running waiting left-to-right evaluation
The selector tries the greeting sequence first. The check succeeded and approach is still running, so greeting waits and the patrol fallback stays idle.

View in the full Game dev collection