Guide library 14 guides

Learn behavior trees.
Build smarter agents.

A practical path from your first sequence node to production-ready game AI and robotics. Every example opens in our free online editor, so you can learn by changing real trees.

Start with the introduction

Foundations

Start with the mental model and the building blocks.

  1. 01What Is a Behavior Tree? A Practical Introduction for Game AIBehavior trees explained from scratch: what they are, how ticks, sequences, selectors and decorators work, why games and robots use them, and an interactive editor to try one yourself.
  2. 02Sequence, Selector, and Decorator Nodes ExplainedA complete reference to behavior tree node types — sequences, selectors, parallels, memory variants, decorators, conditions and actions — with worked examples you can open in a free online editor.
  3. 03Behavior Tree Blackboards: How Nodes Share DataWhat a blackboard is, why every serious behavior tree framework has one, how key scoping works, and the patterns — and pitfalls — of using blackboards in Unreal, BehaviorTree.CPP, and behavior3.
  4. 04Behavior Trees vs Finite State Machines: Which Should You Use?An honest comparison of behavior trees and finite state machines for game AI — scalability, reactivity, debugging, performance — with concrete guidance on when each one wins.

Tools & platforms

Choose an approach for the engine or runtime you use.

  1. 05Best Behavior Tree Tools by Engine (2026): Unity, Unreal, Godot, ROS 2, PythonThe best behavior tree tools for Unity, Unreal Engine, Godot, ROS 2, and Python, compared on price, visual editing, live debugging, blackboards, and how actively they're maintained, with a recommended pick for each.
  2. 06Unity Behavior Trees Compared: Free and Paid Options (2026)Unity Behavior, Behavior Designer, NodeCanvas or open source? What each costs, where each falls short, and how to choose before you're locked in.
  3. 07UE5 Behavior Trees Explained: Tasks, Decorators, ServicesHow Unreal's behavior trees, blackboards, tasks, decorators and services fit together, how UE differs from classic BTs, and a working patrol/chase tree.
  4. 08Behavior Trees in Godot: LimboAI, Beehave, and Rolling Your OwnGodot doesn't ship behavior trees, but the ecosystem has strong free options — LimboAI, Beehave, or a small GDScript implementation of your own — compared honestly, with a design-first workflow.
  5. 09Behavior Trees in Robotics: BehaviorTree.CPP, ROS 2, and Nav2Why robotics adopted behavior trees from games — and how BehaviorTree.CPP, ROS 2, and the Nav2 navigation stack use them today, with the key differences from game-style trees.
  6. 10Behavior Trees in Python: py_trees Tutorial and ROS 2 GuideBuild a behavior tree in Python with py_trees: runnable code, blackboards, live tree output, a 40-line version from scratch, and py_trees_ros for ROS 2.

Practice & production

Build, debug, and scale trees that hold up in real projects.

  1. 11Behavior Tree Examples: 5 Common Game AI PatternsWorked behavior tree examples you can open in a free online editor: patrol/chase/attack enemies, guard posts, fleeing at low health, retry loops, and cooldown-gated special attacks.
  2. 12Debugging Behavior Trees: The 6 Classic MistakesWhy your sequence restarts every tick, why the tree won't switch branches, why the agent flip-flops between two behaviors — the recurring behavior tree bugs, their causes, and how to fix each one.
  3. 13How to Write a Behavior Tree from Scratch (~100 Lines)Implement a working behavior tree runtime yourself: the status enum, sequence, selector, memory variants, and decorators in about 100 lines of TypeScript that port directly to C#, GDScript, or C++.
  4. 14Structuring Large Behavior Trees: Subtrees, Reuse, and ScaleHow to keep behavior trees readable past 30 nodes — priority layering, extracting subtrees, parameterized leaves, naming conventions, and knowing when logic shouldn't live in the tree at all.