SlideShare a Scribd company logo
1 of 38
Putting the AI back into Air
Navigating the Air Space of Horizon Zero Dawn
Game AI North Copenhagen,
October 17, 2017
Wouter Josemans
Guerrilla Games
Contents
• Introduction
• Problem Specification
• Navigation Data Generation
• Path Planning
• Path Smoothing/Following
• Gameplay/AI System Interactions
• Conclusion
Introduction
• Guerrilla
– Studio in Amsterdam
– Previously known for Killzone games
– Team of around 250 people in total
• Horizon Zero Dawn
– Large, open world game
– Robotic wildlife
– Flying enemies
– AI programmers: around 10 people
during peak development
Flying Enemies
Problem Specification
• Flying agents should be able to fly from point A to
point B in a natural looking way without flying
through geometry
• Navigation should support agents of more than one
size
• Navigation data should be memory-efficient and
queries should be of similar performance to their
NavMesh counterparts
• Support same set of features as ground-based
agents
Considered Air Navigation
Approaches
• Full 3D approaches
– Waypoint graphs (Used in previous projects)
– Regular voxel grids (too expensive for
games)
– Sparse Voxel Octrees (as used in Warframe
[BRE17])
• Other approaches
– Multiple NavMesh layers with flight
connections in between
– Height maps (which we ended up using)
Height Maps
• A height map maps the 𝑥, 𝑦 coordinates of a position to a height
• World positions are discretized in square blocks on the height map called cells
• Cells of a height map have a certain size depending on the agent
• In Horizon, the height map describes the highest piece of collision for that cell
- There’s only one height per cell (can’t fly underneath arches)
+ In general height maps are easy to work with and cost a lot less memory than many
alternatives
Height Map Generation
• Generate at runtime
• Cells are grouped together in tiles, the minimum
generation unit
• Minimum flying height is determined by finding the
highest piece of collision in that cell, and adding the
agent radius on top of that
• Agents have a generation bubble around them, so
height map is only generated for tiles that lie within a
generation bubble
• Generation gets callbacks from the streaming system,
so tiles are updated when things are streamed in/out
Height Map Generation
• Each tile is generated in a separate job:
– Find all physics polygons in a tile
– For each poly
• Rasterize the polygon to the cell grid
• Cell height becomes the maximum of the poly’s height and the
current height
– Dilate the height map by the agent radius using the van
Herk–Gil–Werman algorithm [HER92, GIL93]
Height Map Queries
• “Safe Height” queries
– Height map lookup
• Raycasts
– Bresenham’s line drawing algorithm
[BRE65] for finding cells, then checking
intersections
• Path queries
– Full path planning algorithm
Path Planning - Considerations
• If start and end position lie above the
height map, we know that there is always a
path
• However, we don’t want to fly over a
mountain if going around it would be much
faster
• So we can not simply fly from start to end,
going up or down when needed
Path Planning
• A* on a discrete regular grid with non-uniform cost
• No diagonal transitions
• Change height if necessary when transitioning to a
neighbor
• Node:
– Tile XY, cell XY coordinates
– Expansion Height (not necessarily the height map height at the
node’s position)
N
W C E
S
Path Planning
• Estimated cost between two nodes is Euclidean XY distance
• Actual cost of going from 𝑥1, 𝑦1 to (𝑥2, 𝑦2):
• If ℎ(𝑥1, 𝑦1) higher than ℎ(𝑥2, 𝑦2): XY distance
• If ℎ(𝑥1, 𝑦1) lower than ℎ(𝑥2, 𝑦2): XYZ distance
• Penalize going up, but not going down
• Set the Expansion Height for node B to max(ℎ(𝑥1, 𝑦1) , ℎ(𝑥2, 𝑦2))
• Goal is reached when in the right cell, then a final path node is added to the goal
height
Path Planning - Results
• Approach worked well in terms of resulting
paths
• Unfortunately, we soon ran into
performance issues:
– Algorithm does not scale well with distance
– For large parts of the search space, costs are
actually uniform and then there exist many
equally good paths, as described in [HAR11],
which leads to the expansion of lots of nodes
Path Planning
• So: performance not satisfactory (having to
sacrifice height map detail for performance gain
was not something we wanted to do)
• Need something more sophisticated: Jump
Point Search? Non-regular grid?
…Or something else?
Path Planning
• So: performance not satisfactory (having to
sacrifice height map detail for performance gain
was not something we wanted to do)
• Need something more sophisticated: Jump
Point Search? Non-regular grid?
…Or something else?
Our solution: hierarchical path planning over
mipmaps
Height Map Generation with Mipmaps
• Use mipmaps for several levels of detail
• Level 1 mipmap samples 4 neighboring cells from the
original height map, sets its value as the max of these
height values
• Level 2 mipmap samples 4 neighboring cells from the
Level 1 mipmap
• Etc.
• Until we get to the level where one cell is equal to one
tile, so we have log2(𝑡𝑖𝑙𝑒_𝑟𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛) + 1 MIP levels
Height Map Generation with Mipmaps
• Introduces extra memory overhead:
– For a 64x64 height map we add 32x32
+ 16x16 + 8x8 + 4x4 + 2x2 + 1x1 cells =
1365 extra cells per tile
– Roughly 33% extra memory
– Acceptable overhead (initially around
150 KB for a Stormbird height map, now
about 190 KB)
Hierarchical Path Planning
• Allow a fixed number of A* iterations across
one query
• Plan a coarse path on a higher mipmap level
• Consider this as a rough path corridor, only
allow expansion of nodes on lower mipmap
level that lie within the corridor
• Keep refining the path at lower mipmap levels
until we run out of A* iterations
• Return the most detailed (finished) path at the
time that we run out of iterations
Hierarchical Path Planning
• Final configuration (Glinthawk/Stormbird):
– Allow 1024 cycles
– Plan initial path at mipmap level 3
– Refine path at mipmap level 1 and then 0
• To investigate: scale mipmap level planning
policies with respect to the distance between start
and end
Hierarchical Path Planning
• Pros:
+ There is an upper limit to the cost of path planning
+ We always find a path, even if we run into the upper limit
+ Can in theory plan really long paths
• Cons:
– We lose optimality because we restrict the path search
– Quality of the path depends on the length of the path
• We like the pros, and we can live with the cons
Path Smoothing
• Path we get from path planning is quite angular, with steep
slopes
• Robots flying straight up or down doesn’t look good
• Algorithm:
– Do a (height map) raycast from start to end
– If a hit occurs, split the path in the middle, repeat the process
for both segments until they are free of hits
– If no hit occurs, add the segment to the final path
• Misses a couple of cases, but we keep running the algorithm
while flying around, so eventually the shortcuts are found
Path Following/Air Movement
• Simple particle physics:
– Velocity/Angular Velocity + Acceleration/Angular
Acceleration
• AI drives acceleration/deceleration vector to follow the path
as closely as possible
• AI drives angular velocity based on flight method:
– “Hover” : forward not necessarily movement heading
– “Glide” : forward always in movement heading
• Mostly code driven movement, animation driven movement
during certain animations (e.g. landing)
• Drive certain movement animation based on shape of the
path
Interactions with other AI Systems
On Ground In Air
CollisionAvoidance (Entities) ✓ ✕
Position Evaluation ✓ ✓
Area Restrictions Convex hulls Cylinders only
Formation Movement ✓ ✕
Melee Attack System
(Clamping)
✓
(NavMesh)
✓
(Physics)
Combat System (ticketing) ✓ ✓
Flying Behaviors
• Transitioning from air to ground and vice versa
• Landing:
– Generate candidate positions on the NavMesh
– Filter positions where height map is more than on
agent radius higher
– Adjust the angle of approach
– After landing, switch from air to ground-based
movement
• Guided crashing:
– Special state when knocked down or killed
– Find landing position in the direction of the velocity
Flying Behaviors
• Dive Attack
– Stormbird flies up high into the sky
– Dive straight at the target, crashing into the
ground at its position
– Fly in front of the sun/moon for added effect
Conclusion
• Representing flyable air space using a height map proved to
be sufficient for the environments in the game
• Regular-grid planning proved to not scale well in performance
terms
• Hierarchical queries on mipmaps offer a good trade-off
between finding a natural looking path and keeping
performance at an acceptable level
• Air navigation was relatively easy to integrate into our
gameplay systems, but for some cases (such as collision
avoidance) work remains to be done
Questions?
wouter.josemans@guerrilla-games.com
@wkjosemans
Citations
• [BRE17] D. Brewer, 3D Flight Navigation Using Sparse Voxel Octrees, Game AI
Pro 3, 2017
• [BRE65] J. E. Bresenham, Algorithm for computer control of a digital plotter. IBM
Syst. J. 4, 1965
• [HAR11] D. Harabor, A. Botea, and P. Kilby., Path Symmetries in Uniform-cost
Grid Maps. In Symposium on Abstraction Reformulation and Approximation
(SARA), 2011.
• [GIL93] J. Gil and M. Werman. Computing 2-d min, median, and max filters., IEEE
Transactions on Pattern Analysis and Machine Intelligence, 15(5):504.507, May
1993.
• [HER92] M. van Herk. A fast algorithm for local minimum and maximum filters
on rectangular and octagonal kernels. Pattern Recognition Letters, 13(7):517.521,
July 1992

