Using Global Objectives to Control Behaviors in Crowds
Total Page:16
File Type:pdf, Size:1020Kb
USING GLOBAL OBJECTIVES TO CONTROL BEHAVIORS IN CROWDS A Thesis Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University By Domin Lee, B.S. ***** The Ohio State University 2008 Master’s Examination Committee: Approved by Dr. Rick Parent, Adviser Dr. Matthew Lewis Adviser Graduate Program in Computer Science and Engineering c Copyright by Domin Lee 2008 ABSTRACT The agent-based and behavioral modeling techniques are effective in many situa- tions; however, with an increase in demand for more complex and realistic behaviors, the problems of scale can quickly become an issue. By adding another set of rules that incorporate the desired behaviors, the rule-based methods can become difficult to manage. This thesis attempts to develop an organizational tool that avoids rule pro- liferation and problems with scale in rule-based systems. Using global objectives to weigh local rules, we look to model a system where behavioral decisions are made, not just at the individual levels, but also at the global levels in the crowds. Consequently, this thesis presents a solution for one requirement of team-oriented crowd behaviors in animation and games: the ability to adaptively generate human-like altruistic be- haviors. The team-oriented crowds refers to a type of crowds where each individual has a membership to a team. And those individuals interact directly and simultane- ously to achieve a global objective. Some of the team-oriented crowds include team sports: football, handball, hockey, basketball, and baseball. ”Altruistic behaviors” are the behaviors where behavioral decisions are made for the global objectives of the crowds. I.e., instead of doing what’s best for each individual, it’s doing what’s best for the crowds. We generate these ”altruistic behaviors” in the team-oriented crowds by applying rules that are weighted appropriately. ii To Doyoun. iii VITA January 17, 1976 . Born - Seoul, Korea 2000 . .B.S. Computer Engineering, HanYang University 2003-2004 . Graduate Teaching Associate, The Ohio State University 2005-2006 . Graduate Administrative Associate, The Ohio State University 2006 . .FX Technical Director / Motion Cap- ture Studio Lab Assistant, The Ohio State University 2007 . .Simulation Technical Intern, Pixar Animation Studios 2007 . .Effects Artist, PDI/Dreamworks SKG 2008 - present . Effects Artist, Dreamworks Animation Studio FIELDS OF STUDY Major Field: Computer Science and Engineering iv TABLE OF CONTENTS Page Abstract . ii Dedication . iii Vita . iv List of Tables . vii List of Figures . viii Chapters: 1. Introduction . 1 1.1 Problem Statement . 3 1.2 Techniques . 4 1.3 Overview . 6 2. Background . 7 2.1 Crowd Modeling and Animation . 7 2.1.1 Behavioral Modeling . 8 2.1.2 Agent-based Approach . 8 2.1.3 Crowd Simulation in Movies and Games . 10 2.1.4 Sports Simulation . 12 2.1.5 Pathfinding Algorithms . 14 3. Using Global Objectives to Control Behaviors in Crowds . 15 3.1 Agent-based Approach for Team-oriented Crowds . 16 3.2 Team-oriented Crowds . 18 v 3.3 Structure of Crowd System . 19 3.4 Behavior Generation . 21 4. Setting up a System for Football Kickoff Simulation . 33 4.1 Initial Phase of the Simulation . 33 4.2 Model . 35 4.3 Field Setup . 36 4.4 Basic Behaviors . 36 4.5 Basic Blocking Routines . 39 5. Modifying Individual Behaviors Based on Global Objectives . 41 5.1 General Group Behaviors . 41 5.2 Blocking Assignments and Pathfinding . 42 5.3 Blocking Assignments . 43 5.3.1 Determining Opponents . 44 5.4 Pathfinding . 45 5.4.1 Field of View . 46 5.4.2 Heuristic Function and Distance Metric . 47 6. Assessment . 52 6.1 Agent-based Behavioral System . 53 6.2 Blocking Assignments and Pathfinding . 54 6.2.1 Different global objectives . 55 7. Conclusion . 59 7.1 Summary . 59 7.2 Future Work . 60 Bibliography . 62 vi LIST OF TABLES Table Page 2.1 Examples of behavioral animation in movies and games . 9 r 3.1 Possible state variables for the current perceivable environment et . These variables can be retrieved by the agents to decide about their behaviors. These variables are used in computing the distance metric. 26 3.2 Weights used by our distance metric to give more importance to dif- ferent state variables. The weights can be altered depending on the applications. 31 4.1 Varying attributes make the simulation more realistic . 34 r 5.1 State variables for the perceivable environment, et . These variables can be retrieved by the kick returner to decide on its behaviors. These variables are used to compute the distance metric. 47 vii LIST OF FIGURES Figure Page 1.1 Agent-based system that uses global objectives to control behaviors in team-oriented crowds . 5 2.1 Computer graphics cognitive modeling hierarchy as proposed by Funge et al. .................................... 10 2.2 As the required behaviors increase, ”Brain” in Massive software can rapidly become very complicated and unmanageable. 11 2.3 Condition based A.I. 12 2.4 SpirOps crowd system was used as a crowd tool and A.I. middleware in ”Splinter Cell - Double Agent” game . 13 3.1 Crowd simulation using an agent-based system that integrates percep- tual and behavioral components for individual and group behaviors. The arrow between the pre-process and real-time process indicates that all the information assigned in the pre-process phase is conveyed to the actual simulation in which the dynamic behaviors are computed for each agent. 20 3.2 A high-level description of the system in terms of its properties. Au- tonomous agents with current states, s1...n, are used in the simulation. After the current environment is registered with each agent, different behaviors are assigned based on a heuristic function computed by a distance metric. Following this, the states are updated based on the behavior assignments. 22 viii 3.3 (a) Average 140-degree binocular vision. (b) Altered vision to simulate the binocular vision of a football player whose vision is impeded by a helmet. The red rectangles are objects that are ”seen”, and the light blue rectangles are objects that are not. (c) An agent can rotate to perceive its environment, and r denotes each region that the agent can see...................................... 25 r 3.4 The distance metric, D(eoptm, et , og), is computed between the opti- r mum environment, eoptm, and the perceived environments, et , during the simulation using the state variables and the global objectives at time t. The heuristic function examines the distances to determine the subsequent behaviors for an agent using a threshold, τ. The grey area represents the environments at a certain time (t) during the simula- tions. ................................... 30 4.1 During the initial phase of the crowd simulation, individual and group behaviors are assigned along with various attributes. 34 4.2 (a) Setup in Maya where a particle is instanced by a primitive box; (b) A low-resolution model; and (c) a high-resolution model . 35 4.3 Initial setup for the kickoff in football. 10 defenders, Wedge group of 5 players, 5 blockers, and a kick returner . 37 4.4 (a) Illustration of a player calculating a direction based on the accel- eration vector of the opposition. (b) Application of impulses at the initial contact. (c) Generation of impulses so that the player can stay in front of its opponent. 39 5.1 (a) Return to right. (b) The blockers and the defenders engage in blocking. (c) The blockers set up a path to the right by shielding the defenders to the left. 42 5.2 The global objectives are initially assigned. (a) There are three paths that can be assigned. (b) If the middle path is assigned, the blockers try to open up a running lane in the middle. (c) If the path is to the right, the blockers set up a path to the right. (d) The path to the left is given. 43 5.3 High-level states of the blocking assignments. The solid black arrows indicate the transition event used to move between each state. 44 ix 5.4 The greedy algorithm is used in the blocking assignments. (a) Initial state where the circles indicate that the blocking assignments have not been made. (b) Two blocking assignments are made wherein each select the closest opponent. (c) The blocking assignments change in realtime as they adapt to the changing environment. 45 5.5 (a) Average 140-degree binocular vision. (b) Altered vision to simulate the binocular vision of a football player whose vision is impeded by a helmet. The red rectangles are objects that are ”seen,” while the light blue rectangles are objects that are not. (c) A player can rotate to perceive his environment, and r denotes each region that can be seen by the player. 46 r 5.6 The distance metric, D(eoptm, et , og), between the optimum environ- r ment, eoptm, and the perceived environments, et , is computed during the simulation using the state variables and the global objectives at time t. The heuristic function examines the distances to determine the subsequent behaviors for the kick returner using a threshold, τ . The grey area represents the environments at a certain time (t) during the simulation. 50 5.7 Our system partitions the initial environment into regions. Once the heuristic function determines that one of the regions has the optimal path, the region is then divided into three new subregions. Our system allows up to three levels of partitions. 51 5.8 (a) Initial state where the yellow region represents the vision of the kick returner. (b) A running lane through the middle is chosen. (c) Since the middle region is occupied by both the defenders and blockers, so the right running lane is chosen.