Behavior Trees for Modelling Artificial Intelligence in Games: A Tutorial Ryan Marcotte 1 • Howard J. Hamilton 1 Received: 14 February 2017 / Accepted: 30 May 2017 Ó Springer Science+Business Media, LLC 2017 Abstract We provide a tutorial introduction to behavior trees, which are a useful way of structuring artificial intelligence in games. A behavior tree is a model of plan execution that is graphically represented as a tree. A node in a tree either encap- sulates an action to be performed or acts as a control flow component that directs traversal over the tree. Behavior trees are appropriate for specifying the behavior of non-player characters and other entities because of their maintainability, scalability, reusability, and extensibility. We describe the main features of behavior trees, show an example of how to create a behavior tree, and briefly survey existing packages for editing behavior trees. We recommend that behavior trees be used when some game designers are not programmers, the conditions governing the behavior are complex, and the NPCs have aspects of behavior in common. Keywords Behavior tree Á Game artificial intelligence Á Behavior tree editor Á Non-player character Á Tutorial Á Computer game design Á Behavior tree example 1 Introduction A behavior tree (BT) is a model for plan execution that is graphically represented as a tree, such as that shown in Fig. 1.A tree is a way of structuring information hierarchically that is widely used in Computer Science (Weiss 2013). Figure 1 shows a BT that describes the overall behavior of a ‘‘Simple attacker’’ (warrior) entity that evades enemies, finds first aid, attacks, or wanders. This BT is explained in detail in Sect. 3. & Howard J. Hamilton hamilton@cs.uregina.ca 1 Department of Computer Science, University of Regina, Regina, SK, Canada 123 Comput Game J DOI 10.1007/s40869-017-0040-9