Presentation is loading. Please wait.

Presentation is loading. Please wait.

Crowd simulation Taku Komura. Animating Crowds We have been going through methods to simulate individual characters We have been going through methods.

Similar presentations


Presentation on theme: "Crowd simulation Taku Komura. Animating Crowds We have been going through methods to simulate individual characters We have been going through methods."— Presentation transcript:

1 Crowd simulation Taku Komura

2 Animating Crowds We have been going through methods to simulate individual characters We have been going through methods to simulate individual characters What if we want to simulate the movement of crowds? What if we want to simulate the movement of crowds? Pedestrians in the streets Pedestrians in the streets Flock of birds, school of fishes Flock of birds, school of fishes People in panic People in panic

3 Why need a crowd simulation ? Shooting scenes with many people Shooting scenes with many people Expensive to hire many extra actors Expensive to hire many extra actors We don’t see the details : use simple computer- based models We don’t see the details : use simple computer- based models Security reasons: Security reasons: Need to evaluate the safety of buildings Need to evaluate the safety of buildings

4 Overview Agent based Methods Agent based Methods Flocking Flocking Intention generator Intention generator Creating scenes with human crowds Creating scenes with human crowds Patch-based methods Patch-based methods Create scenes by building blocks Create scenes by building blocks (Local) Collision avoidance (Local) Collision avoidance Global methods (Continuum crowds) Global methods (Continuum crowds) Other Applications: Other Applications:

5 Flocking Models – Most basic agent model (Reynolds ’87) The agents interact based on simple dynamics The agents interact based on simple dynamics Good to simulate Good to simulate Flock of birds flying, Flock of birds flying, school of fishes swimming school of fishes swimming

6 Forces applied to individuals Separation Alignment Cohesion Avoidance

7 Separation Try to avoid running into local flock- mates – –Use a perception volume to limit visible flock-mates – –S : surrounding entities Separation: Fly away away from neighbors that are “too close”

8 Alignment Try to fly in same direction as local flock-mates – –Gets everyone flying in the same direction Alignment: steer toward average velocity

9 Cohesion Try to move toward the average position of local flock-mates – –Spaces everyone out evenly, – –keep boundary members toward the group Cohesion: steer toward average position

10 Avoidance Try to avoid obstacles – –The closer the character is, the stronger the force Avoidance: steer away from obstacles

11 Combining Commands

12 http://www.youtube.com/watch?v=4kPSDW7gQHA

13 Flocking Evaluation Advantages: Advantages: Complex behaviour from simple rules Complex behaviour from simple rules Many types of behaviour can be expressed with different rules and parameters Many types of behaviour can be expressed with different rules and parameters Disadvantages: Disadvantages: Can be difficult to set parameters to achieve desired result Can be difficult to set parameters to achieve desired result Problems regarding strength of forces Problems regarding strength of forces

14 Making the Agents Smarter Designing the details of the behaviours What to do when you see a predator What to do when you find somebody you know? What to do when the traffic lights are red? Need to add more rules…

15 Artificial Fish -Terzopoulos et al. SIGGRAPH ‘94 Adding further factors such as Adding further factors such as Hunger Hunger Libido Libido Fear Fear for deciding the behaviour of the fish Adding sensory perception such as Adding sensory perception such as vision vision

16 Intention Generator 1.First check the sensory information for collision 2.If any close predator, either Schooling Escape Otherwise if hungry eat If full mate http://www.youtube.com/watch?v=RHt_8ZYQVZw

17 Intention Generator Decision making for the fish Decision making for the fish

18 What about humans? Can do something similar Can do something similar But humans are a bit more high level But humans are a bit more high level Not only eating or escaping Not only eating or escaping Have destinations Have destinations Contexts Contexts Socializing Socializing Grouping, Grouping, Talking to somebody you know Talking to somebody you know Just make a more (ad hoc) complex model

