Presentation is loading. Please wait.

Presentation is loading. Please wait.

From Path Planning to Crowd Simulation

Similar presentations


Presentation on theme: "From Path Planning to Crowd Simulation"— Presentation transcript:

1 From Path Planning to Crowd Simulation
Roland Geraerts 3 September 2015 See for more information on our path planning and crowd simulation research. Our crowd simulation framework is described in the following paper: Wouter G. van Toll, Norman S. Jaklin, Roland Geraerts. Towards Believable Crowds: A Generic Multi-Level Framework for Agent Navigation. In ICT.OPEN 2015. Download:

2 Path planning

3 Path planning and crowd simulation
Goal: bring characters from A to B in an environment Also vehicles, animals, camera, a formation,… Requirement: fast and flexible Real-time planning for thousands of characters Individuals and groups Dealing with local hazards Different types of environments Requirement: realistic paths For example, the way humans move Low energy usage (smooth, short, minimal rotation/acceleration) Keep some distance (clearance) to obstacles Social behavior and rules (collision avoidance)

4 Social relevance of simulation
Crowd simulation is needed for Simulations of the real world Improving crowd flow, predicting crowd pressures, planning evacuation routes Replacement of big-scale exercises Hard and expensive to organize: 500+ people No impact on environment and surroundings Populating game worlds Game world Rebuilding of train station Evacuation in sports stadiums Love Parade in Duisburg, 2010

5 A computational model of human navigation
Challenge: Unify dispersed models for realistic, individual, small group, and collective human movements in interactive, heterogeneous environments. Dispersed models Agent-based: individuals, but problems with high densities Flow-based: no individuals, but good for high densities Realistic movements Comprise collaboration, smooth and energy-efficient movement, collision avoidance, and dealing with unrealistic congestions. Interactive environment Geometry can change dynamically, and the crowd has to react. Heterogeneous environment People need to take logical, distinct, and realistic paths over heterogeneous terrains in the environment.

6 Are we there yet?

7 Path planning errors in games
Networks of waypoints are incorrect Hand designed Do not adapt to changes in the environment Do not adapt to the type of character Local methods fail to find a route Keep stuck behind objects Lead to repeated motion Groups split up Not planned as a coherent entity Paths are unnatural Not smooth Stay too close to network/obstacles Methodology is not general enough to handle all problems Titan Quest: Immortal throne

8 Path planning algorithms
Method: Flocking Separation: steer to avoid crowding local units Alignment: steer towards the average heading of local units Cohesion: steer to move toward the average position of local units Advantages Natural behavior for certain animals Disadvantages Coherent group behavior is hard Trapped in local minima Flocking (Reynolds): see Other methods: scripting, cheating Reynolds, 1987: Flocks, Herds, and Schools: A Distributed Behavioral Model

9 Path planning algorithms
Method: A* Construction phase: create a grid, mark free/blocked cells Query phase: use A* to find the shortest path (in the grid) Advantage Simple Disadvantages Too slow in large scenes Ugly paths Little clearance to obstacles Unnatural motions, e.g. sharp turns Fixed paths Predictable motions Paths resulting from A* algorithms tend to have little clearance to obstacles and can be aesthetically unpleasant, so care must be taken to smooth them. See for more information/theory on A*. Major improvements: See e.g.: Field D*: An interpolation-based path planner and replanner (Dave Ferguson and Anthony Stentz) Hart et al, 1968: A Formal Basis for the Heuristic Determination of Minimum Cost Paths

10 Path planning algorithms
Method: Potential Fields Goal generates attractive force Obstacles generate repulsive force Follow the direction of steepest descent of the potential toward the goal Advantages Flexibility to avoid local hazards Smooth paths Disadvantages Expensive for multiple goals Local minima Continuum crowds (picture): Continuum crowds Treuille et al, 2006: Continuum crowds; Latombe, 1991: Robot motion planning

