Presentation is loading. Please wait.

Presentation is loading. Please wait.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Crowd Simulation Ilknur Kaynar – Kabul COMP 259 – Spring 2006.

Similar presentations


Presentation on theme: "The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Crowd Simulation Ilknur Kaynar – Kabul COMP 259 – Spring 2006."— Presentation transcript:

1 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Crowd Simulation Ilknur Kaynar – Kabul COMP 259 – Spring 2006

2 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Overview Motivation Simulating dynamic features of escape panic D. Helbing, I. Farkas, and T. Vicsek Hierarchical Model for Real Time Simulation of Virtual Human Crowds Soraia Raupp Musse, Daniel Thalmann Constrained Animation of Flocks Matt Anderson, Eric McDaniel and Stephen Chenney Scalable Behaviors for Crowd Simulation Mankyu Sung, Michael Gleicher and Stephen Chenney Summary

3 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Motivation Real worlds: crowds are ubiquitous Non-real time applications: (films, cut-scenes of games) crowds used more and more, usually to increase epic dimensions Real-time applications: (games, training simulations) crowds are still rare, most interactive worlds are “ghost towns”

4 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Applications Entertainment industry (animation production, computer games) Training of police & military (demonstrations, riots handling) Architecture (planning of buildings, towns, visualization) Safety science (evacuation of buildings, ships, airplanes) Sociology (crowd behavior) Physics (crowd dynamics)

5 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Approaches Common approaches ♦ Particle systems ♦ Agent based models ♦ Cellular automata ♦ Probability networks ♦ Social-force networks Exotic approaches ♦ Fractals ♦ Chaos model ♦ Flow and network models ♦ Perceptual control theory

6 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State of the Art (Movies)

7 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Simulating dynamic features of escape panic Dirk Helbing, Illes Farkas, and Tamas Vicsek Nature, 2000

8 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Contribution Proposes a model of pedestrian behaviour to investigate the mechanisms of panic and jamming by uncoordinated motion in crowds

9 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Characteristic features of escape panic People move or try to move considerable faster than normal Individuals start to pushing, and interactions become physical Moving becomes uncoordinated At exist, arching and clogging are observed Jams build up Pressure on walls and steel barriers increase Escape is further slowed by fallen or injured people acting as ‘obstacles’

10 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL The Problem & Solution Crowd stampedes can be deadly People act in uncoordinated and dangerous ways when panicking It is difficult to obtain real data on crowd panics Model people as self-driven particles Model physical and socio-psychological influences on people’s movement as forces Simulate crowd panics and see what happens

11 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Acceleration of Simulated People v i 0 (t) = desired speed e i 0 (t) = desired direction v i (t) = actual velocity τ i = characteristic time m i = mass

12 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Forces from Other People Force from other people’s bodies being in the way Force of friction preventing people from sliding Psychological “force” of tendency to avoid each other Sum of forces of person j on person i is f ij

