%0 Book Section %T Empowering designers with libraries of self-validated query-enabled behaviour trees publisher Springer %D 2011 %U 978-1-4419-8187-5 %U 978-1-4419-8188-2 %@ https://hdl.handle.net/20.500.14352/133546 %X Building the behaviour fornon-player characters (NPC) in a game is a collaborative effort betweenAI designers and programmers. Programmers provide to the designers with the building blocks for specifying behaviours in the game, and designers use some combination ofstate machines,scripting and visual languages to build complex behaviours by composing the basic pieces the programmers provide.Behaviour trees (BTs) are the technology of choice for AI programmers to build NPC behaviour. Although BTs can be naturally built using visual languages that require no programming, in general, they are considered too complex for being built by designers without a programming background. In this chapter, we propose a number of techniques for facilitating the collaborative work of behaviour design through BTs. We provide tools for creating and managing a library of reusable fragments of BTs, intended for both programmers and designers. Such library is accessed through retrieval mechanisms that also support the definition of query nodes in BTs that can be expanded at run-time. In order to harness such an expressive power in behaviour design, we also propose an extension to the component-based architecture that supports a number of sanity checks to validate BTs, both at design and run-time. %~