The AI of Horizon Zero Dawn | Part 2: Metal Militia | AI and Games #38
Key Takeaways
The video analyzes the AI systems used in Horizon Zero Dawn, including agent hierarchy, collective systems, and navigation tools, and explores how these systems enable dynamic movement and behavior in machine animals and human NPCs. The game utilizes various techniques such as hierarchical task network planners, sensor systems, and navigation meshes to create a realistic and immersive gaming experience.
Full Transcript
[Music] in part one of my case study on horizon zero dawn guerrilla games 2017 PlayStation 4 exclusive I explored her the game is built to create herds of AI controlled machine animals this requires a complex agent hierarchy system where each machine can make decisions about how to behave using a hierarchical task network planner but also groups agents together to dictate their roles and responsibilities as part of a herd this is all part of a system known as the collective which maintains the eco system of all machines in the world as you're playing it I'm Tommy Thompson and welcome back to AI in games in this closing part of my analysis of the AI in horizon zero dawn we're going to look more closely at the systems that each individual machine can utilize as part of their core behavior this includes the wakes of sensor systems navigation for both land and air machines and how execution of AI behavior is heavily tied into the animation systems to give each machine an unsettling and realistic behavior [Music] so first up let's take a look at the sensors used by machines to trigger AI responses as well as her animation ties into the overall execution of their behavior there are a significant number of unique sensors that a machine can use visual sensors such as the Watchers eye to radar and proximity sensors on long legs Auto sensors that can hit a range of sounds such as explosions at a distance to stone-throwers close by as well as the ability to send players colliding with them directly and in some cases a sense of smell each machine has a collection of these sensors with each calibrated to have their own sensitivity values make it easier to sneak up on sale watcher or grazer but a lot more challenging to catch a stalker unawares now a traditional sensor system might just enable for events to occur around an AI and they either see it hear it or nothing but the sensor systems are actually a lot more nuanced and this is achieved through information packets that are attached to the objects that can cause a variety of stimulus in one of the machines sensors these information packets can be attached to things such as the player other human NPCs rocks fired arrows other machines and wildlife the data and information packet tells the receiver the machine that sends something information about what it is that it detected and its state hence machines as well as human NPCs can tell the difference between a dead body lying in front of it and an arrow that whizzed past their head and missed them but also helps ensure that things such as the player hiding in long grass or behind trees cannot be spotted each AI character machine and human alaik can handle an interpret sensory data in a different way so certain information might be ignored by some characters whereas others react to it promptly in fact depending on the strength of a sensor on a given machine can actually reduce the data from the packet that can be read this helps manage the emergent properties of the game such that each character type responds to information in their own unique way now shooting AI make a decision based on the sensory data we've still got to make sure that looks realistic so when a machine has decided to make any action such as moving to a new location investigating a disturbance or attacking the player that is still the issue of animating at during execution such that it looks as realistic as possible the animation of these machines is a big challenge given that they need to be able to look like their animal inspirations but also have a distinct machine lake behavior at times this requires both the navigation and combat systems to pay attention to the distance the machine is going to traverse and the animation till gene then adjusts route bones of animations and warps them to suit based on the perceived distance and time left this ensures that regardless of how far the machine is moving and how fast it's doing so it can start the animation move into the main part of the behavior and then blend it correctly at the right time this is important for things such as running two points but it's even more relevant in combat many of the animations used for attacks have two distinct sequences there's the windup which Telegraph's the attack to the player followed by the Big Finish where the damage is dealt horizon zero dawn uses a similar method to that discussed in my video and the AI of doom 2016 where the system controls the current locomotion of the machine blends movement or attack animations to suit at specific points and then ensures that the machine lands or stops in the right place at the end now there's still one big issue I haven't yet talked about and that's navigation ensuring these machines can wander around the environment as a real challenge given this large variety of unique enemy types are all different sizes and shapes so they need to be able to move through terrain in a way that makes sense for them but also they need to be able to recognize changes in local geometry and adapt to that or simply ignore it depending on their type now as I detailed in a recent AI 101 episode this requires a commonly used AI tool known as a navigation mesh a nav mesh stores information about how a given character can move across the map based on what are perceived to be obstacles in the world while you can calculate it at run time they're often bill or baked before the game is released and loaded into memory when necessary however given horizon zero dawn has such a large map and only specific segments of it irrelevant at a given point in time since the AI are only active and moving around if they're near you the navigation mesh is built at runtime but only around the immediate region of the player but the thing is there isn't just one nav mesh there's six of them four of them cater for character movement based on the size of the object small medium large and extra large hence humans can move around in the small mesh alongside Watchers while the lakes of the Thunder Joe has a nav mesh pretty much all to itself plus there are two extra nav meshes one for swimming machines such as the snap mod as well as a unique mesh that ensures machine standing good locations should the player be trying to mount them in each case obstacles can block or alter a navigation meshes structure and the system recomputes changes in real time such that moving obstacles and even other machines can impact the ability to move around the space what's interesting about this is that obstacles have differing properties and can either prove to be completely impossible or simply undesirable to walk across but much of that is dependent on the state of the machines AI behavior as mentioned in part one machine patrols actively avoid stealth vegetation when generated but when investigating local disturbances well grass is still considered undesirable it will walk through it if necessary the same principle actually applies to large rocks and trees these are impassable obstacles except for larger machines such as behemoths rock breakers and Thunder jaws these beasts can smash rocks apart and uproot trees but only after in an angered state or giving chase to the player I say to that behavior they'll treat them just like any other obstacle [Music] why all this navigation tool chain caters to land-based machines of all shapes and sizes it doesn't work at all for those that are based in the air non-player characters that move through the air not only have to be aware of the nearby obstacles on the ground so except they don't crash into trees or cliff faces but they also need to be weary of the elevation of nearby geometry the world of horizon zero dawn is full of Rolling Hills forests rock outcrops and steep mountain claims for the two flying machine types the glint Hawk and the storm bird they need to know how to navigate the air such that they can take off fly a patrol route land and also swoop down and attack the player when necessary to achieve this the game not only has the navmesh system on land but a completely separate navigation system in the air this proved to be a challenge for the AI team on the game but they found a really creative solution the technique used is known as hierarchical path planning over MIT Maps MIT mapping is a technique actually used in computer graphics the aims to minimize the memory overhead of a texture or images by providing a collection of the same image gradually loading and resolution it's typically used for managing level of detail in games so the objects hundreds of meters away can be visible but use less texture memory than those directly in front of the player where you need to be able to see them in the highest quality possible-- this approach was considered given that when a machine is flying a path around the world it doesn't need to know with complete accuracy the local geometry of where it will be a minute from now but it really needs to know the lay of the land immediately around it should it decide to land the path planning system for aerial machines uses mipmapping for the height map of local geometry a data structure that tells us the elevation of a given X Y position of the world with four levels as they move down from top to bottom becoming increasingly more complicated and realistic level three is the simple and abstract model while map level zero is a pretty accurate height map of the endgame world much like the navigation mesh the map maps are built at runtime when needed given a machine doesn't need to know the entire world's elevation data when flying within a fixed region when they need to fly to our location the flying navigation AI starts by using the a-star search algorithm over the highest level of map map hence it calculates the simplest version of its flight path against a very rough model of the geometry the a star makes flying up and over obstacles more expensive than flying around them and shall see machines glide around mountains and cliff tops more often than fly over them each time it calls the a-star algorithm it only has a fixed number of iterations so once the path is completed on the simplest map map up in level 3 it will then take a given segment of the path that calculated and refine it by borrowing down to map map levels 1 and 0 to make it more realistic and respect the geometry more accurately plus it then smoothes the path though such that it removes steep slopes or sharp tones and order to make it feel more natural the system works really well given to any flying machine that is in the air always has a flight plan even when most of it is rubbish in quake route and then it can boil it down to something more practical by repeatedly calling the search algorithm to refine the path to become more and more realistic it's also quite memory efficient but it does have one caveat in that given its based on the maximum height of a given region of the map they cannot fly under bridges or rock outcrops but much of the time as a player you won't really notice it between the land-based nerve mesh and the air based net maps flying machines can then coordinator how to attack land dive attack and even crash in a way that respects the geometry machines that are hovering above the player while attacking are still using the pre calculated flight plan only it's not necessarily moving directly forward along that path and plays the corresponding hover animation the velocity the machine is tied to whether it's flying gliding or hovering and as such they can suckle you in the air in a realistic fashion all the while still using the same navigation tool takeoffs and landings use a separate system that communicates between the flight navigation and ground-based navigation mesh it searches for a valid position on the nav mesh it can land on typically points that are slightly higher off the ground than the local average and then adjusts angles and velocity accordingly once it's landed it's now using the corresponding nav mesh based upon the machines size the same principle actually applies to when they crash - except this time the only valid landing positions are based on the machines current heading and while it might look less graceful it's fundamentally using the same tools the specifically programmed edge case for this is the Budds dive attack storm birds will circle the player then come crashing down towards you at your current position it's using the same systems but in a much more dramatic fashion however one added cavea has been circling the player the storm bird will often wait until it can block out the Sun or moon before making the attack you may have noticed this when playing the game yourself and it is intentional during testing of the storm bar the eye the QA team noticed that it would periodically block the Sun based on where you were standing and this made the attack all the more disorienting as the light shifted and blinded you during the dive at that time it was purely accidental but afterwards the AI team went out their way to ensure it does it more frequently and deliberately [Music] horizon zero dawn delivers an experience unlike anything seen before as a world teeming with mechanical life plays host to the tales of alloy and the mysteries of our past the AI in gameplay systems of the machines are critical in building this apocalyptic future for players to explore as we've seen over the past two videos this was a tremendous effort by a team of around 10 people through several years of development delivering AI systems at the scale that works well and massive open world games is only becoming increasingly more difficult as games continue to increase in scale hence it's vital for the game development community that these good practices are shared with the wider world such that we can learn from one another plus it's fun to learn about how games work and to appreciate the efforts of those who work so hard to bring you giant mechanical Tyrannosaurus you can fight while riding on robotic horse by I mean how cool is that thanks for watching this case study series on the AI of horizon zero dawn here on AI in games hope you found it interesting and can either put this knowledge to use in your own games or just found it fun horizon zero dawn is one of the most voted for topics by patrons by my supporters over on patreon by supporting my work you can watch these videos early get updates on future content decide what topics are covered next and other behind-the-scenes insights thanks once again to all my patreon supporters with a special show o to log install maker Joie DiGiorgio Samuel Kendal Risinger huizinga I think and Chris Evers next month is the 5 year anniversary of my launching a eyeing games and I'm celebrating with something special late last year I was invited to a triple a studio here in the UK and spent a day hanging out with the gameplay programmers of our recent 2018 release and interviewed them for hours talking about all of the AI in their game I've got so much to talk about I can't wait to share it with you I'm super excited and I hope you are too I'll see you then [Music]
Original Description
In this closing video of my case study on the AI of Guerilla Games 'Horizon Zero Dawn', I explore the AI systems used by individual machines. How sensors systems are calibrated uniquely for each machine type and the range of navigation tools that enable for dynamic movement both on land and in the air.
--
You can read the article based on this video on the AI and Games website:
http://www.aiandgames.com/hzd-part2/
--
This video is inspired by the following developer talks:
"Beyond Killzone: Creating New AI Systems for Horizon Zero Dawn"
by Julian Berteling, GDC 2018.
"The AI of Horizon Zero Dawn"
by Arjen Beij, Game AI North 2017.
"Putting the AI back into Air: Navigating the Air Space of Horizon Zero Dawn"
by Wouter Josemans, Game AI North 2017
--
AI and Games is series on research and applications of Artifical Intelligence in video games. It's is supported through and wouldn't be possible wthout the wonderful people who support it on Patreon.
http://www.patreon.com/ai_and_games
http://www.paypal.me/AIandGames
http://www.ko-fi.com/AIandGames
--
Get yourself an AI and Games t-shirt over on Teespring!
https://teespring.com/stores/aiandgames
You can follow AI and Games (and me) on Facebook, Twitter and Instagram:
http://www.facebook.com/AIandGames
http://www.twitter.com/AIandGames
http://www.instagram.com/aiandgames/
http://www.twitter.com/GET_TUDA_CHOPPA
--
Music in this video from the Horizon Zero Dawn soundtrack by Joris De Man.
#HorizonZeroDawn #gamedev #AI
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from AI and Games · AI and Games · 33 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
▶
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Evolving Particle Weapons in Galactic Arms Race | AI and Games #04
AI and Games
Pac-Man AI Research and Competitions | AI and Games #06
AI and Games
The Behaviour Tree AI of Halo 2 | AI and Games #09
AI and Games
Researching Super Mario Bros. Level Design | AI and Games #10
AI and Games
Teaching Robots to Play | AI and Games #12
AI and Games
The Quest for AI Game Designers | AI and Games #13
AI and Games
HTN Planning in Transformers: Fall of Cybertron | AI and Games #14
AI and Games
The AI of Alien: Isolation | AI and Games #15
AI and Games
Status Performance Analysis in Team Fortress 2 | AI and Games #17
AI and Games
Training the Shadow AI of Killer Instinct (2013) | AI and Games #18
AI and Games
Resurrection & Reverence: The Return of DOOM | Design Dive
AI and Games
Left Behind on LV-426 - The Design of Aliens: Colonial Marines | Design Dive
AI and Games
Games By ANGELINA, the AI Game Designer | AI and Games #20
AI and Games
Prepare to Die by Simple AI - Dark Souls and Difficulty | Design Dive
AI and Games
Looking for Love on Pandora: PCG and Borderlands 2 | Design Dive
AI and Games
The AI of Shogun: Total War | AI and Games #21
AI and Games
The Campaign AI of Total War: Rome II | AI and Games #23
AI and Games
AI 101: Monte Carlo Tree Search
AI and Games
The Diplomacy AI in Total War: Attila | AI and Games #24
AI and Games
A History of AI Research in StarCraft | AI and Games #26
AI and Games
Dota 2, MOBA's and the Future of AI Research | AI and Games #27
AI and Games
Procedural Level Generation in Sure Footing | AI and Games #28
AI and Games
Behind the AI and Storytelling of Spec Ops: The Line | AI and Games #29
AI and Games
The AI of DOOM (2016) | AI and Games #30
AI and Games
Machine Learning Analysis of Player Behaviour in Tomb Raider: Underworld | AI and Games #31
AI and Games
How A Navigation Mesh Works in 3D Games | AI 101
AI and Games
How Halo 3 Builds Large-Scale AI Battles | AI and Games #33
AI and Games
Enemy AI Design in Tom Clancy's The Division (Part 1 of 2) | AI and Games #34
AI and Games
Building the Online World of Tom Clancy's The Division (Part 2 of 2) | AI and Games #35
AI and Games
Behaviour Trees: The Cornerstone of Modern Game AI | AI 101
AI and Games
Why Friendly AI Cheat in Ghost Recon Wildlands | AI and Games #36
AI and Games
The AI of Horizon Zero Dawn | Part 1: Rise of the Machines | AI and Games #37
AI and Games
The AI of Horizon Zero Dawn | Part 2: Metal Militia | AI and Games #38
AI and Games
Augmented Reaction: Vanquish - 9 Years Later | Design Dive
AI and Games
Building Mario Levels with Machine Learning | AI and Games #39
AI and Games
The AI of Half-Life: Finite State Machines | AI 101
AI and Games
Building a Pirate's Paradise in Sea of Thieves | AI and Games #40
AI and Games
The Secrets of Skeleton and Shark AI in Sea of Thieves | AI and Games #41
AI and Games
How Megalodon, Kraken and Skeleton Ships Haunt the Sea of Thieves | AI and Games #42
AI and Games
How Rare Tests Sea of Thieves to Stop Bugs Reaching Players | AI and Games #43
AI and Games
The Legacy of GoldenEye 007 | Design Dive
AI and Games
The Secrets of GoldenEye's AI Revealed | AI and Games #44
AI and Games
Sandbox Assassin: The AI of Hitman (2016) | AI and Games #45
AI and Games
The Dangers of AI, Microtransactions & Lootboxes | Design Dive
AI and Games
Minecraft Villages Built by AI - The Generative Design in Minecraft Competition | AI and Games #46
AI and Games
The Secret Reward Systems of Dark Souls II | Design Dive
AI and Games
Why Adding Bots to Fortnite Was a Great Idea | Design Dive
AI and Games
The Best Games Engines for AI (2019) | AI 101
AI and Games
How Atriox Can Beat You in Halo Wars 2 Without Cheating | AI and Games #47
AI and Games
How AlphaStar Became a StarCraft Grandmaster | AI and Games #48
AI and Games
Why AlphaStar Does Not Solve Gaming's AI Problems | Design Dive
AI and Games
Designing the Enemy AI of Tom Clancy's The Division 2 | AI and Games
AI and Games
Bringing Washington D.C. to Life: The AI of Tom Clancy's The Division 2 | AI and Games
AI and Games
The Secret AI Testers Inside Tom Clancy's The Division 2 | AI and Games
AI and Games
DOOM 64 Revisited | Design Dive
AI and Games
The Story of Facade: The AI-Powered Interactive Drama | AI and Games #49
AI and Games
Building the AI of F.E.A.R. with Goal Oriented Action Planning | AI 101
AI and Games
Revisiting the AI of Alien: Isolation | AI and Games #50
AI and Games
How Splinter Cell: Blacklist Builds Balance for Stealth | AI and Games #51
AI and Games
Endure and Survive: the AI of The Last of Us | AI and Games #52
AI and Games
More on: Research Methods
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
I Spent Weeks Looking for a Research Gap Before I Realized I Was Searching the Wrong Way
Medium · AI
ICMI 2026 Reviews [D]
Reddit r/MachineLearning
Workshop submission for main conference paper under review [D]
Reddit r/MachineLearning
Kept context-switching between arxiv, OpenReview, GitHub, and HuggingFace for every paper, so I built this. Chrome extension + website with everything inline, plus citation graph + SPECTER2 neighbors. 3M papers, free, feedback welcome [P]
Reddit r/MachineLearning
🎓
Tutor Explanation
DeepCamp AI