13 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Total Force of Other People A i exp[(r ij – d ij )/B i ]n ij is psychological “force” A i and B i are constants psychological force sum of the people’s radiidistance between people`s centers of mass normalized vector from j to i

14 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Physical Forces g(x) is 0 if the people don’t touch and x if they do touch k and κ are constants force from other bodiesforce of sliding friction tangential directiontangential velocity difference

15 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Forces from Walls Forces from walls are calculated in basically the same way as forces from other people

16 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Values Used for Constants and Parameters Insufficient data on actual panic situations to analyze the algorithm quantitatively Values chosen to match flows of people through an opening under non-panic conditions

17 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Simulation of Clogging

18 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Simulation of Clogging As desired speed increases beyond 1.5m s -1, it takes more time for people to leave As desired speed increases, the outflow of people becomes irregular Arch shaped clogging occurs around the doorway

19 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Widening Can Create Crowding The danger can be minimized by avoiding bottlenecks in the construction of buildings However, that jamming can also occur at widenings of escape routes

20 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Mass Behavior Panicking people tend to exhibit either herding behavior or individual behavior, or try to mixture of both Herding simulated using “panic parameter” p i Individual directionAverage direction of neighbors

21 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Effects of Herding

22 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Effects of Herding Neither individuals nor herding behaviors performs well Pure individualistic behavior: each pedestrian finds an exit only accidentally Pure herding behavior: entire crowd will eventually move into the same and probably blocked direction

23 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Injured People Block Exit

24 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL A Column Can Increase Outflow

25 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Conclusion Bottlenecks cause clogging Asymmetrically placed columns around exits can reduce clogging and prevent build up of fatal pressures A mixture of herding and individual behavior is ideal

26 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Demos http://angel.elte.hu/panic/

27 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Future work Are parameters based on non- panic situations correct for panic situations? How can we get quantitative data about panic situations to test simulations? What happens when injured people are allowed to fall over (and possibly be trampled)?

28 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Hierarchical Model for Real Time Simulation of Virtual Human Crowds Soraia Raupp Musse, Daniel Thalmann IEEE Transactions on Visualization and Computer Graphics (2001)

29 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Overview Proposes a model to automatically generate human crowds based on groups, instead of individuals Presents three different ways of controlling crowd behaviors

30 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Contributions Multilevel hierarchy formed by crowd, groups and agents Various degrees of autonomy ♦ Scripted behaviors (programmed behavior) ♦ Interactive control (guided behavior) ♦ Rule based behaviors (reactive behaviors) Groups-based behaviors, where agents are simple structures and groups are more complex structure

31 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Terms Entities ♦ Virtual human agent: a humanoid whose behaviors are inspired by those of humans ♦ Group: Groups of agents ♦ Crowd: Set of groups Intentions: goals of the entities Knowledge: information of the virtual environment Belief: internal status of entities Events: incidence of something causing a specific reaction

32 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL ViCrowd A system address two main issues: ♦ Crowd behavior ♦ Crowd structure Based on flocking systems Includes a simple definition of behavioral rules using conditional events and reactions

33 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Control of behaviors

34 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Crowd Structure

35 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Crowd Information

36 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Knowledge Crowd obstacles ♦ All the objects and the areas that the crowd can walk Crowd motion and action ♦ Described using goals Interest points (IP) : crowd should pass Action points (AP) : crowd can go and perform an action ♦ IP and AP define the crowd paths ♦ Between two goals, different Bezier curves are created for each individual Group knowledge ♦ Processed by the leader of the group ♦ Contain location of other groups and their knowledge, belief and intentions

37 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Beliefs Crowd and Groups Behaviors ♦ Flocking Group ability to walk together in a structured group movement ♦ Following Group ability to follow a group or an individual motion ♦ Goal Changing In sociological effects, agents can change their groups and become a leader

38 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Beliefs Crowd and Groups Behaviors ♦ Attraction Groups of agents are attracted around an attraction point

39 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Beliefs Crowd and Groups Behaviors ♦ Repulsion Group ability to be repulsed from a specific location or region ♦ Split Subdivision of a group to generate one or more groups

40 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Beliefs Crowd and Groups Behaviors ♦ Space Adaptability Group ability to occupy all the walking space ♦ Safe-Wandering Evaluate and avoid collision contacts with agents and objects

41 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Beliefs Emotional Status ♦ Sad, calm, happy, regular, etc ♦ Way of walking, walking speed and range of basic actions Individual Beliefs ♦ In sociological effects, individuals has goal changing behavior and domination value

42 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Intentions Crowd knowledge is used to generate crowd intentions Based on crowd intentions, groups intentions are generated in a random way

43 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Inter-dependence between the levels of information

44 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Overview of Model

45 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Results & Demos

46 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Results & Demos SB : Scripted behavior GB: Guided behavior RB: Reactive behavior

47 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary Simulations are generated with various levels of realism including scripted, reactive and guided behavior Crowd is modeled using hierarchical structure which is based on groups, not individuals

48 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Constrained Animation of Flocks Matt Anderson, Eric McDaniel and Stephen Chenney Eurographics/SIGGRAPH Symposium on Computer Animation 2003

49 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Motivation In real applications, the animator usually wants to specify what happens in the scene!

50 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Contribution A method for imposing hard constraints on the paths of agents at specific times while retaining the global characteristics of an unconstrained flock

51 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Overview Two-step model for constrained animation ♦ Produce a trajectory that satisfies the constraints ♦ Evaluate plausibility and refine the trajectory

52 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Behavior model Animation should satisfy constraints and retain the underlying behavior model Behavior model ♦ Based on Reynolds’ model ♦ Incorporates a wander behavior rule ♦ Each character gets a randomly sampled wander impulse at each timestep.

53 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Behavior model The wander contribution added to the character is a combination of this wander impulse and the normalized wander contribution from the previous timestep. ŵc i-1 : previous wander contribution (normalized) wi i : current wander impulse wc i : total wander contribution for this timestep

54 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Behavior rules Separation Cohesion Alignment Collision avoidance Speed Target Wander

55 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Constraints Point constraints: a character must be at a point at a certain time Center-of-mass constraints: the center of mass of some group must be at a point at a certain time Shape constraints: a group must lie inside a polygonal shape

56 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Finding initial trajectories Find configurations that satisfy all the constraints, then interpolate trajectories in the “windows” between them

57 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Finding initial trajectories Possible methods (some or all of these may be used): ♦ Forward simulation ♦ Path transformation ♦ Backward simulation

58 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Finding initial trajectories Forward simulation ♦ Used when initial conditions are given for a window ♦ Position characters to meet initial conditions, then run an unconstrained simulation using the behavior model

59 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Finding Initial Trajectories Path Transformation ♦ Used when the window is part of a sequence of point or COM constraints ♦ Fit a B-spline curve through the sequence of points ♦ Run a forward simulation, and at each timestep, move the character onto the curve

60 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Finding Initial Trajectories Backward Simulation ♦ Used when end constraints are given for the window ♦ Position characters to meet end constraints, then run the simulation backwards (just reverse the birds’ perception)

61 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Finding Initial Trajectories Blend the resulting trajectory (x backward ) with the forward simulation (x forward ) using a weighting function:

62 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Evaluating plausibility of an animation g w : Determine whether the wander impulses are plausibly distributed g c, g s : Determine how well the animation satisfies the COM and shape constraints g f : Bias the animation toward producing a single flock

63 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Evaluating the wander impulses g w evaluates whether the wander impulses look like they were sampled from the right distribution In this model, the wander impulses had uniformly random direction and normally distributed length, so it is evaluated how well the lengths |wi i | fit a normal distribution:

64 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Evaluating constraint enforcement Center of mass constraints: ♦ COM(A, t) is the center of mass of the group at time t ♦ C x is the center of mass defined in the constraint Shape constraints: ♦ c s is a user-defined constant ♦ dist(S, A, t) calculates the sum-of-squares distance of each character from the shape

65 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Generating a better animation If the current animation fails the plausibility test, the system generates a new one using one of the following strategies: Completely re-generate some or all of the trajectories Add random “bumps” to a trajectory Change the character’s velocity along a trajectory

66 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Generating a better animation Repeat the sampling process for a given number of iterations, or until a plausible animation is found. This animation was generated in 1000 iterations (about two hours)

67 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Examples

68 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Demos Constrained Flocking

69 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary The agents in the simulations meet exact constraints at specific times The simulations retain the global properties present in unconstrained motion

70 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Scalable Behaviors for Crowd Simulation Mankyu Sung, Michael Gleicher and Stephen Chenney Computer Graphics Forum (2004) (Eurographics '04) Some of the slides are taken from http://www.cs.wisc.edu/graphics/Gallery/Crowds/

71 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL The Goal: Scalable Crowd Simulation Large Crowds ♦ Scalable performance Large Complex Environments ♦ Scalable Authoring Rich, Complex Behaviors ♦ Scalable Behaviors

72 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Conflicting Goals Large, Complex World Rich Behaviors But… Fast performance (simple agents) Reasonable authoring

73 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL An Environment Example: Model of Street Simulation: Real time, Reactive Rendering: Unreal Game Engine for playback

74 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Scalability: Complex Environments Store Window In front of Store Window Friends Together Doorway In front of Doorway In a hurry In Crosswalk Use crosswalk Sidewalk Street Bench

75 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Observation: Behavior Depends on Situation Store Window In front of Store Window Possibly: stop to window shop Friends Together: Possibly: Stop to talk Probably: Have same goal Doorway In front of Doorway Possibly: open door, enter Unlikely: stand blocking door In a hurry: Check for traffic Run across street In Crosswalk: Walk across street once you’ve started Use crosswalk: Wait for green light Start crossing Sidewalk: Walk here Street: Generally, Don’t walk here

76 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Managing Environmental Complexity: Situation-Based Approach Many different situations Each has a different set of local behaviors An agent only needs a few at a time Blend situations/behaviors together Store Window In front of Store Window Possibly: stop to window shop Friends Together: Possibly: Stop to talk Probably: Have same goal Doorway In front of Doorway Possibly: open door, enter Unlikely: stand blocking door Use crosswalk: Wait for green light Start crossing Sidewalk: Walk here

77 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Observation: Crowds are Crowds Individuals are anonymous ♦ Doesn’t matter what any one does ♦ At any given time, do something reasonable ♦ Aggregate behavior  Stochastic Control  Short term view of agent An Individual

78 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Key Ideas Situation-Based Approach ♦ Breaks behavior into small pieces ♦ Extensible agents kept simple Situation Composition ♦ Probabilistic scheme to compose behaviors Painting Interface ♦ Place behaviors in world, not agents Use Motion-Graph-based runtime ♦ Based on Gleicher et al 2003

79 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Situation-Based Approach: Agent Architecture Agents: ♦ Discrete set of actions (from mograph) ♦ Randomly choose from distribution ♦ Behavior functions provide distributions All aspects of agents can be updated dynamically

80 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Situation-Based Approach: Simple Default Agents Default agents very simple ♦ Wander, don’t bump into things, … Extend agents as necessary to achieve complex behaviors

81 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Situation-Based Approach: Extensible Agent Situations extend agents ♦ Add Actions ♦ Add Behavior Functions ♦ Add Sensors and Rules that inform Behavior Functions

82 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Example Default agent can ’ t cross the street. How an agent crosses the street… ♦ Enters a Crosswalk Situation ♦ Crosswalk situation extends agent Sensor to see traffic light Behavior Functions to cross street Behavior Functions to stop Rules to wait for light to change ♦ Remove extensions when done

83 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Composing Behaviors: Action Selection Agent Left Right Straight ?

84 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Composing Behaviors: Probability Scheme Behavior Function A Agent Left Right Straight.5.3.2

85 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Composing Behaviors: Probability Scheme Behavior Function A Agent Left Right Straight.5.3.2 Behavior Function B.1.2.4.25.33

86 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Composing Behaviors: Extending Agents Agent Left Right Straight Behav Func A.5.3.2 Jump Behav Func B.1.2 Behav Func J.5.2.41.24.33.03

87 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Composing Behaviors: Probability Scheme Simple example ♦ Three rooms with different set of composing behaviors.

88 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Situations Compose Agent can be in multiple situations Agent has union of all the things that different situations put in

89 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Authoring: Painting interface Author environments (not characters) Set of situation types Paint into environments Mix situations to make complex/compound ones Ulicny et al (SCA 2004) ♦ Painting on people, not environment

90 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Advantages Scalability / Efficiency ♦ Agent complexity is independent of overall world complexity ♦ Agent only carries information for current situations Authorability ♦ Re-use situations ♦ Compose / combine / paint Stochastic control ♦ variability

91 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Demos

92 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Limitations/Future work Behavior depends on available actions ♦ All behaviors are concatenation of actions Time scale issues / long term behaviors Hierarchical / Ordered Situation Discrete Choices ♦ Parameterized actions? Aggregate Control (e.g. Density) ♦ Probability Tuning?

93 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary: Scalable Crowd Simulation Situation-Based Approach ♦ Simple Extensible Agents ♦ Localized behaviors ♦ Behavior decomposed in situations Situation Composition ♦ Probability distributions

94 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Performance evaluation

95 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Performance evaluation

96 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary “Simulating dynamic features of escape panic” ♦ The model is based on plausible interactions ♦ It is robust with respect to parameter variations ♦ It accounts for the different dynamics in normal and panic situations ♦ It can be used to test buildings for their suitability in emergency situations

97 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary “Hierarchical Model for Real Time Simulation of Virtual Human Crowds” ♦ Presents 3 different ways to control crowd behaviors By using innate and scripted behaviors By defining behavioral rules, using events and reactions By providing an external control to guide crowd behaviors in real time ♦ Presents a hierarchical structure based on groups to compose a crowd

98 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary “Constrained Animation of Flocks” ♦ Presents a new technique for the generation of constrained group animations that improves on existing approaches: The agents meet exact constraints at specific times The simulation retains the global properties in unconstrained motion

99 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary “Scalable behaviors for crowd simulation” ♦ Presents an approach to controlling the behavior of agents in a crowd ♦ Complex crowds can be created without increasing complexity ♦ Character motion produced by the system is visually convincing

100 The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Summary Crowd simulation in real time is still a problem Selection of crowd behaviors can be achieved in many ways, e.g. hierarchical approaches Solutions are based on the applications


Download ppt "The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Crowd Simulation Ilknur Kaynar – Kabul COMP 259 – Spring 2006."

Similar presentations


Ads by Google