Recent from talks
Nothing was collected or created yet.
Behavior tree
View on Wikipedia


A behavior tree is a structured visual modeling technique used in systems engineering and software engineering to represent system behavior. It utilizes a hierarchical tree diagram composed of nodes and connectors to illustrate control flow and system actions. By replacing ambiguous natural language descriptions with standardized visual elements—such as boxes, arrows, and standard symbols—behavior trees improve clarity, reduce misinterpretation, and enhance understanding of complex systems.[1]
Overview
[edit]The extensive amount of detail involved in describing the numerous requirements of a large-scale system using natural language can lead to short-term memory overload,[2][3] hindering a comprehensive understanding of the system's needs.[4] Natural language often introduces ambiguities, aliases, inconsistencies, redundancies, and incomplete information to concepts.[5] This creates uncertainty and over-complicates systems.
The behavior tree representation attempts to eliminate uncertainty by limiting vocabulary to the original requirements. Large requirement sets may require the help of a composition tree[6] representation that resolves aliases and other vocabulary problems in a prior step. The aim is to produce a deep, accurate, and holistic representation of system needs[2] that can be understood by all readers (often stakeholders). Since the behavior tree notation uses formal semantics, it can serve as input for further processing, such as making an executable for a given set of requirements.
Behavior tree forms
[edit]

Both single and integrated (composite) behavior tree forms are important in applying behavior trees in systems and software engineering.
- Requirement behavior trees (RBT): Initially, individual requirement behavior trees are constructed to capture all behavioral fragments from each natural language requirement, using a rigorous translation process that preserves both intent and vocabulary. The translation process can uncover a range of defects in original natural language requirements.
- Integrated behavior trees (IBT): Because a set of requirements imply the integrated behavior of a system, all the individual requirement behavior trees can be composed to construct an integrated behavior tree that provides a single holistic view of the emergent integrated behavior of the system. This enables the construction of the system's integrated behavior from its requirements.[7] An analogy to help describe this process is the transition from a randomly arranged set of jigsaw puzzle pieces to putting each of the pieces in its appropriate place. When this happens, each piece of information is placed in its intended context and their collective emergent properties become clear.
Having all the requirements converted to behavior trees (RBT) is similar to having all the pieces for a jigsaw puzzle randomly spread out on a table – until all the pieces are connected, the emergent picture remains unclear, and it is uncertain whether any pieces are missing or don’t fit. Constructing an integrated behavior tree (IBT) reveals emergent behavior and missing pieces.[8][5]
Behavior engineering process
[edit]Critical aspects of behavior engineering representation and process are listed below.
Representation:
- The composition tree's role in the overall process is to provide a means to overcome the imperfect knowledge associated with the large set of requirements for a system.
Process:
- Behavior engineering uses behavior trees to control complexity while growing a shared understanding of a complex system.
- A shared holistic understanding of a complex system integrates requirements to show its implied emergent behavior.
History
[edit]Behavior trees and the concepts for their application in systems and software engineering were originally developed by Geoff Dromey.[8][5][9][10] The first publication of some of the key ideas were in 2001.[11] Early publications on this work used the terms "genetic software engineering" and "genetic design" to describe the application of behavior trees. The reason for originally using the word "genetic" was because sets of genes, sets of jigsaw puzzle pieces, and sets of requirements, when represented as behavior trees, all appear to share several key properties:
- They contained enough information as a set to allow them to be composed – with behavior trees, this allows a system to be built out of its requirements.
- The order in which the pieces were put together was not important – with requirements, this aids in coping with complexity.
- When all the members of the set were put together, the resulting integrated entity exhibited a set of important emergent properties.
For behavior trees, important emergent properties include:
- The integrated behavior of the system is implied by the requirements.
- The coherent behavior of each component is referred to in the requirements.
These genetic parallels, in another context, were originally spelled out by Adrian Woolfson.[12][13]
Despite these legitimate genetic parallels, it was felt that this emphasis led to confusion with the concept of genetic algorithms. As a result, the term behavior engineering was introduced to describe the processes that exploit behavior trees to construct systems.
Since the behavior tree notation was originally conceived, several people from the Dependable Complex Computer-based Systems Group (DCCS – a joint University of Queensland, Griffith University research group) have made important contributions to the evolution and refinement of the behavior tree notation and usage.[14]
Probabilistic timed behavior trees have been developed by researchers such as Rob Colvin, Lars Grunske, and Kirsten Winter of the DCCS, so that reliability, performance, and other dependability properties could be expressed.[15]
Key concepts
[edit]Behavior tree notation
[edit]
A behavior tree is used to formally represent the fragment of behavior in each requirement. In general, behavior for a large-scale system, where concurrency is admitted, appears abstractly as a set of communicating sequential processes. The behavior tree notation captures these composed component-states and represents them as a tree-like form.
Traceability tags (see Section 1.2 of behavior tree notation[16]) in behavior tree nodes link the formal representation to the corresponding natural language requirement.[17]
A behavior tree with leaf nodes may revert (symbolized by adding the caret operator "^") to an ancestor node to repeat behavior or start a new thread (symbolized by two carets "^^").
For a complete reference to behavior tree notation, see Behavior Tree Notation v1.0 (2007).[16]
Semantics
[edit]The formal semantics of behavior trees is given via a process algebra and its operational semantics.[18] The semantics have been used as the basis for developing simulation, model checking, and failure modes and effects analysis.[18][19][20]
Requirements translation
[edit]