11 Path planning algorithms
Method: Probabilistic Roadmap Method Construction phase: build the roadmap Query phase: query the roadmap Advantages Reasonably fast High-dimensional problems Disadvantages Ugly paths Fixed paths Predictable motions Lacks flexibility when environment changes or obstacles are added Storage can be expensive Kavraki et al, 1996: Probabilistic roadmaps for path planning in high-dimensional configuration spaces

12 Path planning algorithms
Method: Navigation meshes Create a representation of the "walkable areas" of a scene Extract the path Advantages General approach Construction is fast on the GPU code.google.com/p/recastnavigation Disadvantages Often needs much manual editing Current techniques are imprecise Bad support for terrains No automatic annotations (games) Areas: walk, climb Places: hiding and sniper spots Obstacles Walkable voxels Raycast navigation code: see Some open problems Automatic annotation of the map Areas: walk, climb, jump, crouch, “avoid” … Special places: hiding and sniper spots, … Handle large (dynamic) changes Efficiently updating the data structure and paths Improve the efficiency of mesh generation (large scenes) Wrong coverage/connectivity due to confusing elements Steep stairs, ramps, hills, curved surfaces, gaps The mesh is only a data structure storing the walkable areas How to create visually convincing paths? Voxel regions Polygonal regions Mononen, 2015: Recastnavigation Convex regions A path

13 Do we need a new path planning algorithm?
differences Robotics Virtual environments Nr. entities a few robots many characters Nr. DOFs many DOFs a few DOFs CPU time much time available little time available Interaction anti-social social Type path nice path realistic path Correctness fool-proof may be incorrect Path planning has been studied extensively in Robotics

14 Surface-based navigation
We need a paradigm shift from graph-based to surface-based navigation Graph-based navigation: little support for route deviation Hard to avoid expected collision between humans Hard to support differently sized humans/groups Costly to deal with dynamic changes in the environment Hard to efficiently deal with heterogeneous regions Human navigation is surface-based A graph is a data structure that can represent the navigable routes in an envi-ronment [7,36,79]. Its nodes represent key positions in the environment which are con-nected through its edges representing routes. Crowd simulation algorithms that are based on this representation suffer from too little support of required deviation from these routes, e.g. to avoid expected collisions between humans, to support differently sized humans/groups, and to deal with dynamic changes in the environment (e.g. a bridge that partially collapses) [73]. In contrast, surface-based representations [24,39,72] handle these problems better because they do support deviation from these routes. In addition, human navigation seems to be surface-based since humans do not walk over imaginary lines but towards areas on a surface.

15 Crowd simulation framework
We need a fast and generic framework Representation of the environment Representation environment Level 5 Plans actions Level 4 Creates indicative routes Level 3 Traverses the routes Yields speed/direction pairs Level 2 Adapts routes E.g. to avoid collisions Level 1 Moves the characters See N.S. Jaklin, W.G. van Toll, and R. Geraerts. Way to go - A framework for multi-level planning in games. In International Planning in Games Workshop (in ICAPS), pp. 11–14, 2013. At the top of the hierarchy, event management and action planning (5) generate a set of geometric path planning queries, consisting of start/goal pairs. Next, the global route planning level (4) uses a query to produce an indicative route for a human or group, based on e.g. crowd densities, terrain preferences, visual information, and global coordination. The three lower levels move the crowd in every step of the simulation. On the route following level (3), the global routes are being traversed, yielding preferred velocities (i.e. speed/direction pairs). These are adapted in the local movement level (2) where a human might temporarily deviate from its global route to coordinate its movements and to handle potential collisions with the crowd, yielding a velocity that the animation system (1) uses to move a human. Van Toll, Jaklin, and Geraerts, Towards Believable Crowds: A Generic Multi-Level Framework for Agent Navigation.