More Related Content

What's hot

Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Johan Andersson
 

What's hot (20)

Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
 
[NDC 2010] 그럴듯한 랜덤 생성 컨텐츠 만들기
[NDC 2010] 그럴듯한 랜덤 생성 컨텐츠 만들기[NDC 2010] 그럴듯한 랜덤 생성 컨텐츠 만들기
[NDC 2010] 그럴듯한 랜덤 생성 컨텐츠 만들기
 
게임 시스템 디자인 시작하기
게임 시스템 디자인 시작하기게임 시스템 디자인 시작하기
게임 시스템 디자인 시작하기
 
Rendering Tech of Space Marine
Rendering Tech of Space MarineRendering Tech of Space Marine
Rendering Tech of Space Marine
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-Graphics
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
 
Practical Occlusion Culling in Killzone 3
Practical Occlusion Culling in Killzone 3Practical Occlusion Culling in Killzone 3
Practical Occlusion Culling in Killzone 3
 
Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The Surge
 
Modular Level Design for Skyrim
Modular Level Design for SkyrimModular Level Design for Skyrim
Modular Level Design for Skyrim
 
The Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next StepsThe Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next Steps
 
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
 
DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
 
Decima Engine: Visibility in Horizon Zero Dawn
Decima Engine: Visibility in Horizon Zero DawnDecima Engine: Visibility in Horizon Zero Dawn
Decima Engine: Visibility in Horizon Zero Dawn
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lighting
 
