Dynamic Navmesh: AI in the Dynamic Environment of Splinter Cell: Conviction
Splinter Cell: ConvictionUbisoft Montréal
Martin Walsh
Dynamic Environment
Lots of objectsExplosionsLots of NPCsDynamic Traps
AI
React
Interact
Navigate
Overview
CompareDevelopmentProblemsCool Features
Current Solutions
Grid-based
Two-tiered
Two-Tiered Solutions
Detailed Inconsistent
Why a Dynamic Navmesh?
One-tier solution
NPCs instantly aware
Dynamic Cover 1
Dynamic Cover 2
Blocked Paths
Overview
CompareDevelopmentProblemsCool Features
What is a Dynamic Navmesh?
Navmesh
2D representation of a 3D world• Triangles• Vertices• Edges• Walkable area• Extra information
What Makes it Dynamic
Modified in real timeFast Robust
Basic Operations
Adding
Removing
Adding an Object : Take 1
Cutting a hole
Adding an Object -- In Action
Adding an Object -- Paradigm
Rip out a chunkCut the holeReplug the new chunks
Adding an Object -- Pipeline
Get Object Contour
Get Affected Navmesh Contours
Combine Contours and Retessellate
Plug Triangles into Navmesh
Bounding volume
Points of Volume
Points projected onto X-Y plane
Convex hull
Expanded convex hull
Retessellated Navmesh
Get Affected Navmesh Contours
Find affected TrianglesMake Homogeneous contours
Combine Contours and Retessellate
CSG OperationTessellator
Plug Triangles into Navmesh
Will match up vertex for vertexNo floating point comparisonsVertex poolsLocal border recalculation
Removing an Object
How can you plug up a hole?
Removing an Object: Take 1
Use “Undo” to remove object
Removing an Object: Take 2
Undoing is free but redoing is expensive
What about subdividing?
Removing an Object: Take 3
But first…
Adding an Object: Take 2
How do you add an object so that you can remove it later?
Hole vs. Patch
Loss of information (Hole) Information retained (Patch)
Removing an Object: Take 3
Un-tag affected “Patch” triangles
Vertex clean-up
Overview
CompareDevelopmentProblemsCool Features
Plugging Problem
Vertex too close to edge of contour
Floating point imprecision
Degenerate Triangles
Produced by tessellator (or bad input)Bad for Robustness
Output Modification
Angle-optimal triangulation
Worked at first…
Degenerate Triangles Return
Stressing the system exposed problems
Degenerate faces
Input modification
Control your intersection vertices
Use vertex welding
Robustness Recap
Input/output modificationAvoid floating point comparisonControl your vertices
Performance Recap
LocalizePoolPartitionThread
Overview
CompareDevelopmentProblemsCool Features
The “Patch” system
Allows for new solutions to AI problems
Getting Stuck
Getting Unstuck
Interaction Based on State
Patrol• Avoid small obstacles
• Open doors
Combat• Plow through small obstacles• Bash doors
Guard and Civilians
Don’t Be Omniscient
Blocked door
The Future
Full 3D navigation
Bridges
www.creatorsofemotions.com
Questions and AnswersDynamic Navmesh: AI in the Dynamic Environment of Splinter Cell: Conviction