16 Crowd simulation framework
Representation of the environment Representation environment Level 5 Plans actions Level 4 Creates indicative routes Level 3 Traverses the routes Yields speed/direction pairs Level 2 Adapts routes E.g. to avoid collisions Level 1 Moves the characters Van Toll, Jaklin, and Geraerts, Towards Believable Crowds: A Generic Multi-Level Framework for Agent Navigation.

17 Representation of the traversable environment
Comparison of navigation meshes Triangles [Kallmann] Disks [Pettré et al] Polygons [Mononen] Corridor Map [Geraerts] Exact representation x Linear memory 3D environments Variable unit widths Dynamic obstacles NOT! Kallmann: Pettré: Mononen: Geraerts: 3D environments  represents the walkable surfaces in a 3D environment

18 Representation of the traversable environment
Requirements Path existence 100% coverage of the navigable space All cycles Flexible: surfaces Fast computation and small storage Fast query time during simulation

19 Representation of the traversable environment
Navigation mesh Voronoi diagram / Medial axis Voronoi sites: red points Voronoi sites: red/black lines

20 Representation of the traversable environment
Navigation mesh Voronoi diagram / Medial axis From a graph to a surface representation Closest point annotation

21 Representation of the traversable environment
Navigation mesh Voronoi diagram / Medial axis From a graph to a surface representation Closest point annotation Computation Approximation on the GPU Exact computation on the CPU: Vroni, Boost Both have to deal with precision issues GPU computation: see e.g.

22 Representation of the traversable environment
Navigation mesh Extension to 3D environments Split environment into 2D layers Too hard to compute optimally GPU computation: see e.g.

23 Representation of the traversable environment
Navigation mesh Extension to 3D environments Split environment into 2D layers Too hard to compute optimally Stitch the navigation meshes on the layers together Fast to compute: multi-layerd: 46ms; city: 0.3s

24 Representation of the traversable environment
Extension to 2.5D (multi-layered) environments Technique Multi-layered environment Partial medial axes for Li and Lj Connection scene Updated medial axes for Li and Lj Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts Navigation Meshes for Realistic Multi-Layered Environments. Appears in IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS'11), Full text [pdf]

25 Representation of the traversable environment
Result 10 ms Fast to compute: multi-layerd: 46ms; city: 0.3s

26 Representation of the traversable environment
Navigation mesh Fast to compute 10 ms 115 ms 3 s

27 Representation of the traversable environment
Can be huge E.g. 1 km2

28 Representation of the traversable environment
Navigation mesh Handles dynamic changes Update costs < 1 ms

29 Representation of the traversable environment
Navigation mesh Exact representation Captures 100% of the free space Captures all homotopically different routes (cycles) Allows fast extraction of global routes and final paths Nice mathematical properties Fast to compute – O(n log n) Small data structure – O(n) Nearest obstacle computation – O(1) 2D algorithms also work in ML environments Fast to compute: multi-layerd: 46ms; city: 0.3s

30 Crowd simulation framework
Representation of the environment Representation environment Level 5 Plans actions Level 4 Creates indicative routes Level 3 Traverses the routes Yields speed/direction pairs Level 2 Adapts routes E.g. to avoid collisions Level 1 Moves the characters See N.S. Jaklin, W.G. van Toll, and R. Geraerts. Way to go - A framework for multi-level planning in games. In International Planning in Games Workshop (in ICAPS), pp. 11–14, 2013. At the top of the hierarchy, event management and action planning (5) generate a set of geometric path planning queries, consisting of start/goal pairs. Next, the global route planning level (4) uses a query to produce an indicative route for a human or group, based on e.g. crowd densities, terrain preferences, visual information, and global coordination. The three lower levels move the crowd in every step of the simulation. On the route following level (3), the global routes are being traversed, yielding preferred velocities (i.e. speed/direction pairs). These are adapted in the local movement level (2) where a human might temporarily deviate from its global route to coordinate its movements and to handle potential collisions with the crowd, yielding a velocity that the animation system (1) uses to move a human.


Download ppt "From Path Planning to Crowd Simulation"

Similar presentations


Ads by Google