a navigation mesh for dynamic environments wouter g. van toll, atlas f. cook iv, roland geraerts...

17
A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

Upload: barry-lee

Post on 26-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

A Navigation Mesh for Dynamic EnvironmentsWouter G. van Toll, Atlas F. Cook IV, Roland Geraerts

CASA 2012

Page 2: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

Problem solved?2 / 16

Page 3: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

3 / 16

Path planning in games and simulations• Send virtual characters from start to goal• Increasing desire for efficiency and realism

– Characters: smooth movement, collision avoidance, …– Environments: complex (2.5D), dynamic, …

• Foundation: a navigation mesh– Subdivision of the walkable space

into 2D polygons– Allows smooth, flexible movement

• Our framework: corridors– Based on the 2D medial axis

Contribution: dynamic updates

Motivation

Page 4: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

4 / 16Preliminaries: 2D medial axis

Medial axis:

• Pruned version ofthe Voronoi diagram

• Subdivision into cellswith 1 closest obstacle

A useful roadmap• Maximum clearance

to obstacles• Preserves connectivity

The set of all points with at least two closest obstacle points

Page 5: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

5 / 16Preliminaries: Explicit Corridor Map

ECM: Annotated medial axis (Geraerts, 2010)• Bisector vertices store

a closest obstacle pointon both sides

• Exact subdivision of the walkable space

An efficient nav. mesh• O(n) storage• O(n log n) build time

Page 6: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

6 / 16Preliminaries: Explicit Corridor Map

Some features of the ECM• Clearance information

– Supports all character sizes

• Global planning on the MA– Result: path + corridor

• Following indicative routes• Short paths with clearance• Local forces can be added

– Collision avoidance– Group coherence

• Multi-layered environments• Dynamic updates

Page 7: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

7 / 16Contribution: Local updates

Dynamic environments can change locally• E.g. collapsing bridges, newly built roads, …• Complete navmesh reconstruction is expensive!

Local operations: adding/removing obstacles• Update the mesh only where it is necessary

Recall: The ECM is an annotated medial axis We use Voronoi algorithms; skip the annotations today1. Inserting a point among points2. Inserting a point among polygons3. Inserting a polygon among polygons4. Deleting an obstacle

Page 8: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

8 / 161. Inserting a point among points

Insertion = 1 step of incremental construction– Let Cj

be the Voronoi cell of point pj

– Let p be the point to add

Algorithm (Green and Sibson, 1978)– Find the cell Ci in which p lies

– Compute the bisector of p and pi

– Find the intersections of bisector and Ci

– Compute new neighbor + bisector– Iterate until the new cell is finished– Remove the old edges

• Complexity: O(log n + k)– n = number of points– k = complexity of the new cell

Page 9: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

9 / 162. Inserting a point among polygons

What if the other obstacles are polygons?• Bisector edges are chains of line/parabola segments• A bisector vertex (BV) marks a switch• BV occurs when the edge

intersects a surface normal

Adapted insertion algorithm• In each iteration, choose the 1st of 2 intersections

Page 10: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

10 / 163. Inserting polygon among polygons

What if the inserted obstacle P is a line or polygon?• P can also induce bisector vertices

Adapted insertion algorithm• In each iteration, choose the 1st of 3 intersections

– With the Voronoi cell– With the neighbour’s normal vector– With P’s normal vector

Page 11: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

11 / 164. Deleting an obstacle

Deleting P: the cell CP needs to be removed• Its interior must be filled in with new edges• These can only come from P’s neighbors!

Deletion algorithm– Compute NP, set of P’s neighbors

– Build the medial axis for NP

– Connect the old/new medial axes– Delete the boundary of CP

• Complexity: O(m log m)– m = number of neighbors for P

Page 12: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

12 / 16Experimental results

1. Inserting random points into an empty scene• Incremental insertion• Local updates vs. global reconstruction

– Local: Always fast (< 1 ms)– Global: Slower, depends on #points so far

Page 13: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

13 / 16Experimental results (2)

2. Inserting polygons into various scenes• Running times: 1.3ms to 2.5ms• Efficiency depends on the new cell’s complexity

In practice, most updates will be very local Fast enough for real-time updates!

Page 14: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

14 / 16Experimental results (3)

3. Deleting polygons from various scenes• Same polygons/scenes as before• Running times: 1.2ms to 5.4ms• Efficiency depends on the old cell’s complexity

4. Moving a polygon through various scenes• Re-insert the polygon into a static version• Running times below 1.5ms We can handle multiple moving obstacles in real-time

Page 15: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

15 / 16Conclusions

Algorithms for updating a navigation mesh• Based on Voronoi diagram techniques• Insertions of points and polygons• Deletions based on insertions

Implementation and experiments• Insertions: real-time performance• Deletions: slower, but still applicable• Movement: real-time insertions into a static scene• Applications in 2D and 2.5D

demo 1 demo 2

Page 16: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

16 / 16Future work

Goal: a generic path planning framework for games and simulations

Page 17: A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012

Thank you

Contact• Roland Geraerts• [email protected]• http://www.staff.science.uu.nl/~gerae101

17 / 16