19 Behavior model : Autonomous Pedestrians More complex than a fish More complex than a fish http://www.youtube.com/watch?v=cqG7ADSvQ5o

20 More serious problems for humans : context Interactions with the environment Interactions with the environment Collision avoidance Collision avoidance More complex than fishes More complex than fishes Create a more complex controller Create a more complex controller Getting to the destination : Getting to the destination : use path-finding algorithms such as A* search (shortest route to the destination) use path-finding algorithms such as A* search (shortest route to the destination)

21 Interactions with the Environment Examples At bus stops, people stop and queue At an elevator, people wait for it and ride on it when it comes and travel to different floors TV in the living room : turn on the TV and sit on the sofa to watch TV TV in the living room : turn on the TV and sit on the sofa to watch TV IDEA: associate such motions with the objects Once the character comes across such objects, they launch the associated motion

22 Embedding motions into the environment : Advantages of the approach Efficient data handling Efficient data handling Each agent holds the data only needed at that moment Each agent holds the data only needed at that moment The control is decentralized The control is decentralized The system is scalable, and large crowds can be simulated The system is scalable, and large crowds can be simulated

23 Patch-based approaches Pre-compute the patches (building blocks) which includes the characters and the environment Pre-compute the patches (building blocks) which includes the characters and the environment Concatenate them to generate large scale scenes during runtime Concatenate them to generate large scale scenes during runtime Motion Patches Motion Patches Crowd patches Crowd patches

24 Motion Patches Building Blocks for Virtual Environments Building Blocks for Virtual Environments Embed the motions into the environment Embed the motions into the environment The patches are spatially aligned The patches are spatially aligned

25 Crowd Patches A patch-based approach to generate scenes of crowded environment A patch-based approach to generate scenes of crowded environment Crowds avoiding each other in the patches Crowds avoiding each other in the patches The timing and location the characters entering the patches are fixed so that the people can keep on entering / exiting The timing and location the characters entering the patches are fixed so that the people can keep on entering / exiting The characters can be switched to make more variations The characters can be switched to make more variations

26 Collision avoidance Humans avoid others in streets in a complex way Humans avoid others in streets in a complex way Sometimes wait, sometimes, move aside while walking Sometimes wait, sometimes, move aside while walking Need to either Need to either Model them based on a complex collision avoidance engine Model them based on a complex collision avoidance engine Find a good mathematical model Find a good mathematical model

27 Local collision avoidance Prepare a sensing fan Prepare a sensing fan Check if there are other agents / obstacles in the sensing fan Check if there are other agents / obstacles in the sensing fan Launch avoiding movements Launch avoiding movements

28 Avoid oncoming pedestrians If a cross collision is estimated by H with C If a cross collision is estimated by H with C – If H is arriving slightly earlier, it accelerates and turn away from C – If H is arriving slightly later, it decelerates and turn towards C – So C does the same

29 Head-on collision If a head-on collision is estimated, the agents turn away from each other If a head-on collision is estimated, the agents turn away from each other

30 Safe turning If an agent needs to make a quick turn, the curvature of the turn is gradually increased until a collision free turn is found If an agent needs to make a quick turn, the curvature of the turn is gradually increased until a collision free turn is found The velocity is decreased according to the curvature The velocity is decreased according to the curvature

31 Front Safe Area Decelerate and stop when something suddenly comes into the front safe area Decelerate and stop when something suddenly comes into the front safe area

32 Collision Avoidance : Local vs. Global Combining various rules requires careful parameter-tuning (local model) Combining various rules requires careful parameter-tuning (local model) Need a good controller that Need a good controller that Considers the future Considers the future Finds an optimal path for avoidance Finds an optimal path for avoidance to simulate this effect well (global model)

33 Continuum Crowds Solving the path-planning and collision avoidance at the same time Solving the path-planning and collision avoidance at the same time 1. Compute the potential field at every time step Based on the other avatars and obstacles Based on the other avatars and obstacles The goal location The goal location 2. The character’s movement determined based on the potential field 3. Update the potential field

