mieszko zielinski (epic games), white nights 2015
TRANSCRIPT
![Page 1: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/1.jpg)
UE4 Open World AI Navigation
And how did we get here
![Page 2: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/2.jpg)
Recast by Mikko Mononen
Best thing that happened to game AI navigation since sliced bread!• Lightweight, fast and open-source! • De facto industry standard• Resurrected and available on github
https://github.com/memononen/recastnavigation
![Page 3: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/3.jpg)
![Page 4: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/4.jpg)
UE4 Navigation parts
• Navigation bounds volumes• Navigation relevant actors – geometry & other data (links, areas)
• Navigation Octree– stores navigation-relevant data– speeds up gathering relevant data for
specific navmesh tile’s generation
![Page 5: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/5.jpg)
So what’s the problem?
![Page 6: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/6.jpg)
This doesn’t scale all that well
![Page 7: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/7.jpg)
GDC Demo Map, 256 km2
Naive approach
Navigation Octree ~10.3GB
NavMesh ~500MB
Plus ~30 minute navmesh generation (8 core machine)And requires loading all levels for navmesh generation purposesThis, of course, is useless.
![Page 8: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/8.jpg)
Why it was so much?
• Empty NavMesh tile - 176 bytes• 10000 tiles, ~50kB each, 16000uu x
16000uu • Every piece of navigation-relevant
data kept in Navigation Octree
![Page 9: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/9.jpg)
Solution ideas
Dump the navigation octree!– Static navmesh of 500MB is acceptable– No work required, supported out of the
box– NO GO, we wanted to show dynamic
navmesh generation!
![Page 10: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/10.jpg)
Solution ideas
Custom Landscape-specific navigation graph–Main navoctree
occupant– NO GO, more then
just lanscapes in the demo
![Page 11: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/11.jpg)
Solution ideas
High level navigation mesh– Huge voxels, very
low precision– Low memory, fast
generation
– NO GO, would require a custom local-navigation solution
![Page 12: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/12.jpg)
No worries!
Low-hanging fruit solution• We don’t need all of navmesh all the time• We need only the nav octree information
required by tiles we need
![Page 13: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/13.jpg)
![Page 14: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/14.jpg)
Applied to UE4 Navigation System
• Navigation bound stay the same• Navigation octree to store only the
data relevant “now”• Introduce a way to communicate to
Navigation System where navmesh is required
![Page 15: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/15.jpg)
Navigation Octree
• Lazy geometry gathering– outside of game thread
• Landscape slicing– never stored in octree– constant cost, outside of game thread
![Page 16: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/16.jpg)
Navigation Invokers
• Internal and external radii• Updated on a regular basis• Only “new” tiles require work
![Page 17: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/17.jpg)
![Page 18: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/18.jpg)
GDC Demo Map, 256 km2
Naive approach At GDC
Navigation Octree ~10.3GB 572MB
NavMesh ~500MB 31MB
The end result still not ideal But we’re not done yet! :D
![Page 19: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/19.jpg)
Future work
• Don’t store anything in nav octree unless it’s necessarry– Currently only geometry is treated the smart way
• Moveable navigation bounds • Give lazily gathered octree data a lifetime
limit• Multithreaded lazy geometry gathering
![Page 20: Mieszko Zielinski (Epic Games), White Nights 2015](https://reader036.vdocument.in/reader036/viewer/2022081504/55c347b2bb61ebab7b8b4676/html5/thumbnails/20.jpg)
Hit me up [email protected]