Query-Enabled Behavior Trees
Artificial intelligence in games is typically used for creating player's opponents. Manual editing of intelligent behaviors for nonplayer characters (NPCs) of games is a cumbersome task that needs experienced designers. Our research aims to assist designers in this task. Behaviors typically use recurring patterns, so that experience and reuse are crucial aspects for behavior design. The use of hierarchical structures like hierarchical state machines, behavior trees (BTs), or hierarchical task networks, allows working on different abstraction levels reusing pieces from the more detailed levels. However, the static nature of the design process does not release the designer from the burden of completely specifying each behavior. Our approach applies case-based reasoning (CBR) techniques to retrieve and reuse stored behaviors represented as BTs. In this paper, we focus on dynamic retrieval and selection of behaviors taking into account the world state and the underlying goals. The global behavior of the NPC is dynamically built at runtime querying the CBR system. We exemplify our approach through a serious game, developed by our research group, with gameplay elements from first-person shooter (FPS) games.