Modular Rigging in Battlefield 3
Modular Rigging in Battlefield 3Modular Rigging in Battlefield 3
Modular Rigging in Battlefield 3
 
멀티스레드 렌더링 (Multithreaded rendering)
멀티스레드 렌더링 (Multithreaded rendering)멀티스레드 렌더링 (Multithreaded rendering)
멀티스레드 렌더링 (Multithreaded rendering)
 
Checkerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOCCheckerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOC
 
Light prepass
Light prepassLight prepass
Light prepass
 

Similar to Putting the AI Back Into Air: Navigating the Air Space of Horizon Zero Dawn

Path Finding In Hazard Terrain
Path Finding In Hazard TerrainPath Finding In Hazard Terrain
Path Finding In Hazard Terrain
Oren Koler
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
milad abbasi
 

Similar to Putting the AI Back Into Air: Navigating the Air Space of Horizon Zero Dawn (20)

Introduction to Real Time Rendering
Introduction to Real Time RenderingIntroduction to Real Time Rendering
Introduction to Real Time Rendering
 
Introduction to Steering behaviours for Autonomous Agents
Introduction to Steering behaviours for Autonomous AgentsIntroduction to Steering behaviours for Autonomous Agents
Introduction to Steering behaviours for Autonomous Agents
 
Developing a Multiplayer RTS with the Unreal Engine 3
Developing a Multiplayer RTS with the Unreal Engine 3Developing a Multiplayer RTS with the Unreal Engine 3
Developing a Multiplayer RTS with the Unreal Engine 3
 
Midterm Progress Report (Dynamic Sparse A-Star)
Midterm Progress Report (Dynamic Sparse A-Star)Midterm Progress Report (Dynamic Sparse A-Star)
Midterm Progress Report (Dynamic Sparse A-Star)
 
06 image features
06 image features06 image features
06 image features
 
Terrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable SystemTerrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable System
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-online
 
Lecture24
Lecture24Lecture24
Lecture24
 