Requirement integration
[edit]Operations on integrated behavior trees
[edit]Once an integrated behavior tree has been composed, there are a number of important operations that can be performed upon it.
Inspection: defect detection and correction
[edit]In general, many defects become much more visible when there is an integrated view of the requirements[2] and each requirement has been placed in the behavior context where it needs to execute. For example, it is much easier to tell whether a set of conditions or events emanating from a node is complete and consistent. The traceability tags[16] also make it easy to refer back to the original natural-language requirements. There is also the potential to automate a number of defect and consistency checks on an integrated behavior tree.[21]
When all defects have been corrected and the IBT is logically consistent and complete, it becomes a model behavior tree (MBT), which serves as a formal specification for the system's behavior that has been constructed out of the original requirements. This is the clearly defined stopping point for the analysis phase. With other modeling notations and methods (i.e. UML), it is less clear-cut when modelling can stop.[22] In some cases, parts of a model behavior tree may need to be transformed to make the specification executable. Once an MBT has been made executable, it is possible to carry out a number of other dependability checks.
Simulation
[edit]A model behavior tree can be readily simulated to explore the dynamic properties of the system. Both a symbolic tool and a graphics tool have been constructed to support these activities.[23][24]
Model checking
[edit]A translator has been written to convert a model behavior tree into the "actions systems" language. This input can then be fed into the SAL Model checker[25][26] to allow checks to be made as to whether certain safety and security properties are satisfied.[19][27]
Failure mode and effects analysis (FMEA)
[edit]Model checking has often been applied to system models to check that hazardous states can’t be reached during normal operation of the system.[28] It is possible to combine model-checking with behavior trees to provide automated support for failure mode and effects analysis (FMEA).[19] The advantage of using behavior trees for this purpose is that they allow the formal method aspects of the approach to be hidden from non-expert users.
Requirement changes
[edit]The ideal sought when responding to a change in the functional requirements for a system is that it can be quickly determined:
- where to make the change,
- how the change affects the architecture of the existing system,
- which components of the system are affected by the change, and,
- what behavioral changes will need to be made to the components (and their interfaces) that are affected by the change of requirements.[29]
Because a system is likely to undergo many changes over its service life, it is necessary to record, manage, and optimize its evolution driven by these changes.
A traceability model, which uses behavior trees as a formal notation to represent functional requirements, reveals change impacts on different types of design constructs (documents) caused by the changes of the requirements.[30] The model introduces the concept of evolutionary design documents that record the change history of the designs. From these documents, any version of a design document, as well as the difference between any two versions, can be retrieved. An important advantage of this model is that automated tools can support a major part of the procedure to generate these evolutionary design documents.[21]
Code generation and execution
[edit]The behavior tree representation of the integrated behavior of the system offers several important advantages as an executable model. It clearly separates the tasks of component integration from the task of individual component implementation. The integrated system behavior resulting from requirement integration can serve as a foundation for design decisions. The result is a design behavior tree (DBT):[5] an executable multi-thread component integration specification that has been built out of the original requirements.
Behavior tree models are executed in a virtual machine called the behavior run-time environment (BRE). The BRE links together components using middleware,[31] allowing components to be independent programs written in one of several languages that can be executed in a distributed environment. The BRE also contains an expression parser that automatically performs simple operations to minimize the amount of code required to be manually implemented in the component.
Executable behavior trees have been developed for case studies[22] including automated train protection,[32] mobile robots with a dynamic object following, an ambulatory infusion pump,[20] and traffic light management systems. A version of the BRE suited for embedded systems (eBRE) is also available, with reduced functionality tailored for small-footprint microcontrollers.
Applications
[edit]Behavior tree modeling can and has been applied to a diverse range of applications over a number of years. Some of the main application areas are described below.
Large-scale systems
[edit]Modeling large-scale systems with extensive sets of natural-language requirements has always been a major focus for testing behavior trees and the overall behavior engineering process. Conducting these evaluations and trials of the method has involved work with a number of industry partners and government departments in Australia. The systems studied have included a significant number of defense systems, enterprise systems, transportation systems, information systems, health systems, and sophisticated control systems with stringent safety requirements. The results of these studies have all been classified as commercial-in-confidence. However, the results of the extensive industry trials[3][4] with Raytheon Australia are presented below in the Industry Section. This work has shown that translating requirements into integrated static and dynamic behavior-tree views revealed substantially more major defects than the company’s standard review processes detected.[33]
Embedded systems
[edit]Failure of a design to meet a system's requirements can result in schedule and cost overruns.[34] If there are also critical dependability issues, not satisfying system requirements can have life-threatening consequences.[35] However, in current approaches, ensuring that requirements are met is often delayed until late in the development process, during a cycle of testing and debugging..[36] This work describes how the system development approach, behavior engineering, can be used to develop software for embedded systems.[27]
Hardware – software systems
[edit]Many large-scale systems consist of a mixture of co-dependent software and hardware. The different nature of software and hardware means they’re often modeled separately using different approaches. This can subsequently lead to integration problems due to incompatible assumptions about hardware/software interactions.[32] These problems can be overcome by integrating behavior trees with the Modelica mathematical modeling approach.[32] The environment and hardware components are modeled using Modelica and integrated with an executable software model that uses behavior trees.
Role-based access control
[edit]To ensure correct implementation of complex access control requirements, it is important that the validated and verified requirements are effectively integrated with the rest of the system.[37] It is also important that the system can be validated and verified early in the development process. An integrated, role-based access control model has been developed.[38] The model is based on the graphical behavior tree notation and can be validated by simulation, as well as verified using a model checker. Using this model, access control requirements can be integrated with the rest of the system from the outset, because: a single notation is used to express both access control and functional requirements; a systematic and incremental approach to constructing a formal behavior tree specification can be adopted; and the specification can be simulated and model checked. The effectiveness of the model has been evaluated using a case study with distributed access control requirements.[37]
Biological systems
[edit]Because behavior trees describe complex behavior, they can be used for describing a range of systems not limited to those that are computer-based.[39]
Game AI modeling
[edit]While behavior trees have become popular for modeling the artificial intelligence in computer games such as Halo[40] and Spore,[41] these types of trees are very different from the ones described on this page and are closer to a combination of hierarchical finite-state machines or decision trees. Soccer-player modeling has also been a successful application of behavior trees.[42][43]
Model-Based Testing
[edit]Model-based testing is an approach to software testing that requires testers to create test models from requirements of Software Under Test (SUT). Traditionally, modeling languages such as UML statecharts, finite-state machines (FSMs), extended finite-state machines (EFSMs), and flowcharts have been used. Recently, an interesting approach in which Event-Driven Swim Lane Petri Net (EDSLPN) is used as the modeling language also appeared. Behavior tree notation should be considered as a good modeling notation to MBT also, and it has a few advantages among other notations:
- It has the same expressiveness level as UML state charts and EDSLPN.
- It is intuitive to use as a modeling notation due to its graphical nature.
- Each behavior tree node has a requirement tag; these greatly facilitate the creation of a traceability matrix from requirement to test artifact.[44]
Scalability and industry applications
[edit]

