Behavior Trees¶
Behavior Trees are tree-like structures that stem from a single root node and are evaluated from top-to-bottom, and following a left-to-right priority order, having the right one the highest priority.
Behavior Trees vs State Machines
Although State Machines are better suited for simple AI systems, they can quickly become messy with lots of connection edges and hard to maintain. Behavior Trees are slightly more complex but offer much more flexibility and are easier to read at a glance when having lots of nodes.