Path Finding In Hazard Terrain
Path Finding In Hazard TerrainPath Finding In Hazard Terrain
Path Finding In Hazard Terrain
 
Artificial Inteligence for Games an Overview SBGAMES 2012
Artificial Inteligence for Games an Overview SBGAMES 2012Artificial Inteligence for Games an Overview SBGAMES 2012
Artificial Inteligence for Games an Overview SBGAMES 2012
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
 
AI Robotics
AI RoboticsAI Robotics
AI Robotics
 
Simulating 10,000 Guests in Planet Coaster | Owen Mc Carthy
Simulating 10,000 Guests in Planet Coaster | Owen Mc CarthySimulating 10,000 Guests in Planet Coaster | Owen Mc Carthy
Simulating 10,000 Guests in Planet Coaster | Owen Mc Carthy
 
Pathfinding in games
Pathfinding in gamesPathfinding in games
Pathfinding in games
 
Module_2_rks in Artificial intelligence in Expert System
Module_2_rks in Artificial intelligence in Expert SystemModule_2_rks in Artificial intelligence in Expert System
Module_2_rks in Artificial intelligence in Expert System
 
Straight Line Distance Heuristic
Straight Line Distance HeuristicStraight Line Distance Heuristic
Straight Line Distance Heuristic
 
ODSC India 2018: Topological space creation & Clustering at BigData scale
ODSC India 2018: Topological space creation & Clustering at BigData scaleODSC India 2018: Topological space creation & Clustering at BigData scale
ODSC India 2018: Topological space creation & Clustering at BigData scale
 
Cnn
CnnCnn
Cnn
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
 

More from Guerrilla

More from Guerrilla (20)

Horizon Zero Dawn: An Open World QA Case Study
Horizon Zero Dawn: An Open World QA Case StudyHorizon Zero Dawn: An Open World QA Case Study
Horizon Zero Dawn: An Open World QA Case Study
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
 
The Production and Visual FX of Killzone Shadow Fall
The Production and Visual FX of Killzone Shadow FallThe Production and Visual FX of Killzone Shadow Fall
The Production and Visual FX of Killzone Shadow Fall
 
Out of Sight, Out of Mind: Improving Visualization of AI Info
Out of Sight, Out of Mind: Improving Visualization of AI InfoOut of Sight, Out of Mind: Improving Visualization of AI Info
Out of Sight, Out of Mind: Improving Visualization of AI Info
 
The Next-Gen Dynamic Sound System of Killzone Shadow Fall
The Next-Gen Dynamic Sound System of Killzone Shadow FallThe Next-Gen Dynamic Sound System of Killzone Shadow Fall
The Next-Gen Dynamic Sound System of Killzone Shadow Fall
 
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of GamesKillzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
 
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationTaking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next Generation
 
Killzone Shadow Fall Demo Postmortem
Killzone Shadow Fall Demo PostmortemKillzone Shadow Fall Demo Postmortem
Killzone Shadow Fall Demo Postmortem
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow Fall
 
A Hierarchically-Layered Multiplayer Bot System for a First-Person Shooter
A Hierarchically-Layered Multiplayer Bot System for a First-Person ShooterA Hierarchically-Layered Multiplayer Bot System for a First-Person Shooter
A Hierarchically-Layered Multiplayer Bot System for a First-Person Shooter
 
Practical Occlusion Culling on PS3
Practical Occlusion Culling on PS3Practical Occlusion Culling on PS3
Practical Occlusion Culling on PS3
 
Release This! Tools for a Smooth Release Cycle
Release This! Tools for a Smooth Release CycleRelease This! Tools for a Smooth Release Cycle
Release This! Tools for a Smooth Release Cycle
 
Killzone 2 Multiplayer Bots
Killzone 2 Multiplayer BotsKillzone 2 Multiplayer Bots
Killzone 2 Multiplayer Bots
 
Automatic Annotations in Killzone 3 and Beyond
Automatic Annotations in Killzone 3 and BeyondAutomatic Annotations in Killzone 3 and Beyond
Automatic Annotations in Killzone 3 and Beyond
 
The Creation of Killzone 3
The Creation of Killzone 3The Creation of Killzone 3
The Creation of Killzone 3
 
