Using Cyclic Scheduling to Generate Believable Behavior in Games
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the Tenth Annual AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment (AIIDE 2014) Using Cyclic Scheduling to Generate Believable Behavior in Games Richard Zhao and Duane Szafron Department of Computing Science, University of Alberta, Edmonton, AB, Canada T6G 2E8 {rxzhao, dszafron} @ualberta.ca Abstract extensive scripting. However, these same games have Video game virtual characters should interact with the secondary characters and extras that lack believability and player, each other, and the environment. However, the cost simply exist to fill up the game world. of scripting complex behaviors becomes a bottleneck in Three key changes are necessary to address this content creation. Our goal is to help game designers to more problem. First, the behaviors must be more believable as easily populate their open world with background characters that exhibit more believable behaviors. We use a cyclic measured by game players. Second, the behaviors must be scheduling model that generates dynamic schedules for the reliable so that they work as designed. Third, designer daily lives of virtual characters. The scheduler employs a efficiency must be increased to reduce production costs. tiered behavior architecture where behavior components are This paper extends our work on a tiered behavior modular and reusable. This research validates the designer architecture model (Zhao and Szafron 2014) which usability of an implementation of this model. We present the results of a user study that evaluates the scheduling system attempts to alleviate the content creation bottleneck for versus manual scripting based on three metrics of behavior cyclic behaviors. Our architecture employs a cyclic creation: behavior completeness, behavior correctness and scheduling algorithm, which determines the general behavior implementation time. The results indicate that the objectives of the virtual characters and specifies the roles behavior architecture produces more reliable behaviors and that will satisfy these objectives dynamically at game time. improves designer efficiency which will reduce the cost of generating more believable character behaviors. We validated the believability of the generated behaviors against a recent commercial game with a user study (Zhao and Szafron 2014). Introduction The research in this paper further evaluates the design and implementation of this tiered architecture for cyclic Video game worlds contain many virtual characters that behaviors by addressing the behavior reliability and are Non-Player Characters (NPCs). As virtual worlds designer efficiency issues. It presents the results of a become larger and more realistic-looking, the importance second user study that compares the behaviors generated of socially believable virtual characters also grows. These by an implementation of our architecture with behaviors characters should interact with the player, each other, and created by manual scripting. It uses three metrics: behavior the environment. In recent years, the behavior AI of virtual completeness, behavior correctness, and behavior characters has not developed as quickly as other aspect of completion time. These metrics are indicators of behavior video games, such as graphics. Complex behaviors can be reliability and designer efficiency, key elements in created manually, but the creation time makes the cost reducing the cost of generating more believable behaviors, prohibitive for background characters at a large scale. thus adding more depth to the characters. Scripting costs are an important contributing factor to a In addition, as noted by Li et al. (2014), having major bottleneck in content creation, leading to a plethora autonomous agents with their own back stories has benefits of games with very simplistic behaviors for almost all outside of the video game environment, as they increase virtual characters outside the main plot line. AAA titles user engagement and can be applied to other non-gaming such as Dragon Age II (BioWare 2011), Mass Effect 3 situations. (BioWare 2012) and The Elder Scrolls V: Skyrim (Bethesda 2011) have several main characters whose behaviors are quite believable in some instances, due to Related Work Copyright © 2014, Association for the Advancement of Artificial Researchers have explored many ways to control the Intelligence (www.aaai.org). All rights reserved. behaviors of virtual characters. At the highest level, 94 research has been done on providing complex interactive incomplete knowledge of the environment, and the player narrative experiences for players (Riedl and Bulitko 2013). must help the character succeed. Kelly et al. (2008) used Although this is the ultimate goal, to achieve success it is offline planning with Hierarchical Task Networks to also necessary to improve the behaviors of individual generate behaviors. We share their goal of shifting the characters who contribute to the narrative. One approach is workload offline, but we embed scheduling in a broader to directly control all characters via manually written architecture that supports dynamic online assignment of programming code. Specialized programming languages, low-level behaviors (roles) to the root nodes (objectives) of such as ABL, have been proposed to help with designing the scheduler. They also indicated that the generated believable agents (Mateas and Stern 2002) and they scripts require human effort to “compose and debug.” The certainly have been demonstrated to improve the resulting behavior scripts we produce require no human characters. Gomes and Jhala (2013) have demonstrated the intervention. In addition, our implementation provides a use of ABL in the believability of NPC social conflict graphical user interface with different constraint types that resolution. However, even with such better scripting our user study has shown to be efficient and reliable. languages the production costs are high. Our goal is to In the scheduling domain, the interval scheduling evaluate the alternative of eliminating manual scripting in maximization problem is one of the oldest problems, where favor of automatic script generation. the goal is to schedule a largest set of non-overlapping Other alternatives to scripting exist. Finite State intervals. A greedy polynomial time algorithm exists as the Machines (FSMs) have been used in commercial games for solution (Kleinberg and Tardos 2005). The scheduling many years. However, with increasingly complex game problem presented in this paper does not aim to find an environments, FSMs do not scale well and get harder to optimal solution. It determines whether a solution is maintain (Schwab 2009). Hierarchical FSMs and Behavior possible that fits all requirements, and if possible, it finds a Trees were introduced to address this problem (Isla 2005) family of solutions. Instead of intervals of fixed start and with the game Halo. Further improvements include Data- end times, it has blocks of fixed lengths with variable start Oriented Behavior Trees and Event-Driven Behavior Trees and end times to better match requirements for scheduling (Champandard 2012). More recently, learning Behavior believable cyclic behaviors of virtual game characters. Trees have been proposed, which adapt Behavior Trees Bakkes et al. (2012) described player behavioral with known player traces and modifiers (Tomai and Flores modeling strategies, and argued that circumstance-based 2014). Layered Statechart-based AI by Dragert et al. abstractions of player models are needed. The level of (2012) stresses modularity and reusability as key features details concept is used in this paper, even though this paper to successful AI techniques. As we will see, at the lowest focuses on the behaviors of background NPCs exclusively. level of our proposed architecture, any of these techniques Graphical drag-and-drop interfaces and pattern-based can be used to fulfill the modular role behaviors. approach to scripting have been explored by many. In the However, at a high level, behavior specification can be academic environment, CMU’s Alice (Pausch et al. 1995), viewed as a planning exercise since the designer should be MIT’s Scratch (Resnick et al. 2009), and University of able to generate behaviors from a set of constraints. For Alberta’s ScriptEase (Schenk et al. 2013) are but a few example, in the scheduling domain for daily behaviors, examples. Becroft et al. (2011) described a graphical tool specifying a behavior for each hour or even for a specific to create and edit Behavior Trees. These tools are all aimed period of time can be burdensome to a designer who only at story designers and those who are learning to program. wants to specify the total time allocated for each behavior. Some commercial game engines have employed visual Rather than using transitions (FSMs, Decision Trees or interfaces as well, such as the Blueprints visual scripting Behavior Trees) for each hour (or period of time), the system of the Unreal Engine (Epic Games 2014), formerly designer should be able to specify more general known as Kismet. While these tools are able to provide constraints. Nevertheless, we would welcome user studies event-based scripting capabilities, they are general purpose that evaluate the believability and reliability of generated tools which are not specialized in generating believable behaviors and designer efficiency for complex cyclic behaviors for virtual characters. It would be difficult to behaviors using FSMs, Decision Trees or Behavior Trees. implement a cyclic