Modelling Player Understanding of Non-Player Character Paths
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the Fourteenth Artificial Intelligence and Interactive Digital Entertainment Conference (AIIDE 2018) Modelling Player Understanding of Non-Player Character Paths Mengxi Xoey Zhang, Clark Verbrugge McGill University Montreal,´ Canada [email protected], [email protected] Abstract enable an exploration tool to better understand and experi- ment with what information becomes available to a player, Modelling a player’s understanding of NPC movements can given specific NPC routes, level geometry, and incomplete be useful for adapting gameplay to different play styles. For observation. We thus define a baseline system that allows stealth games, what a player knows or suspects of enemy movements is important to how they will navigate towards for exhaustive modelling of possible NPC positions, con- a solution. In this work, we build a uniform abstraction of strained by the gap-time and filtered by knowledge of level potential player path knowledge based on their partial obser- geometry. Players may also attribute movement character- vations. We use this representation to compute different path istics or make assumptions about NPC behaviours as well. estimates according to different player expectations. We aug- Our design naturally incorporates different constraint mod- ment our work with a user study that validates what kinds of els that reduce pathing possibilities to better represent player NPC behaviour a player may expect, and develop a tool that expectation. can build and explore appropriate (expected) paths. We find Algorithmic and representational design is supported by that players prefer short simple paths over long or complex a non-trivial experimentation and visualization tool built paths with looping or backtracking behaviour. into Unity R . This allows for flexible exploration of differ- ent, constrained models of player expectation given differ- Introduction ent segments of NPC observation. The choice of path con- straints we offer is further justified by data gathered from a The difficulty of a stealth or combat game is strongly af- small user study. fected by player knowledge of enemy movements. Previous Our work is intended to facilitate design exploration of playthroughs, outside knowledge, as well as general gam- NPC movements and geometry, and to provide a tool for ing experience allow players to make increasingly strong further understanding of how gameplay may be learned and assumptions about non-player character (NPC) behaviours, optimized through repeated player experience. Specific con- and thus better predict or identify safer or more strategic tributions of this work include the following: movement options in game levels. Modelling player as- sumptions and expectations of NPC movements provides an • We construct a generic model of player path observations insightful mechanism for understanding how players may which accommodates a variety of possible observation attempt to solve a level, particularly over repeated play. It sources and expectation constraints. also offers potential for adapting game difficulty by dynamic • We provide an algorithm for computing an exhaustive rep- modifications that either conform to or violate expectation. resentation of possible movements, as well as extensions In this work we describe an algorithmic approach to esti- that either work through our formal representation or in- mating and representing player knowledge of NPC move- corporate simple constraints to reduce the set of possible ments. We base our design on a uniform representation behaviours according to different models of player expec- of partial observations, applying algorithmic and heuristic tation. techniques to build different estimations of position and ex- • Our approach is implemented and demonstrated in a non- pected movement. We do not aim at open, unbounded pre- trivial tool within the open-source Unity R framework. diction; rather, our focus is on how players may fill the gap This allows for flexible visualization and exploration of between two observations, reflecting the use of prior, partial expected movement under different constraints. knowledge that provides consistent, but not identical infor- • Our design approach is supported by a small-scale user mation, as may be acquired from repeated playthroughs. study that shows players generally expect NPC to follow The full extent of individual player knowledge is of course simple, non-looping paths with minimal backtracking. beyond what can be acquired from simple game logging. Our approach is aimed at building the core techniques that Background and Related Work Copyright c 2018, Association for the Advancement of Artificial Stealth is one of many genres of video games that calls for Intelligence (www.aaai.org). All rights reserved. players to develop and employ strategies to avoid dynamic, 257 patrolling or static enemy agents. This style of video game universal, descriptive reaction model, interpreted, although typically requires the player to hide from the non-player en- also grounded in user data. emies in order to successfully achieve a goal. Path prediction and reconstruction can also be applied to In such games NPCs frequently behave in a predeter- real-life situations beyond video games. This includes di- mined and predictable way. This presents a puzzle context, verse contexts, such as security monitoring, using a dynamic where (among other gameplay mechanisms) the player uses oriented graph to identify moving objects and help pre- current in-game and previous observations to predict future dict abnormal behaviour (Duque, Santos, and Cortez 2007), NPC movements in order to help evade enemies or hide from as well as in observing individual animal behaviour, us- them. This knowledge may come from current, in-game ob- ing state–space modelling to study animal movement, bio- servations, observations made in previous playthroughs, as geography and spatial population dynamics (Patterson et al. well as from external resources and general player experi- 2008). ence in other, similar games. Accumulation of this knowl- edge is essential to the strategic decisions made in solving a Representing Movement Knowledge stealth level. Existing research in path modelling is primarily focused Knowledge of enemy positions and movements can be ac- on understanding and predicting player motion in order to quired from various sources. Wikis and strategy guides may control NPC behaviour. This is useful for designing agents give locations and routes (with widely varying levels of de- that can interact with users creatively (Singh et al. 2016), tail), 3rd party game videos provide partial sources, previous apply basic strategy to intercept enemies (Tastan, Chang, attempts by the player can provide multiple sets of observa- and Sukthankar 2012), attempt to appear “human-like” in tions, and even single-game observations of cyclic behaviour understanding how and where a player may move (Hladky can give multiple data points on the same route. and Bulitko 2008), and (going outside of games) as a means Representing and combining this information introduces of estimating pedestrian behaviour (Yin et al. 2016). Mod- an initial challenge. Our approach is to use a uniform model els of human motion are often based on learning AI sys- that reduces knowledge of path behaviour to a series of spe- tems, but may also incorporate other approaches, such as use cific, ordered and time-stamped observations, no matter the of particle systems for estimating occluded position (We- source. We assume (repeated, deterministic) enemy move- ber, Mateas, and Jhala 2011), and steering systems (Tas- ment is partially captured by segments of prior observation. tan and Sukthankar 2011) for physically motivated move- This allows us to structure player expectation in relation to ment constraints. Further, heuristic constraints can be de- their knowledge as a process of filling in the (unknown) gaps rived based on looking for similarities in observed move- between (known) segments, for which we can use different ment pattern (Aparicio, IV and Caban 2009), as well as algorithmic solutions. Search for more constrained solutions gameplay-specific properties, such as a quantified notion of within this space is then bounded, and the same formalism the “danger” or “risk” inherent to, and thus affecting differ- also lets us easily incorporate a variety of constraints that ent path choices (Tremblay, Torres, and Verbrugge 2014). may heuristically limit the scope of expectation. Modelling the “opposite” perspective, that is what a In this section we formalize our basic representation, player expects of NPC movement, is less common, although building a model that incorporates both knowledge and its possible with generic planning systems that do not make as- absence. The section following then shows how expectation sumptions about human or AI agency (Geib et al. 2016). can be computed, and limited by adding assumed observa- Particle approaches and other techniques that generate prob- tions and imposing search constraints. abilistic occupancy maps can also be used for making po- sition estimates. The stealth game Third Eye Crime (Isla Segment and Path Abstraction 2013), for example, is well known for incorporating posi- Our game domain Σ is a discrete two-dimensional grid, ex- tive and negative knowledge from an AI’s perceptual sys- tended into a continuous, positive time dimension: Σ ⊆ tem (Isla and Blumberg 2002) into the gameplay, although N2 × R+. NPCs follow polygonal, obstacle-avoiding routes again