The PlayStation®3’s SPUs in the Real World: A KILLZONE 2 Case Study
The PlayStation®3’s SPUs in the Real World: A KILLZONE 2 Case StudyThe PlayStation®3’s SPUs in the Real World: A KILLZONE 2 Case Study
The PlayStation®3’s SPUs in the Real World: A KILLZONE 2 Case Study
 
Killzone's AI: Dynamic Procedural Tactics
Killzone's AI: Dynamic Procedural TacticsKillzone's AI: Dynamic Procedural Tactics
Killzone's AI: Dynamic Procedural Tactics
 
The Guerrilla Guide to Game Code
The Guerrilla Guide to Game CodeThe Guerrilla Guide to Game Code
The Guerrilla Guide to Game Code
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2
 
Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 

Putting the AI Back Into Air: Navigating the Air Space of Horizon Zero Dawn

  • 1. Putting the AI back into Air Navigating the Air Space of Horizon Zero Dawn Game AI North Copenhagen, October 17, 2017 Wouter Josemans Guerrilla Games
  • 2. Contents • Introduction • Problem Specification • Navigation Data Generation • Path Planning • Path Smoothing/Following • Gameplay/AI System Interactions • Conclusion
  • 3. Introduction • Guerrilla – Studio in Amsterdam – Previously known for Killzone games – Team of around 250 people in total • Horizon Zero Dawn – Large, open world game – Robotic wildlife – Flying enemies – AI programmers: around 10 people during peak development
  • 5. Problem Specification • Flying agents should be able to fly from point A to point B in a natural looking way without flying through geometry • Navigation should support agents of more than one size • Navigation data should be memory-efficient and queries should be of similar performance to their NavMesh counterparts • Support same set of features as ground-based agents
  • 6. Considered Air Navigation Approaches • Full 3D approaches – Waypoint graphs (Used in previous projects) – Regular voxel grids (too expensive for games) – Sparse Voxel Octrees (as used in Warframe [BRE17]) • Other approaches – Multiple NavMesh layers with flight connections in between – Height maps (which we ended up using)
  • 7. Height Maps • A height map maps the 𝑥, 𝑦 coordinates of a position to a height • World positions are discretized in square blocks on the height map called cells • Cells of a height map have a certain size depending on the agent • In Horizon, the height map describes the highest piece of collision for that cell - There’s only one height per cell (can’t fly underneath arches) + In general height maps are easy to work with and cost a lot less memory than many alternatives
  • 8.
  • 9.
  • 10.
  • 11. Height Map Generation • Generate at runtime • Cells are grouped together in tiles, the minimum generation unit • Minimum flying height is determined by finding the highest piece of collision in that cell, and adding the agent radius on top of that • Agents have a generation bubble around them, so height map is only generated for tiles that lie within a generation bubble • Generation gets callbacks from the streaming system, so tiles are updated when things are streamed in/out
  • 12. Height Map Generation • Each tile is generated in a separate job: – Find all physics polygons in a tile – For each poly • Rasterize the polygon to the cell grid • Cell height becomes the maximum of the poly’s height and the current height – Dilate the height map by the agent radius using the van Herk–Gil–Werman algorithm [HER92, GIL93]
  • 13. Height Map Queries • “Safe Height” queries – Height map lookup • Raycasts – Bresenham’s line drawing algorithm [BRE65] for finding cells, then checking intersections • Path queries – Full path planning algorithm
  • 14. Path Planning - Considerations • If start and end position lie above the height map, we know that there is always a path • However, we don’t want to fly over a mountain if going around it would be much faster • So we can not simply fly from start to end, going up or down when needed
  • 15. Path Planning • A* on a discrete regular grid with non-uniform cost • No diagonal transitions • Change height if necessary when transitioning to a neighbor • Node: – Tile XY, cell XY coordinates – Expansion Height (not necessarily the height map height at the node’s position) N W C E S
  • 16. Path Planning • Estimated cost between two nodes is Euclidean XY distance • Actual cost of going from 𝑥1, 𝑦1 to (𝑥2, 𝑦2): • If ℎ(𝑥1, 𝑦1) higher than ℎ(𝑥2, 𝑦2): XY distance • If ℎ(𝑥1, 𝑦1) lower than ℎ(𝑥2, 𝑦2): XYZ distance • Penalize going up, but not going down • Set the Expansion Height for node B to max(ℎ(𝑥1, 𝑦1) , ℎ(𝑥2, 𝑦2)) • Goal is reached when in the right cell, then a final path node is added to the goal height
  • 17. Path Planning - Results • Approach worked well in terms of resulting paths • Unfortunately, we soon ran into performance issues: – Algorithm does not scale well with distance – For large parts of the search space, costs are actually uniform and then there exist many equally good paths, as described in [HAR11], which leads to the expansion of lots of nodes
  • 18. Path Planning • So: performance not satisfactory (having to sacrifice height map detail for performance gain was not something we wanted to do) • Need something more sophisticated: Jump Point Search? Non-regular grid? …Or something else?
  • 19. Path Planning • So: performance not satisfactory (having to sacrifice height map detail for performance gain was not something we wanted to do) • Need something more sophisticated: Jump Point Search? Non-regular grid? …Or something else? Our solution: hierarchical path planning over mipmaps
  • 20. Height Map Generation with Mipmaps • Use mipmaps for several levels of detail • Level 1 mipmap samples 4 neighboring cells from the original height map, sets its value as the max of these height values • Level 2 mipmap samples 4 neighboring cells from the Level 1 mipmap • Etc. • Until we get to the level where one cell is equal to one tile, so we have log2(𝑡𝑖𝑙𝑒_𝑟𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛) + 1 MIP levels
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Height Map Generation with Mipmaps • Introduces extra memory overhead: – For a 64x64 height map we add 32x32 + 16x16 + 8x8 + 4x4 + 2x2 + 1x1 cells = 1365 extra cells per tile – Roughly 33% extra memory – Acceptable overhead (initially around 150 KB for a Stormbird height map, now about 190 KB)
  • 28. Hierarchical Path Planning • Allow a fixed number of A* iterations across one query • Plan a coarse path on a higher mipmap level • Consider this as a rough path corridor, only allow expansion of nodes on lower mipmap level that lie within the corridor • Keep refining the path at lower mipmap levels until we run out of A* iterations • Return the most detailed (finished) path at the time that we run out of iterations
  • 29. Hierarchical Path Planning • Final configuration (Glinthawk/Stormbird): – Allow 1024 cycles – Plan initial path at mipmap level 3 – Refine path at mipmap level 1 and then 0 • To investigate: scale mipmap level planning policies with respect to the distance between start and end
  • 30. Hierarchical Path Planning • Pros: + There is an upper limit to the cost of path planning + We always find a path, even if we run into the upper limit + Can in theory plan really long paths • Cons: – We lose optimality because we restrict the path search – Quality of the path depends on the length of the path • We like the pros, and we can live with the cons
  • 31. Path Smoothing • Path we get from path planning is quite angular, with steep slopes • Robots flying straight up or down doesn’t look good • Algorithm: – Do a (height map) raycast from start to end – If a hit occurs, split the path in the middle, repeat the process for both segments until they are free of hits – If no hit occurs, add the segment to the final path • Misses a couple of cases, but we keep running the algorithm while flying around, so eventually the shortcuts are found
  • 32. Path Following/Air Movement • Simple particle physics: – Velocity/Angular Velocity + Acceleration/Angular Acceleration • AI drives acceleration/deceleration vector to follow the path as closely as possible • AI drives angular velocity based on flight method: – “Hover” : forward not necessarily movement heading – “Glide” : forward always in movement heading • Mostly code driven movement, animation driven movement during certain animations (e.g. landing) • Drive certain movement animation based on shape of the path
  • 33. Interactions with other AI Systems On Ground In Air CollisionAvoidance (Entities) ✓ ✕ Position Evaluation ✓ ✓ Area Restrictions Convex hulls Cylinders only Formation Movement ✓ ✕ Melee Attack System (Clamping) ✓ (NavMesh) ✓ (Physics) Combat System (ticketing) ✓ ✓
  • 34. Flying Behaviors • Transitioning from air to ground and vice versa • Landing: – Generate candidate positions on the NavMesh – Filter positions where height map is more than on agent radius higher – Adjust the angle of approach – After landing, switch from air to ground-based movement • Guided crashing: – Special state when knocked down or killed – Find landing position in the direction of the velocity
  • 35. Flying Behaviors • Dive Attack – Stormbird flies up high into the sky – Dive straight at the target, crashing into the ground at its position – Fly in front of the sun/moon for added effect
  • 36. Conclusion • Representing flyable air space using a height map proved to be sufficient for the environments in the game • Regular-grid planning proved to not scale well in performance terms • Hierarchical queries on mipmaps offer a good trade-off between finding a natural looking path and keeping performance at an acceptable level • Air navigation was relatively easy to integrate into our gameplay systems, but for some cases (such as collision avoidance) work remains to be done
  • 38. Citations • [BRE17] D. Brewer, 3D Flight Navigation Using Sparse Voxel Octrees, Game AI Pro 3, 2017 • [BRE65] J. E. Bresenham, Algorithm for computer control of a digital plotter. IBM Syst. J. 4, 1965 • [HAR11] D. Harabor, A. Botea, and P. Kilby., Path Symmetries in Uniform-cost Grid Maps. In Symposium on Abstraction Reformulation and Approximation (SARA), 2011. • [GIL93] J. Gil and M. Werman. Computing 2-d min, median, and max filters., IEEE Transactions on Pattern Analysis and Machine Intelligence, 15(5):504.507, May 1993. • [HER92] M. van Herk. A fast algorithm for local minimum and maximum filters on rectangular and octagonal kernels. Pattern Recognition Letters, 13(7):517.521, July 1992