The first industry trials to test the feasibility of the method and refine its capability were conducted in 2002. Over the last three years, a number of systematic industry trials on large-scale defense, transportation, and enterprise systems have been conducted.[3][33] This work has established that the method scales to systems with large numbers of requirements but also that it is important to use tool support[23][45] in order to efficiently navigate and edit the resultant large integrated views of graphical data. On average, over a number of projects, 130 confirmed major defects per 1000 requirements have consistently been found after normal reviews and corrections have been made.[33] With less mature requirements sets, much higher defect rates have been observed.
Advantages
[edit]As a behavior modeling representation, behavior trees have a number of significant benefits and advantages:
- They employ a well-defined and effective strategy for dealing with requirement complexity, particularly where the initial needs of a system are expressed using hundreds or thousands of requirements written in natural language. This significantly reduces the risk on large-scale projects.[33]
- By rigorously translating then integrating requirements at the earliest possible time, they provide a more effective means for uncovering requirement defects than competing methods.[33][46]
- They employ a single, simple notation[16] for analysis, specification, and to represent the behavior design of a system.
- They represent the system behavior as an executable integrated whole.
- They build the behavior of a system out of its functional requirements in a directly traceable way, which aids verification and validation.[23][38]
- They can be understood by stakeholders without the need for formal methods training. By strictly retaining the vocabulary of the original requirements, this eases the burden of understanding.
- They have a formal semantics,[18] they support concurrency, they are executable, and they can be simulated, model checked, and used to undertake failure mode and effects analysis.[19]
- They can be used equally well to model human processes, to analyze contracts,[39] to represent forensic information, to represent biological systems, and many other applications. In each case, they deliver the same benefits in terms of managing complexity and seeing things as a whole. They can also be used for safety critical systems,[20] embedded systems,[27] and real-time systems.[47][48][49]
See also
[edit]References
[edit]- ^ Lindsay, Peter A. (1 September 2010). "Behavior Trees: From Systems Engineering to Software Engineering". 2010 8th IEEE International Conference on Software Engineering and Formal Methods. IEEE. pp. 21–30. doi:10.1109/sefm.2010.11. ISBN 978-1-4244-8289-4.
- ^ a b c Dromey, R.G. 2007. Principles for Engineering Large-Scale Software-Intensive Systems
- ^ a b c Boston, J. 2008. Raytheon Australia supports pioneering systems research Archived 15 September 2009 at the Wayback Machine
- ^ a b Raytheon Australia, 2008. Understanding grows on Behavior Trees Archived 15 September 2009 at the Wayback Machine
- ^ a b c d R.G.Dromey, From Requirements to Design: Formalizing the Key Steps Archived 25 July 2011 at the Wayback Machine, (Invited Keynote Address), SEFM-2003, IEEE International Conference on Software Engineering and Formal Methods, Brisbane, Sept. 2003, pp. 2–11.
- ^ Behavior Engineering. Composition Trees Archived 2 March 2009 at the Wayback Machine
- ^ Winter, K. 2007. Formalising Behaviour Trees with CSP
- ^ a b R.G.Dromey, "Formalizing the Transition from Requirements to Design" Archived 25 July 2011 at the Wayback Machine, in "Mathematical Frameworks for Component Software – Models for Analysis and Synthesis", Jifeng He, and Zhiming Liu (Eds.), World Scientific Series on Component-Based Development, pp. 156–187, (Invited Chapter) (2006)
- ^ R.L.Glass, "Is This a Revolutionary Idea or Not" Archived 25 July 2011 at the Wayback Machine, Communications of the ACM, Vol. 47(11), pp. 23–25, Nov. 2004.
- ^ R.G.Dromey, "Climbing Over the ‘No Silver Bullet’ Brick Wall" Archived 25 July 2011 at the Wayback Machine, IEEE Software, Vol. 23, No. 2, pp. 118–120, (March 2006)
- ^ R.G.Dromey, Genetic Software Engineering – Simplifying Design Using Requirements Integration, IEEE Working Conference on Complex and Dynamic Systems Architecture, Brisbane, Dec 2001.
- ^ A. Woolfson, Life Without Genes, Flamingo, 2000, ISBN 0-00-255618-9
- ^ Berlin, I. The Crooked Timber of Humanity: Chapters in the History of Ideas, Ed., H.Hardy, Princeton University Press, 1998 ISBN 0-691-05838-5
- ^ "Behavior Engineering World » History of Behavior Engineering". Retrieved 24 May 2025.
- ^ Colvin, R., Grunske, L., Winter, K. 2007 Probabilistic Timed Behavior Trees Archived 25 July 2011 at the Wayback Machine
- ^ a b c d Behavior Tree Group, ARC Centre for Complex Systems, 2007. Behavior Tree Notation v1.0 (2007) Archived 2016-03-04 at the Wayback Machine
- ^ Dromey, R.G. "Genetic Design: Amplifying Our Ability to Deal With Requirements Complexity" Archived 25 July 2011 at the Wayback Machine, in S.Leue, and T.J. Systra, Scenarios, Lecture Notes in Computer Science, LNCS 3466, pp. 95–108, 2005.
- ^ a b c Colvin, R., Hayes, I.J. 2006 A Semantics for Behavior Trees
- ^ a b c d L.Grunske, P.Lindsay, N.Yatapanage, K.Winter, An Automated Failure Mode and Effect Analysis Based on High-Level Design Specification with Behavior Trees, Fifth International Conference on Integrated Formal Methods (IFM-2005), Eindoven, The Netherlands, 2005.
- ^ a b c Zafar, S. and Dromey, R. G., (2005), Integrating Safety and Security Requirements into Design of an Embedded System. Archived 25 July 2011 at the Wayback Machine Asia-Pacific Software Engineering Conference 2005, 15–17 December, Taipei, Taiwan. IEEE Computer Society Press. pp. 629–636.
- ^ a b Smith, C., Winter, K., Hayes, I., Dromey, R.G., Lindsay, P., Carrington, D.: An Environment for Building a System Out of Its Requirements, 19th IEEE International Conference on Automated Software Engineering, Linz, Austria, Sept. (2004).
- ^ a b Dromey, R.G. Using Behavior Trees to Model the Autonomous Shuttle System Archived 25 July 2011 at the Wayback Machine, 3rd International Workshop on Scenarios and State Machines: Models, Algorithms, and Tools (SCESM04) ICSE Workshop W5S, Edinburgh, 25 May 2004
- ^ a b c L.Wen, R.Colvin, K.Lin, J.Seagrott, N.Yatapanage, R.G.Dromey, 2007, "Integrare, a Collaborative Environment for Behavior-Oriented Design", in Proceedings of the Fourth International Conference on Cooperative Design, Visualization and Engineering, LNCS 4674, pp. 122–131, 2007
- ^ C. Sun, S. Xia, D. Sun, D. Chen. H.F. Shen, W. Cai: "Transparent adaptation of single-user applications for multi-user real-time collaboration", ACM Transactions on Computer-Human Interaction, Vol. 13, No.4, December 2006, pp. 531–582.
- ^ Bensalem, S., Ganesh, V., Lakhnech, Y., Muñoz, C., Owre, et al.: "An Overview of SAL", Fifth NASA Langley Formal Methods Workshop (LFM 2000), 2000, pp. 187–196.
- ^ Rushby, J. Automated Formal Methods 2006 AFM-2006, Automated Formal Methods 2006, Seattle, August 2006, pp. 6–7.
- ^ a b c Zafar, S. and Dromey, R. G., 2005. Managing Complexity in Modelling Embedded Systems. Archived 25 July 2011 at the Wayback Machine Systems Engineering/Test and Evaluation Conference 2005, 7–9 November, Brisbane, Australia
- ^ Grunske, L., Colvin, R., Winter, K. Probabilistic Model-Checking Support for FMEA Quantitative Evaluation of Systems. QEST 2007. Fourth International Conference on the Quantitative Evaluation of Systems, 17-19 Sept. 2007 pp. 119–128
- ^ Wen, L., Dromey, R.G. 2007. From Requirements Change to Design Change: A Formal Path[permanent dead link]
- ^ Wen, L., Dromey, R.G. 2005. Architecture Normalization for Component-Based Systems Archived 25 July 2011 at the Wayback Machine Proceedings of the 2nd International Workshop on Formal Aspects of Component Software FACS'05, pp. 247–261.
- ^ RTI Inc. 2007 "Meeting Real-Time Requirements in Integrated Defense Systems", RTI White Paper Archived 20 September 2008 at the Wayback Machine.
- ^ a b c Myers, T., Fritzson, P., Dromey, R.G. 2008. Seamlessly Integrating Software & Hardware Modelling for Large-Scale Systems. 2nd International Workshop on Equation-Based Object-Oriented Languages and Tools (EOOLT 2008), Cyprus, July 2008. pp. 5–15.
- ^ a b c d e Powell, D. 2007. Requirements Evaluation Using Behavior Trees – Findings from Industry Archived 25 July 2011 at the Wayback Machine
- ^ Barker, D. 2000. Requirements modeling technology: a vision for better, faster, and cheaper systems. Proceedings from VHDL International Users Forum Fall Workshop, 2000. pp. 3–6.
- ^ Leveson, N. G. Safeware: System Safety and Computers: [a guide to preventing accidents and losses caused by technology]. Addison-Wesley Publishing Company, 1995. ISBN 0-201-11972-2
- ^ Futrell, R. T., Shafer, D.F., Shafer, L.I. Quality Software Project Management (Software Quality Institute Series). Prentice Hall, 2002 ISBN 0-13-091297-2
- ^ a b Zafar, S. Colvin, R., Winter, K., Yatapanage, N., Dromey, R.G. Early Validation and Verification of a Distributed Role-Based Access Control Model. 14th Asia-Pacific Software Engineering Conference, Nagoya, Japan, December 2008. pp. 430–437.
- ^ a b Zafar, S., K.Winter, R.Colvin, R.G.Dromey, "Verification of an Integrated Role-Based Access Control Model" Archived 25 July 2011 at the Wayback Machine, 1st International Workshop – Asian Working Conference on Verified Software (AWCVS'06), pp 230-240, Macao, Oct. 2006.
- ^ a b Milosevic, Z., Dromey, R.G. On Expressing and Monitoring Behavior in Contracts, EDOC 2002, Proceedings, 6th International Enterprise Distributed Object Computing Conference, Lausanne, Switzerland, Sept. 2002, pp. 3-14.
- ^ Damian Isla Handling Complexity in the Halo 2 AI.
- ^ Chris Hecker My Liner Notes for Spore
- ^ Xiao-Wen Terry Liu and Jacky Baltes An Intuitive and Flexible Architecture for Intelligent Mobile Robots 2nd International Conference on Autonomous Robots and Agents, December 13–15, 2004 Palmerston North, New Zealand
- ^ Yukiko Hoshino, Tsuyoshi Takagi, Ugo Di Profio, and Masahiro Fujita Behavior description and control using behavior module for personal robot
- ^ "A Model Based Testing tool - MBTester · 测试之家". testerhome.com. Retrieved 12 June 2025.
- ^ Phillips, V., (Raytheon Australia), "Implementing a Behavior Tree Analysis Tool Using Eclipse Development Frameworks"[permanent dead link], Australian Software Engineering Conference (ASWEC’08), Perth, March 2008
- ^ Boston, J., (Raytheon Australia), Behavior Trees – How they improve Engineering Behaviour?[permanent dead link], 6th Annual Software and Systems Engineering Process Group Conference (SEPG 2008), Melbourne, Aug. 2008.
- ^ Lin, K., Chen, D., Sun, C., Dromey, R.G., A Constraint Maintenance Strategy and Applications in real-time Collaborative Environments[permanent dead link], 2nd International Conference on Cooperative Design, Visualization and Engineering (CDVE2005), 2005.
- ^ Lin, K., Chen, D., Dromey, R.G., Sun, CZ.: Multi-way Dataflow Constraint Propagation in Real-time Collaborative Systems Archived 25 July 2011 at the Wayback Machine, IEEE, The 2nd International Conference on Collaborative Computing: Networking, Applications and Worksharing (CollaborateCom 2006), Atlanta, Georgia, USA, Nov, 2006.
- ^ Grunske, L., Winter, K., Colvin, R., "Timed Behavior Trees and their application to verifying real-time systems" Archived 18 November 2008 at the Wayback Machine, Proceedings of 18th Australian Conference on Software Engineering (AEWEC 2007), April 2007, accepted for publication.
External links
[edit]Behavior tree
View on GrokipediaOverview
Definition and Purpose
A behavior tree (BT) is a modular, hierarchical directed tree structure used in artificial intelligence to model the decision-making process of autonomous agents, such as robots or non-player characters (NPCs) in video games. It organizes behaviors through a set of nodes that define control flow and execution logic, enabling the agent to select and switch between tasks in response to environmental changes.[1] The primary purpose of BTs is to provide a reactive and scalable alternative to traditional approaches like finite state machines (FSMs) or scripts, allowing for complex, interruptible behaviors that are easier to design, debug, and maintain. They are particularly needed for programming AI characters in video games because they enable reactive, modular, and interruptible behaviors for NPCs, overcoming the limitations of FSMs such as state explosion in handling intricate decision-making scenarios.[4] BTs facilitate real-time decision-making by propagating status updates—running, success, or failure—from leaf nodes (actions or conditions) up to the root via a periodic "tick" signal, ensuring the agent can adapt dynamically without combinatorial explosion in state management.[1] This structure supports modularity, where subtrees can be reused across different agents or scenarios, and promotes human-readable representations that bridge technical implementation with high-level design intentions.[4]Forms of Behavior Trees
Behavior trees in AI typically consist of control flow nodes that dictate how child nodes are executed and leaf nodes that perform actual work. Control flow nodes include sequences, which execute children in order until one fails or all succeed; fallbacks (also called selectors), which try children in priority order until one succeeds; and parallels, which run multiple children concurrently with customizable success/failure policies (e.g., succeed if all succeed or any succeed).[1] Decorators modify the output of a single child, such as inverters (negating success/failure) or repeaters (limiting executions), while leaf nodes are either actions (e.g., "move to target") that can return running/success/failure or conditions (e.g., "enemy in range") that return success/failure.[5] Variations of BTs extend the basic form for specific needs. Standard BTs emphasize reactivity and modularity for game AI, as in NPC behaviors in titles like Halo 2. Utility-based BTs incorporate utility functions to weigh options under uncertainty, aiding optimization in dynamic environments like robotics navigation.[1] Hybrid forms integrate BTs with other techniques, such as planning (e.g., Hierarchical Task Networks) or learning (e.g., reinforcement learning for tree adaptation), enabling more flexible control in applications like autonomous vehicles or UAVs.[1] For example, a sequence might chain "search for enemy" (condition) to "attack" (action), with a fallback to "patrol" if the sequence fails, demonstrating how BTs compose simple behaviors into emergent complexity.[4]History
Origins in the Computer Game Industry
Behavior trees originated in the computer game industry in the early 2000s as a scalable and reactive alternative to finite state machines (FSMs) and hierarchical state machines for controlling non-player characters (NPCs). They addressed the limitations of traditional approaches, such as combinatorial explosion in state transitions and difficulty in maintaining complex behaviors.[1] The technique was pioneered by Damian Isla at Bungie Studios for Halo 2 (released November 2004), where it enabled modular, interruptible AI behaviors for enemies, allowing designers to compose high-level tactics from reusable components.[6] Isla presented the approach at the Game Developers Conference (GDC) in 2005, highlighting its use in managing AI complexity through hierarchical structures with selectors, sequences, and decorators. Earlier implementations may have existed in real-time strategy games like StarCraft (1998), but formal adoption and documentation began around this period.[6] Subsequent adoption spread to other titles, including BioShock (2007) and Spore (2008), where behavior trees facilitated drag-and-drop authoring by non-programmers. Alex J. Champandard contributed significantly through his work on behavior tree toolkits and chapters in Game AI Pro (2013), promoting standardized implementations and extensions like utility-based selections for decision-making under uncertainty.[7] By the mid-2000s, behavior trees had become a standard in AAA game development, valued for their readability and modularity.Adoption in Robotics and Key Developments
Around 2010, behavior trees transitioned from games to robotics, drawn by their suitability for real-time, reactive control in dynamic environments. Influenced by foundational game works, researchers like Petter Ögren and Michele Colledanchise adapted BTs for unmanned aerial vehicles (UAVs) and manipulation tasks, integrating them with planning systems.[8] A seminal 2014 paper by Colledanchise et al. formalized BT semantics for robotic mission specification, enabling hybrid architectures combining deliberation and reactivity.[9] Key milestones include the 2017 introductory survey by Colledanchise and Ögren, which popularized BTs in robotics via modular control frameworks.[1] Integrations with the Robot Operating System (ROS) followed, with packages like py_trees (2016) and BehaviorTree.CPP (2018) providing open-source tools for implementation.[10] Post-2015 developments emphasized extensions for uncertainty and learning. Utility-based BTs (2010s) incorporated decision optimization, while hinted BTs (2020s) supported guided exploration in reinforcement learning.[11] Hybrids with Hierarchical Task Networks (HTNs) and machine learning emerged, such as genetic programming for tree synthesis (e.g., Amazon Picking Challenge 2016) and multi-agent reinforcement learning integrations (2022–2024).[12] As of 2026, BTs are used in autonomous vehicles, industrial robotics (e.g., CoSTAR system), and social robots, with ongoing research on AI-assisted generation using large language models for natural language to BT translation.[13] Recent advancements include automatic behavior tree expansions with LLMs for robotic manipulation,[14] code-driven BT generation for robot task planning using LLMs,[15] uncertainty-aware BTs to enhance adaptability in dynamic environments,[16] and web-based tools like BTstudio for programming robotic applications.[17] Further developments encompass LLM-BT hybrids for achieving adaptive tasks from human instructions in robotics[18] and behavior tree-based visual reasoning architectures for enhanced object recognition in control systems.[19]Key Concepts
Behavior Tree Notation
Behavior Tree Notation in AI and robotics provides a modular graphical language for modeling agent behaviors as hierarchical trees, combining control flow and execution nodes to define reactive policies. Unlike rigid state machines, this notation supports reusability and scalability, with trees composed of nodes that propagate status updates during execution. The root node represents the agent's main objective, while leaf nodes specify primitive actions or conditions, enabling visual design of complex, interruptible behaviors. This notation plays a crucial role in AI by facilitating the modeling of non-player characters in games and adaptive controllers in robotics, allowing designers to compose behaviors hierarchically for enhanced modularity.[1][5] The graphical representation typically orients the tree top-down from the root, with edges indicating parent-child relationships and control flow. Node types are distinguished by shapes or colors: action nodes (often ovals or rectangles for tasks like "move forward"), condition nodes (diamonds or circles for checks like "obstacle detected?"), and control nodes using symbols such as arrows for sequences or branches for alternatives. This convention, popularized in game AI and adapted for robotics, facilitates debugging through tools like visual editors in frameworks such as BehaviorTree.CPP or ROS, including graphical tools like Groot for editing and visualization. Annotations can include priorities or probabilities for stochastic variants, and common symbols include "?" for fallback (selector) nodes to denote priority-based alternatives. In robotics modeling, this visual syntax supports the creation of reusable subtrees, promoting modularity by allowing components to be shared across different agents or scenarios.[1][20] Core elements include leaf nodes for atomic actions or conditions, sequence nodes (often depicted as linear chains) that execute children in order until failure or completion, fallback nodes (priority branches) that try alternatives until success, and parallel nodes for simultaneous execution with policies like succeed-on-all or succeed-on-one. Decorator nodes wrap children to modify behavior, such as inverters (negate status) or repeaters (loop until condition), with examples like RetryUntilSuccessful for robust task execution in uncertain environments. These elements enable key modeling techniques in AI and robotics, such as hierarchical decomposition for complex tasks and parametric behaviors via blackboards for data sharing, ensuring reusability of subtrees in diverse applications like autonomous navigation. Composites like sequences and fallbacks are the most frequently used (over 70% in studied robotics models), underscoring their importance in scalable behavior design.[1][20][5] Formally, a behavior tree is a directed acyclic graph BT = (N, E), with N the set of nodes and E the edges from parents to children, rooted at a single node. Execution semantics define status propagation: leaves return running (ongoing), success, or failure; composites aggregate these to determine their status. This structure supports analysis via state-space exploration, ensuring properties like liveness and safety, and facilitates modularity through intra-model referencing of subtrees.[1][20] The notation evolved from game industry practices in the early 2000s, with no single formal standard but common conventions outlined in resources like the book Behavior Trees in Robotics and AI (2018), promoting interoperability in tools and influencing extensions for timing or utility-based decisions. Recent studies highlight its adoption in robotics DSLs like BehaviorTree.CPP, emphasizing graphical notations for improved reusability and separation of model from implementation.[1][20]Semantics
The semantics of behavior trees in AI define a reactive execution model where the tree acts as a policy mapping perceptions to actions via periodic ticks, enabling real-time adaptation in dynamic environments. Each node is a black-box component returning one of three statuses—running, success, or failure—allowing modular composition without internal state exposure. This contrasts with deliberative planning by prioritizing reactivity over optimality, making it ideal for AI characters requiring interruptible behaviors and robotic systems needing robust control in uncertain settings.[1][5] Execution begins at the root on each tick (a system clock signal), traversing depth-first or as per node type, updating statuses bottom-up. Sequences run children left-to-right, returning running if any child is running, success if all succeed, else failure. Fallbacks (selectors) try children in priority order, succeeding on the first success or running if that child is running, failing only if all fail. Parallels execute all children concurrently, with outcomes like success if a threshold of children succeed (e.g., all or any). Guards (conditions) block or allow subtrees, and decorators alter statuses (e.g., succeeder forces success). In robotics, ticks synchronize with sensor data, supporting interruption for safety, and the blackboard pattern enables shared memory for parameter passing, enhancing modularity by decoupling nodes from direct dependencies. This tick-driven model, with statuses propagating upward, supports key techniques like hierarchical feedback for reusability across AI and control applications.[1][20][5] State is captured implicitly through the active node path and external world model, with no explicit tree-internal variables; behaviors interact via shared memory or blackboard patterns. Failure in a sequence halts subsequent children, enabling clean interruption, while running status prevents re-execution of ongoing tasks. This model supports hierarchical feedback, where higher nodes monitor and override lower ones for robustness, and promotes reusability by allowing subtrees to be referenced and parameterized without modification. In robotics semantics, parallels and decorators are used to model concurrent tasks and adaptive policies, with studies showing high usage rates (e.g., 16-19% for parallels in ROS-based systems).[1][20] Mathematically, semantics can be denotational, mapping trees to transition systems or labeled transition systems, where ticks label transitions preserving equivalence: e.g., on success, else failure. Extensions use probabilistic models for uncertainty, integrating with POMDPs or Monte Carlo methods for verification, achieving low error rates in simulations (e.g., <0.2% over large runs). These formalisms underpin modeling techniques for verifying modular, reusable behaviors in AI and robotics.[1]Requirements Translation
Translating high-level requirements or goals into behavior trees involves decomposing agent objectives into hierarchical structures of actions and conditions, ensuring reactivity and modularity. Start by identifying atomic behaviors from the specification, such as "navigate to target if path clear," mapping inputs (sensors) and outputs (actuators) to leaf nodes.[1] Decompose using patterns: sequences for ordered tasks (e.g., sense then act), fallbacks for alternatives (e.g., primary path or detour), parallels for multitasking (e.g., monitor battery while moving). For the requirement "Avoid obstacles while pursuing goal," create a fallback root with pursuit sequence guarded by obstacle condition, inverting to retry on detection. Use causal reasoning to link behaviors, tagging nodes for traceability to specs.[1] Challenges include handling uncertainty (e.g., partial observability), addressed by probabilistic conditions or decorators; vagueness in requirements like "safe speed" requires domain-specific tuning. Iterative refinement with simulation ensures completeness, covering nominal, failure, and recovery cases. The result is an executable tree formalizing the policy, minimizable for efficiency.[1]Requirement Integration
Integrating multiple behavior trees combines sub-policies into a cohesive agent controller, reusing modules while resolving conflicts through composition operators. Begin by identifying shared roots or interfaces, such as common preconditions (e.g., "agent idle"), to align trees.[1] The process uses operators incrementally: sequence for chaining (e.g., navigation then manipulation), fallback for prioritization (e.g., safety override over task), parallel for concurrency (e.g., perception alongside action). Subtrees graft at matching nodes; for example, integrate a "search" tree with "grasp" by sequencing post-detection. Detect conflicts like resource contention via simulation, resolving with priorities (safety first).[1] Techniques include library-based reuse (pre-built subtrees) and hierarchical integration, starting top-down from main goal. An example: combine patrolling (sequence of moves) with interaction (fallback on detection), using parallel for background monitoring. Automated tools like genetic programming synthesize integrations, informed by domain specs.[1] The integrated tree provides a unified, verifiable policy, enabling analysis for properties like completeness and fault tolerance early in development.[1]Engineering Processes
Inspection and Defect Correction
Inspection of integrated behavior trees involves manual and semi-automated techniques to detect defects after requirements have been translated and combined into a unified structure. Walkthroughs are a primary method, where reviewers systematically examine the tree for node consistency—ensuring that behavioral units align with specified preconditions and postconditions—completeness by verifying that all requirements are represented without omissions, and coherence to identify dead paths or unreachable nodes that could lead to system failures.[21] Visual anomaly detection complements these efforts, leveraging the graphical nature of behavior trees to spot irregularities such as mismatched event flows or illogical branching in diagrams, often using heuristic checklists like "Does this sequence terminate properly?" or "Are all states realized?"[22] Common defect types include missing behaviors, where essential actions or states are absent from the tree; inconsistent sequences, such as conflicting responses to the same event across subtrees; and unresolved conflicts, like ambiguous preconditions that allow multiple interpretations. These defects are corrected through targeted interventions, including direct node editing to add or modify behavioral elements and subtree replacement to overhaul problematic sections while preserving overall structure. For instance, in a safety-critical system, a fallback gap—such as an unhandled failure mode in an emergency shutdown sequence—might be identified during a walkthrough and resolved by inserting a dedicated fallback node to ensure safe degradation.[21][22] The inspection process follows iterative review cycles, engaging stakeholders like requirements engineers and domain experts to validate findings and propose fixes, often spanning multiple passes until no new defects emerge. Metrics such as the coverage ratio—calculated as the number of integrated requirements divided by the total requirements—help quantify completeness, with applications in complex systems like satellite controls. This stakeholder-involved approach not only corrects defects but also enhances understanding compared to ad-hoc reviews.[21][23]Simulation
Simulation of behavior trees involves dynamically executing the tree structure to validate system behaviors against requirements during the engineering process. A tick-based execution engine traverses the tree starting from the root node, propagating control flow through composite nodes (such as sequences, fallbacks, and parallels) to leaf nodes representing actions or conditions, and returning statuses like success, failure, or running.[24] Inputs are injected into observable variables or conditions to simulate environmental stimuli, while state changes are observed and logged to trace execution paths and verify compliance with specified behaviors.[25] This process adheres to the standard semantics of behavior trees, where each tick represents a discrete decision cycle.[24] Simulations can operate in discrete-event mode, advancing only on significant changes, or in real-time mode to mimic continuous system dynamics, depending on the tool's configuration.[25] Tools for behavior tree simulation typically include generic simulators that map tree nodes to executable code stubs or scripts, enabling rapid prototyping without full system implementation. For instance, the SimTree tool uses model-to-text transformations to generate Datalog-based executables from behavior trees, allowing multiple simulation runs to explore different input scenarios and validate requirements through query-based analysis of traces, as demonstrated in the Ambulatory Infusion Pump case study.[25] Validation focuses on tracing success paths, detecting deviations from expected outcomes, and confirming that the tree satisfies functional requirements, such as ensuring all necessary actions complete under given conditions.[25] The primary benefits of simulation include early detection of runtime issues, such as infinite loops in reactive behaviors or unexpected state transitions, which can inform iterative refinements before integration.[24] It also enhances stakeholder understanding by visualizing dynamic executions, facilitating requirement validation in complex systems.[25] However, simulations are limited to sampled paths and scenarios, providing non-exhaustive coverage that may miss rare edge cases without complementary formal methods.[24] A representative example is simulating requirements for an ambulatory infusion pump, where scenarios such as dosage adjustments or error conditions are injected as inputs to evaluate compliance with safety requirements while tracing state changes.Model Checking
Model checking provides a formal method to verify that behavior trees satisfy specified properties, such as safety and liveness, by exhaustively exploring all possible execution paths. In this approach, a behavior tree is translated into a finite state machine model, typically represented in a model checking language like SMV or SAL, through recursive traversal of the tree structure to define states, transitions, and variables for nodes. This translation captures the tree's semantics, enabling the application of temporal logic formulas to check requirements; for instance, Linear Temporal Logic (LTL) is commonly used to express properties like "always grant access if authenticated," formulated as G(authenticated → grant_access).[26][27] Algorithms for verification often employ symbolic model checking with Binary Decision Diagrams (BDDs) to represent and manipulate state spaces efficiently, improving scalability for trees with dozens of nodes. Tools such as nuXmv or SAL are adapted for behavior tree semantics, where the tree's modular structure—sequences, selectors, and decorators—is encoded as hierarchical modules or processes. Properties verified include reachability, such as ensuring a specific task (e.g., a surface operation) is eventually executed under certain conditions (F(trigger → task)), and invariance, confirming that safety rules like access controls hold globally (G(condition → invariant)). When a property fails, these tools generate counterexamples as traces of execution paths leading to violations, aiding debugging by highlighting faulty node interactions.[26][28][29] Despite these advances, model checking behavior trees faces challenges from state explosion, where the exponential growth in states from parallel or large trees (e.g., over 100 nodes) can render verification computationally infeasible, as seen in cases where adding behaviors increases checking time from minutes to hours. Mitigations include abstraction techniques, such as simplifying irrelevant subsystems or using optimized encodings that group states (e.g., total order encodings), and model slicing based on dependence graphs to reduce the verified subset while preserving LTL properties via stuttering equivalence. These methods ensure verification remains practical for complex systems without sacrificing formal guarantees.[26][27][28]Failure Mode and Effects Analysis
Failure Mode and Effects Analysis (FMEA) for behavior trees systematically identifies potential failure modes at the node level and evaluates their propagation and impacts on system objectives, adapting traditional FMEA techniques to the modular, hierarchical structure of behavior trees. Failure modes are enumerated per node type, such as a condition node failing due to erroneous sensor input (e.g., false positive from noise) or an action node omitting execution because of resource unavailability, drawing from component-specific faults like delays or omissions in time-critical systems.[30] Effects propagate upward through control flow constructs, for instance, a sequence node failure activating a fallback selector to attempt alternative behaviors, allowing analysts to trace local faults to global hazards like mission failure. Risks are assessed using severity (potential harm to safety or performance), occurrence (estimated failure probability), and detectability (likelihood of early identification), often yielding a Risk Priority Number (RPN) as the product of these factors to prioritize critical issues.[31] Integration of FMEA with behavior trees involves annotating nodes with failure probabilities derived from reliability data or simulations, enabling probabilistic modeling of fault propagation. These annotated trees can generate fault trees that represent combinations of node failures leading to top-level events, such as system-wide unsafe states, which are then analyzed for minimal cut sets using formal methods. This automation supports quantitative risk evaluation without exhaustive manual tracing, particularly in complex hierarchies. Mitigation focuses on redesigning affected subtrees, such as inserting parallel decorators for redundancy or additional condition checks to tolerate faults. In safety-critical automotive controls, for example, behavior trees for braking systems might add fallback actions with duplicate sensors to mitigate hydraulic line failures, ensuring compliance with hazard mitigation requirements.[31] These techniques align with SAE J1739 guidelines for design-phase FMEA, emphasizing early identification of potential effects, and ISO 26262 standards for automotive functional safety, where FMEA informs ASIL (Automotive Safety Integrity Level) determination and fault-tolerant architectures.[32][33]Handling Requirement Changes
Handling requirement changes in behavior trees involves systematically updating the tree structure to accommodate evolving specifications while preserving the integrity of unaffected components. This process begins with identifying impacted subtrees through dependency analysis, such as constructing a Requirements Components Dependency Network (RCDN) from the integrated behavior tree (IBT), which visualizes connections between requirements and components to pinpoint changes' ripple effects.[34] New or modified requirements are then re-translated into individual Requirement Behavior Trees (RBTs), followed by re-integration into the existing IBT via modular replacement of leaf nodes or affected branches, minimizing disruption to the overall tree.[34] This approach leverages the hierarchical modularity of behavior trees to isolate changes, ensuring that only relevant paths are altered.[35] Key techniques for managing these updates include versioning of tree diagrams to track historical states and delta integration, which focuses on incorporating only modified components without rebuilding the entire structure.[34] Conflict resolution addresses issues like added constraints by assessing competing requirements through semantic analysis in the RCDN, prioritizing or reconciling them to avoid inconsistencies.[34] For instance, if a new safety constraint conflicts with an existing performance requirement, the process evaluates dependency strengths to propose resolutions, such as subtree substitutions.[34] Challenges in this domain encompass scalability for large trees, where complex dependencies can lead to exponential analysis times, and maintaining traceability from original requirements, often requiring manual initial mappings that risk errors over iterations.[34] In risk assessment contexts, balancing model granularity during updates poses additional difficulties, as oversimplification may overlook subtle risks while excessive detail hampers maintainability. Best practices emphasize incremental updates paired with re-verification, such as generating Component Impact Diagrams (CIDs) post-integration to validate changes against original intents.[34] Tools like version control systems facilitate iterative remodelling, ensuring traceability through automated mappings. An example is updating a behavior tree for new regulatory compliance in autonomous systems, where added environmental monitoring requirements are integrated as new leaf actions, re-verified via simulation to confirm adherence without altering core navigation logic.[34]Code Generation and Execution
Code generation from behavior trees involves translating the hierarchical structure and node semantics into executable programming constructs, ensuring fidelity to the original model. Control nodes such as sequences are typically mapped to iterative loops that execute child nodes in order until success or failure, while fallback (selector) nodes are translated to conditional statements like if-else chains that attempt alternatives until one succeeds. This mapping can be automated using templates or model-to-text transformations, producing code in languages such as C++ or Java; for instance, in the Behavior Engineering methodology, behavior tree nodes are first specified in the Abstract Behavioral Specification (ABS) language and then compiled to Java, where behaviors like state realizations (e.g., "oven cooking") become method invocations such astimer_var!start().[36] Such approaches maintain modularity by representing leaf nodes (actions or conditions) as function calls, enabling the generated code to reflect the tree's reactive and hierarchical nature without introducing extraneous control flow.[37]
The execution of generated behavior trees relies on a runtime engine that interprets or compiles the tree for dynamic traversal, often employing a "tick" mechanism where the root node propagates activation signals to children at a specified frequency to drive real-time behavior. In robotics and embedded systems, libraries like BehaviorTree.CPP provide this engine as a lightweight C++ interpreter, supporting prioritized scheduling and interruptible execution to handle time-critical tasks, such as sensor-actuator loops in autonomous agents.[10] The engine ensures deterministic execution by evaluating node statuses (success, failure, or running) and blackboard mechanisms for shared state, allowing the tree to react to environmental changes without full recompilation.[11]
Post-generation validation verifies that the executable code preserves the behavior tree's semantics through techniques like equivalence checking and simulation-based testing; for example, in an oven control system modeled as a behavior tree, generated Java code is tested against scenarios such as "button push with door open" to confirm no unintended actions occur, often augmented by model checking tools like SAL for temporal properties.[36] This step ensures the implementation aligns with requirements, identifying discrepancies in control flow or timing early in deployment.
Extensions to behavior tree execution include integration with middleware frameworks, such as the Robot Operating System (ROS), where trees are deployed via packages like behavior_tree_core to orchestrate distributed nodes in robotic applications, facilitating seamless communication between tree actions and hardware interfaces like sensors and motors.
