Title: Crowd Simulation
1Crowd Simulation
- Ilknur Kaynar Kabul
- COMP 259 Spring 2006
2Overview
- 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
3Motivation
- 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
4Applications
- 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)
5Approaches
- 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
6State of the Art (Movies)
7Simulating dynamic features of escape panic
- Dirk Helbing, Illes Farkas, and Tamas Vicsek
- Nature, 2000
8Contribution
- Proposes a model of pedestrian behaviour to
investigate the mechanisms of panic and jamming
by uncoordinated motion in crowds
9Characteristic 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
10The 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
peoples movement as forces Simulate crowd panics
and see what happens
11Acceleration of Simulated People
- vi0(t) desired speed
- ei0(t) desired direction
- vi(t) actual velocity
- ti characteristic time
- mi mass
12Forces from Other People
- Force from other peoples 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 fij
13Total Force of Other People
sum of the peoples radii
distance between peoples centers of mass
normalized vector from j to i
psychological force
- Aiexp(rij dij)/Binij is psychological force
- Ai and Bi are constants
14Physical Forces
tangential direction
tangential velocity difference
force from other bodies
force of sliding friction
- g(x) is 0 if the people dont touch and x if they
do touch - k and ? are constants
15Forces from Walls
- Forces from walls are calculated in basically the
same way as forces from other people
16Values 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
17Simulation of Clogging
18Simulation 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
19Widening 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
20Mass Behavior
- Panicking people tend to exhibit either herding
behavior or individual behavior, or try to
mixture of both - Herding simulated using panic parameter pi
Individual direction
Average direction of neighbors
21Effects of Herding
22Effects 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
23Injured People Block Exit
24A Column Can Increase Outflow
25Conclusion
- 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
26Demos
- http//angel.elte.hu/panic/
27Future 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)?
28Hierarchical Model for Real Time Simulation of
Virtual Human Crowds
- Soraia Raupp Musse, Daniel Thalmann
- IEEE Transactions on Visualization and Computer
Graphics (2001)
29Overview
- Proposes a model to automatically generate human
crowds based on groups, instead of individuals - Presents three different ways of controlling
crowd behaviors
30Contributions
- 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
31Terms
- 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
32ViCrowd
- 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
33Control of behaviors
34Crowd Structure
35Crowd Information
36Knowledge
- 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
37Beliefs
- 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
38Beliefs
- Crowd and Groups Behaviors
- Attraction
- Groups of agents are attracted around an
attraction point
39Beliefs
- 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
40Beliefs
- 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
41Beliefs
- 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
42Intentions
- Crowd knowledge is used to generate crowd
intentions - Based on crowd intentions, groups intentions are
generated in a random way
43Inter-dependence between the levels of information
44Overview of Model
45Results Demos
46Results Demos
SB Scripted behavior GB Guided behavior RB
Reactive behavior
47Summary
- 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
48Constrained Animation of Flocks
- Matt Anderson, Eric McDaniel and Stephen Chenney
Eurographics/SIGGRAPH Symposium on Computer
Animation 2003
49Motivation
- In real applications, the animator usually wants
to specify what happens in the scene!
50Contribution
- A method for imposing hard constraints on the
paths of agents at specific times while retaining
the global characteristics of an unconstrained
flock
51Overview
- Two-step model for constrained animation
- Produce a trajectory that satisfies the
constraints - Evaluate plausibility and refine the trajectory
52Behavior 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.
53Behavior model
- The wander contribution added to the character is
a combination of this wander impulse and the
normalized wander contribution from the previous
timestep.
wci-1 previous wander contribution (normalized)
wii current wander impulse wci total wander
contribution for this timestep
54Behavior rules
- Separation
- Cohesion
- Alignment
- Collision avoidance
- Speed Target
- Wander
55Constraints
- 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
56Finding initial trajectories
- Find configurations that satisfy all the
constraints, then interpolate trajectories in the
windows between them
57Finding initial trajectories
- Possible methods (some or all of these may be
used) - Forward simulation
- Path transformation
- Backward simulation
58Finding 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
59Finding 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
60Finding 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)
61Finding Initial Trajectories
- Blend the resulting trajectory (xbackward) with
the forward simulation (xforward) using a
weighting function
62Evaluating plausibility of an animation
- gw Determine whether the wander impulses are
plausibly distributed - gc, gs Determine how well the animation
satisfies the COM and shape constraints - gf Bias the animation toward producing a single
flock
63Evaluating the wander impulses
- gw 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 wii fit
a normal distribution
64Evaluating constraint enforcement
- Center of mass constraints
- COM(A, t) is the center of mass of the group at
time t - Cx is the center of mass defined in the
constraint - Shape constraints
- cs is a user-defined constant
- dist(S, A, t) calculates the sum-of-squares
distance of each character from the shape
65Generating a better animation
- If the current animation fails the plausibility
test, the system generates a new one using one of
the following strategies
Change the characters velocity along a
trajectory
Add random bumps to a trajectory
Completely re-generate some or all of the
trajectories
66Generating 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)
67Examples
68Demos
69Summary
- The agents in the simulations meet exact
constraints at specific times - The simulations retain the global properties
present in unconstrained motion
70 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/
71The GoalScalable Crowd Simulation
- Large Crowds
- Scalable performance
- Large Complex Environments
- Scalable Authoring
- Rich, Complex Behaviors
- Scalable Behaviors
72Conflicting Goals
- Large, Complex World
- Rich Behaviors
- But
- Fast performance (simple agents)
- Reasonable authoring
73An Environment
Example Model of Street Simulation Real time,
Reactive Rendering Unreal Game Engine for
playback
74ScalabilityComplex Environments
Store Window
Doorway
In front of Store Window
In front of Doorway
Sidewalk
Friends Together
Use crosswalk
Bench
In Crosswalk
Street
75ObservationBehavior Depends on Situation
Store Window
Doorway
In front of Store Window Possibly stop to
window shop
In front of Doorway Possibly open door,
enter Unlikely stand blocking door
Friends Together Possibly Stop to
talk Probably Have same goal
Sidewalk Walk here
Use crosswalk Wait for green light Start crossing
In Crosswalk Walk across street once youve
started
Street Generally, Dont walk here
76Managing Environmental ComplexitySituation-Based
Approach
Store Window
Doorway
In front of Store Window Possibly stop to
window shop
In front of Doorway Possibly open door,
enter Unlikely stand blocking door
Friends Together Possibly Stop to
talk Probably Have same goal
Sidewalk Walk here
Use crosswalk Wait for green light Start crossing
- Many different situations
- Each has a different set of local behaviors
- An agent only needs a few at a time
- Blend situations/behaviors together
77ObservationCrowds are Crowds
- Individuals are anonymous
- Doesnt matter what any one does
- At any given time, do something reasonable
- Aggregate behavior
- ? Stochastic Control
- ? Short term view of agent
An Individual
78Key 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
79Situation-Based ApproachAgent Architecture
- Agents
- Discrete set of actions (from mograph)
- Randomly choose from distribution
- Behavior functions provide distributions
- All aspects of agents can be updated dynamically
80Situation-Based ApproachSimple Default Agents
- Default agents very simple
- Wander, dont bump into things,
- Extend agents as necessary to achieve complex
behaviors
81Situation-Based ApproachExtensible Agent
- Situations extend agents
- Add Actions
- Add Behavior Functions
- Add Sensors and Rules that inform Behavior
Functions
82Example
- Default agent cant 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
83Composing BehaviorsAction Selection
Left
?
Agent
Right
Straight
84Composing BehaviorsProbability Scheme
Behavior Function A
Left
.5
Agent
Right
.3
Straight
.2
85Composing BehaviorsProbability Scheme
Behavior Function A
Behavior Function B
.4
Left
.5
.1
Agent
.25
Right
.3
.1
.33
Straight
.2
.2
86Composing BehaviorsExtending Agents
Behav Func A
Behav Func B
Behav Func J
Left
.5
.1
.5
.41
Agent
Right
.3
.1
.5
.24
Straight
.2
.2
.5
.33
Jump
.2
.03
87Composing BehaviorsProbability Scheme
- Simple example
- Three rooms with different set of composing
behaviors.
88Situations Compose
- Agent can be in multiple situations
- Agent has union of all the things that different
situations put in
89Authoring 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
90Advantages
- 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
91Demos
92Limitations/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?
93SummaryScalable Crowd Simulation
- Situation-Based Approach
- Simple Extensible Agents
- Localized behaviors
- Behavior decomposed in situations
- Situation Composition
- Probability distributions
94Performance evaluation
95Performance evaluation
96Summary
- 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
97Summary
- 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
98Summary
- 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
99Summary
- 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
100Summary
- 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