Editor's Notes

  1. 250 people in studio, plus 120 outsource artists, 80 QA
  2. In the trailer, we saw two flying enemies, both are quite different in scale. Note that the larger bird does not only fight the player while flying, but can also land and fight there.
  3. Could not find a lot of literature on air navigation approaches in video games Full 3D navigation is quite expensive, unless you have a very sparse representation of your data -> Warframe by Daniel Brewer However, we felt this approach was complex and were not sure if it was going to be the best fit for our kind of terrain Height map approach is simpler computationally and possibly cheaper memory-wise
  4. Since we have a large open world, where most encounters happen outdoors under mostly open skies, these restrictions were acceptable for us Another drawback is that it is not easy to represent an upper limit to how high a robot can fly
  5. Glinthawk height map
  6. Stormbird height map
  7. So what can we do with a height map? Well, we can do a number of queries: Safe height query returns the minimum safe flying height at an X, Y position in the world Raycast checks if and where a line going from A to B intersects with the height map
  8. For diagonal transitions: if N and W are both much higher than C, then the NW neighbor can not be reached without changing height or passing through the AirNav
  9. Due to path symmetry, many paths are equally good Non-regular grid would not give us a lot of performance gains, since our artists generally don’t make flat (or uniform) surfaces
  10. Due to path symmetry, many paths are equally good Non-regular grid would not give us a lot of performance gains, since our artists generally don’t make flat (or uniform) surfaces
  11. On 64x64 tiles, we have 2^6 tiles, plus one more for cell == tile case MIP = multum in parvo (much in little)
  12. On 64x64 tiles, we have 2^6 tiles, plus one more for cell == tile case
  13. MIP level 0, 4 tiles of 16x16
  14. MIP level 1, 4 tiles of 8x8
  15. MIP level 2, 4 tiles of 4x4
  16. MIP level 3, 4 tiles of 2x2
  17. MIP level 4, 4 tiles of 1x1
  18. Converges to 1/3 as shown by Archimedes Stormbird: typically 9 tiles active, of 64 x 64 resolution x 4 bytes per float
  19. In practice, we found that paths don’t lose a lot of detail, especially in the environments where we have our encounters Forested areas are the most problematic, but we did not have
  20. Hover = like a helicopter, Glide = like a plane
  21. Collision Avoidance was never necessary, due to the way our claiming system works (two robots passing through each other in movement was not really noticed) and robots are positioned by the group We clamp on physics instead of Nav because otherwise the melee attacks wouldn’t be able to reach the player on uneven terrain Combat system: we had problems with ground-based robots indicating which one was actively attacking you, but for flying robots this was easy to communicate by having the non-attacking ones circle around the player, while the attacker tries to hover in front of your face
  22. We do not reason about ground navigation while in the air other than for generating landing positions. We cannot chain ground based and air paths at the moment. Dying while in the air: going straight into ragdoll did not look good, and game design preferred the robot to land on a reachable bit of geometry (in practice this was often quite obvious, and broke immersion for some players, but they did appreciate the fact that their loot didn’t go to waste)
  23. Representing flyable air space as a height maps also costs less memory