34 Continuum Crowds : procedure Discretize the space into grids Discretize the space into grids Decide the start / goal of the characters Decide the start / goal of the characters

35 Continuum Crowds : procedure 2 The cost to the goal is going to be computed by the following function: The cost to the goal is going to be computed by the following function:

36 Discomfort Field Produced by other obstacles / characters Produced by other obstacles / characters

37 Continuum Crowds : procedure 1

38 Eikonal function Φ

39 Continuum Crowds : procedure 2 Starting from the goal we expand outwards and accumulate the cost C Starting from the goal we expand outwards and accumulate the cost C Fast Marching Method Fast Marching Method Similar to Djikstra’s algorithm Similar to Djikstra’s algorithm

40 Fast Marching Method

41 Marching Forwards

42

43

44 Potential Field If the group of people share the same speed, goal, and discomfort, we can use the same potential field for all these characters If the group of people share the same speed, goal, and discomfort, we can use the same potential field for all these characters Very efficient if there are little number of groups Very efficient if there are little number of groups

45 Can simulate the dynamics of crowds A global approach (optimal towards the goal) A global approach (optimal towards the goal) Can simulate phenomena observed in real humans Can simulate phenomena observed in real humans http://www.youtube.com/watch?v=IqIuVhDFSp8

46 Another application of crowd simulation Simulating dynamical features of escape panic : Helbing ‘00 A particle system model to simulate the crowd under panic A particle system model to simulate the crowd under panic People rush towards the exit People rush towards the exit http://www.youtube.com/watch?v=mUKYtOXg5Zw

47 Simulating dynamical features of escape panic : Helbing ’00 f ij, the force to stay away from other entities, f ij, the force to stay away from other entities, f iw the force to stay away from walls f iw the force to stay away from walls : velocity of entity i : velocity of entity i : the desired velocity of entity i : the desired velocity of entity i

48 Simulating dynamical features of escape panic : Helbing ‘00 f ij, the force to stay away from other entities, f ij, the force to stay away from other entities, f iw the force to stay away from walls f iw the force to stay away from walls : velocity of entity i : velocity of entity i : the desired velocity of entity i : the desired velocity of entity i

49 Simulating dynamical features of escape panic : Helbing ‘00 f ij, the force to stay away from other entities, f ij, the force to stay away from other entities, f iw the force to stay away from walls f iw the force to stay away from walls : velocity of entity i : velocity of entity i : the desired velocity of entity i : the desired velocity of entity i

50 Reference REYNOLDS, C. W. 1987. Flocks, herds, and schools: A distributed behavioral model. In Computer Graphics (Proceedings of SIGGRAPH 87) TU, X., AND TERZOPOULOS, D. 1994. Artificial fishes: Physics, locomotion, perception, behavior. In Proceedings of SIGGRAPH 94, Computer Graphics Proceedings, Annual Conference Series, 43–50. SHAO, W., AND TERZOPOULOS, D. 2005. Autonomous pedestrians. In SCA ’05: Proceedings of the 2005 ACM SIGGRAPH/Eurographics symposium on Computer animation, ACM Press, New York, NY, USA, 19–28. Crowd Patches: Populating Large-Scale Virtual Environments for Real- Time Applications. Barbara Yersin, Jonathan Maïm, Julien Pettré and Daniel Thalmann. ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games 2009. Kang Hoon Lee, Myung Geol Choi and Jehee Lee, Motion Patches: Building Blocks for Virtual Environments Annotated with Motion Data, accepted to ACM SIGGRAPH 2006. Kang Hoon LeeMyung Geol ChoiJehee Lee Adrien Treuille, Seth Cooper, Zoran Popovic, Continuum Crowds, SIGGRAPH 2005


Download ppt "Crowd simulation Taku Komura. Animating Crowds We have been going through methods to simulate individual characters We have been going through methods."

Similar presentations


Ads by Google