Endure and Survive: the AI of The Last of Us | AI and Games #52

AI and Games · Beginner ·📄 Research Papers Explained ·6y ago

Key Takeaways

The video analyzes the AI systems in The Last of Us, a third-person action-adventure game, focusing on finite state machines, skills and behaviors, and combat coordination systems. The game's AI was designed to create an emotional weight for the player, making enemies feel real and believable.

Full Transcript

[Music] the Last of Us is one of Playstations most revered titles players must guide Joel and Ellie through a world left in ruin as rogue factions of humanity war with one another all the while the fungal brain altering virus that has swept the globe transforms the infected into violent mindless creatures it's a game driven by cinematic spectacle of human stories set against an inhuman reality the more players take charge of cynical and embittered Joel artificial intelligence helps put together the rest of the dramatic performance be a lie enemy or infected I'm Tommy Thompson and in this episode of AI in games we're going to explore the inner workings of the Last of Us the design philosophies that drove its development the AI technologies adopted and her developers Naughty Dog crafted an experience where players were made to feel the emotional weight of every enemy kill [Music] the Last of Us is a third-person action-adventure game with a large focus on cover shooting and stealth as you make your way across post-apocalyptic America players come into contact with two types of opposing forces hunters the humans who patrol in control regions of territory or in the country and the infected the mindless crazed creatures that are all that remain of the was consumed by the fungal plague as the game began development in 2009 one of the earliest design principles was ensuring that players recognize the dramatic impact of taking another life in a world built atop those that had fallen when we started prototyping the human enemy AI we began with this question how do we make the player believe that their enemies are real enough that they feel bad about killing them answering that one question drove the entire design of the enemy AI answering that question required more than just hiring the best voice actors the best modelers and the best animators although it did require all of these things it also required solving an AI problem because if we couldn't make the player believe that these roving bands of survivors were thinking and acting together like real people then no amount of perfectly presented mocap was going to prevent the player from being pulled out of the game whenever an NPC to cover on the wrong side of a doorway or walked in front of his friends line of fire hence there's a need not just for the hunters to appear intelligent coordinated and ruthless but also for the infected to feel just as if not more threatening thanks to their more chaotic and aggressive behavior on top of all this there is of course Ellie the young woman who Joel is tasked with providing safe passage across the country to the fireflies Ellie is in many respects the player's avatar within the story unlike Joel who is all too aware of the horrors of the outside world Ellie has no idea what awaits beyond the quarantine walls of Boston she reacts to the world and the drama that unfolds as and when it happens and it was critical that players developed a relationship with her in much the same way that Joel does building each of these types of AI characters such that they fit both the needs of gameplay as well as the drama is no easy task so let's quickly look at the underlying AI tools used in the Last of Us before being dig deeper into each character type yet another veer ma this way before I can explain how the different AI characters behave in the last of us I need to take a moment to explain the underlying architecture that they're built upon but more critically I need to explain why Naughty Dog built it the way that they did The Last of Us utilizes an AI technique known as finite state machines a long-established approach to crafting AI behaviors as previously detailed in my AI 101 episode on the topic FSM were popularized by half-life back in 1998 as means through which to structure individual intelligent behaviors as unique States this means a character could be attacking a target or searching a location until an event triggers in the game that forces the character to transition from one state to another if you want to know more about the inner workings of finite state machines go check out that video the AI of the Last of Us is built around the idea of skills and behaviors skills are high-level ideas of what a character might be doing for a hunter this could be investigating a disturbance hiding behind cover or flanking the player meanwhile for the infected this could be wandering around the map or giving chase to an opponent in each of these cases they use smaller more specific actions in the world be it moving to locations interacting with or reacting to objects in the world all in order to make that skill look more intelligent and that's where the behaviors kick in behaviors are specific concrete actions that all characters might execute but how they do it well differ from one another hence if a character is moving from A to B or attacking the player with a melee attack how they complete those actions and the animations performed will differ if they're a human hunter or an infected clicker the idea is that behaviors are reusable and it's only when they're executed by different characters you see how the exact same action is performed differently each skill which acts as a state within the finite state machine contains its own state machine comprised of behaviors this hierarchical approach is a well-worn technique for behavior management and I discussed how this is still used in games as recent as the 2016 reboot of doom back in episode 30 but the critical part of all of this is that each skill and behavior is modular and contained in and of itself by building a more modular and decoupled system allows for a lot of iteration by designers without overwhelming the programmers with feature requests or the need for bespoke tweaks and certain parts of the C++ code base thus allowed for a lot more development energy and time to be focused on playtesting each character type ensuring it works as intended refining features rapidly prototyping new ideas or just outright scrapping ones that weren't working all the while striving to achieve the design goals I mentioned earlier the best way to approach these goals is to make our characters not stupid before making them smart characters give the illusion of intelligence when they are placed in well-thought-out setups are responsive to the player play convincing animations and sounds and behave in interesting ways yeah all of this is easily undermined when they mindlessly run into walls or do any of the endless variety of things that plague AI characters not only does eliminating these glitches provide a more polished experience but it is amazing how much intelligence is attributed to characters that simply don't do stupid things as a general rule characters don't need complex high-level decision-making logic in order to be believable and compelling and to give the illusion of intelligence what they need is to appear grounded by reacting to and interacting with the world around them unbelievable ways but even with a good suite of tools available it doesn't mean that the game will come together without continued experimentation as Naughty Dog's sought to achieve their design vision numerous elements of the friendly and enemy AI were drastically altered or revised during production with some of the enemy archetypes and even Ellie's final behavior system only coming together in the closing five months before the game was launched on PlayStation 3 back in 2013 so now that we know how the core architecture of the games AI works let's take a look at how each of the character types was designed in the last of us so first let's take a look at the human enemies known as the hunters the hunters are designed such that each and every one of them should be a credible threat that without consideration in care they could easily kill you but also that they put up a fight and return and are not mere cannon fodder the hunters are designed to appear coordinated to systematically hunt down and eliminate the player all while caring for their own personal safety but also crafted such that they communicate their behavior allowing the player to respond in kind a lot of the core principles I'm about to explore has overlaps not just with the design pillars for stealth explored an episode fifty ones analysis on Splinter Cell blacklist but also with the search and sensor systems of alien isolation which I revisited back in episode 50 so if you find this stuff interesting be sure to go back and watch those two videos as well one of the first things to talk about is how the hunters and other AI can detect the player in the world the hunters have both vision and audio sensors to detect disturbances in the world they run on what is arguably the default audio and visual sense levels and as we'll see later in this video the sensitivity of sensors has changed quite drastically for each of the four infected archetypes first up let's talk vision NPCs will use a view cone a point discussed heavily in my recent episodes for detecting the player within the space the last of us originally used the same view cones adopted by Naughty Dog for the Uncharted series but this didn't really work players were spotted too quickly at a distance but also could largely go unnoticed at close range they didn't fit the pace of the game and hence the view cones used in the last of us much like Splinter Cell blacklist are not cone-shaped while in Splinter Cell they look more like a coffin and the last of us it's sort of like a keyhole but in each case it's the same concept both provide greater peripheral vision while distant vision is much narrower in addition like other stealth games the player isn't spotted immediately upon standing in the view cone you have to stay there for a period of time before the hunter will see you typically 1 to 2 seconds with it being even shorter in combat to reflect the higher state of awareness in addition much like Splinter Cell any non per character that has the player in their view runs an additional sight test in order for the detection timer to increase each NPC runs our ray cast from their position to one on Joe's body to see if anything blocks their view originally a character would run recast to each joint in Joe's body but it was rather inefficient and ultimately unnecessary eventually the team created two conditions one where the raycast is aimed at the center of Joel's chest if the player has not been detected yet or the top of his head when in combat it's simple but it was found to work really well in addition to this the hunters can hear noises at different levels of severity and priority but I'm going to come back to this when I discuss the infected given sound is more critical to them than vision referring back to the skills discussed earlier the hunters have different skills they can execute as we can see here most of them are built around combat with range and melee attacks flanking and advancing behaviors but most combat sequences in the last of us start with the player in stealth mode and it's only if they're detected too many of these skills kick in so let's focus on the two that are critical for stealth investigate and search investigators a behavior used when a hunter is checking out a disturbance this could be a bottle or brick that's been thrown and making a noise or they see a flashlight in the distance meanwhile search is when the player has been detected or the hunters already know the player is nearby and they start to systematically explore the world to find you each of these behaviors relies on four key subsystems a combat coordination system that gives roles to each character deciding which behaviors they should execute a navigation map which shows the fastest way to navigate around the world within proximity of the character an exposure map that sits on top of the navigation map that shows information about what the NPC can see from their current position and lastly a cover point system that identifies not just due to cover points for calm but also points for playing specific animations and behaviors so let's walk through how these systems allow for the investigate and search skills to work when a hunter needs to execute the investigates skill the request that the combat coordinator give them the role of investigator the system limits how many of a given role are assigned hence in shooting if you throw a break that five enemies don't all investigate it at once so while one NPC will become the investigator others may stand around or continue as normal the NPC with the investigator role will then call the cover point system for what is known as an open post this is a location near the point of interest that satisfies specific criteria as we'll see in a moment the system can be used to request a post that provides good tactical cover but in this case it's a location that can be reached through the navigation system that's a good fit to run the investigation animations meanwhile for a search behavior the big difference is that the NPCs nearby already know that the player is somewhere in proximity they just don't know where this utilizes the coordination system to have NPCs move around the map and explore it but how they explore it needs to look systematic if they just wander around a clump then it won't look realistic or give the player a challenge hence the game relies on the navigation and exposure Maps I previously mentioned the navigation and exposure maps are grids that sit atop the navigation mesh the data structure that allows non player characters to calculate paths through the environment the navigation map allows for quick and cheap calculations of whether a path exists two locations in the immediate area around a non-player character while the exposure map shows what parts of the world nearby are visible to them using this data the system can generate what is known as a search map which shows the areas of the exposure map that are not visible but can also be reached on foot this tells the non player characters what areas of the world they need to explore because they have no coverage of them at this time at this point the coordination system then sends non player characters to search those spaces via around corners or behind cover hence if the player stays in one spot the hunters will avail chillie find you forcing you to keep moving between points of cover in both cases if a hunter then spots the player then we'll go into combat so let's walk through her cover is selected and her the combat coordinator keeps the enemies working together once the player is spotted we return to the more combat focused skills available to the hunter if they want to flank the player go into gun combat or advance to tactical locations they need a rich understanding of where the player is what areas provide good cover and where the player is aiming at that point in time and the systems I previously mentioned helped bring that together first of all an enemy might need cover how do they know where is the best cover for them again the cover point system is used but the criteria changes first of all we don't want an open post in the world we want a cover post that gives the character some protection the game runs a calculation of the 20 closest cover points in the map within radius of the character it then runs for recasts per piece of cover to assess whether the player could shoot the character from that position if it determines it's a safe location it is then ranked based on the type of cover requested whether there is a path to reach it and doesn't require the AI to walk in front of the player to get there and also whether it's a good place to hide out or attack the player from and then it simply picks the cover post with the highest score this custom calculation means that a poster is useful now might be deemed useless five seconds in the future as the player moves around so new post calculations will reflect the pace of the battle now with the cover established how did the hunters better coordinate their attack one of the first things that happens is that the game creates a reference to the location of the player a data packet is generated that retains the location of the player and the time stamp that was generated this is useful to measure how long it's been since the player was last spotted and shoot another non player character see Joel then a new data packet is generated whenever one of these packets is created is shared to other npcs in proximity as means to communicate where the player is hunters will then begin to advance towards the players location some taking cover others charging rate towards you meanwhile others may well take a flanking maneuver and catch you off guard the combat cord our balances this by assigning roles to each of the available NPCs this includes flankers approaches opportunistic shooters who just stand and shoot to the player giving you at least one active target to focus on as well as the stay up and aim er which I guess is the equivalent of an AI fish in a barrel as with the previous investigator role a character will be assessed on their validity for the position in the case of the flanker the game calculates what is known as the player's combat vector which is the direction that the player is currently facing while in combat using this vector and the navigation tools a flanker will be considered valid if they have a path that allows them to sneak up on you and does not intersect with the combat vector making that flank all the more surprising when it happens this entire process works well for the most part but is heavily reliant on the configuration of the environment if it's a tighter and enclosed combat space that will ensure the player is often forced to fight fairly quickly and combat will feel hectic and dynamic however it struggles in larger combat spaces and areas with greater verticality because it's easier for the player to lose the enemy and force them to repeatedly search for the players new location this is rather evident in the courtyard fight in Pittsburgh where Ally provides overwatch as well as the assault and the fortified houses in the suburbs this is an issue that was addressed to some extent during development as the game will force hunters to converge on the player's old position immediately should the player move more than 5 metres from the location they were last spotted without being detected this will force the search scale to kick in again much faster but it's still possible to give them the slip so now that we know how the hunters work let's take a look at the second group of NPCs players must face in the last of us the infected know that we know the inner workings of the hunters let's dig into the AI of the infected unlike the human hunters there are different classes have infected whose skills and even their sensory systems differ from one another there are the runners the fast-moving and vicious creatures they often attack in groups the stalkers who are fast moving and often ambush the player in darker regions the clickers who are completely blind and rely on their ability to hear the player to hunt them down and lastly the bloaters blind and still moving but heavily armored and require serious firepower to take them down outside of their appearance and more frenzied melee attacks the thing that really separates the AI of the infected from the hunters is their emphasis on sound as mentioned both the blotters and clickers are blind and as a result can only react to audio stimulus but also the runner and stalker have limited vision compared to regular humans meaning it takes them longer to spot you to compensate the infected audio sensors are up to six times more sensitive than hunters meaning players really need to focus on stealth and keeping their distance less they want to become Zombie fodder so let's walk through how sound works in the last of us when a sound occurs in the game such as the Smashing of a bottle or even the players movement it generates a logical event in the game world this event is broadcast over a radius assigned by designers in the case of the infected the radius is multiplied by a tunable value for each character archetype a notable example of this is player movements given that the infected are far more sensitive to movement sounds and the faster you move the radius of the sand event increases in scale as a sound is broadcasted the NPC that intersects with the radius runs a quick occlusion test by running ray casts of the local environment to see whether other objects such as walls or surfaces may have blocked it meaning that while it is in the radius the noise wasn't actually load enough to be heard now these logical sound events are generated for the vast majority of in-game zones with a real focus on movement and combat mechanics or in world items such as generators or vehicles however there are a handful of invisible audio events that generate sound in the game world that players don't hear when playing the game the most interesting example is that while you won't hear it Joel emits a very low level sound event for his breathing and is designed to help the infected find the player if they're hiding in very close proximity to counteract as players can throw bricks and bottles to create audio distractions but you can be crafty and try other approaches such as throwing molotovs which can lure end and kill a blind infected with ease or rather strangely using smoke bombs smoke bomb as the name implies creates a cloud of smoke that will obscure the vision of NPCs as well as the player it's ideal for breaking line-of-sight with hunters but in theory is useless against the clicker and blotter given they react differently to sound it's a decision that arose from in-game testing but yes if you throw a smoke bomb it not only Blaine's characters trapped in the cloud but it also makes them deaf in addition during development the infected reaction to molotovs and the damage scales were reduced given you could easily wipe out a horde of infected by throwing a Molotov in the center of the room and all of them would run towards it given they don't coordinate the responses like hunters do for the final game each Molotov can only affect a couple of non player characters at once although I still think personally it's a little overpowered so let's take a look at the infect its skillset unlike the hunters the infected skills vary for each archetype but once again are ordered by priority this makes sense given that the bloater is more focused on rage combat or the stalkers of the only class that can ambush you and catch you off guard but they all have a lot of common ground such as sleeping undisturbed wandering the local environment searching for the player and their allies and also on fire which is the highest priority skill of an infected given their you know on fire this is up there with the hunters stay up and EEMA as my favorite AI skill in this game so let's take a look at some of the more commonly used and interesting skills and then infecteds repertoire by default an infected will wander given its their lowest priority skill a designer can decide for each infected whether they follow our patrol where they visit a series of interaction points in the map or they're allowed to move randomly random movement does maintain a history of previously visited poly the navmesh so as to minimize backtracking one critical thing to note is that effort infected is on a patrol path only to be distracted by a noise or nearby combat if it's pulled too far away from the original path then it will proceed on a random wander afterwards this makes them all the more unpredictable and also prevents the unrealistic behavior of a blamed clicker doubling back to the exact same path that was on two minutes ago given so much of facing off against the infected is stealth-based how did characters such as the clicker and run our search for the player if they hear something nearby and vectored do not search for the player in the same way as hunters do they're less methodical and their approach and also less exhaustive and will return to the wandering behavior after a time but it creates something that feels more frantic and terrifying the search skill is focused upon visiting a location of a disturbance via sound or an estimation of the players current location but it triggers a prebuilt behavior unique to the infected known as canvas this is a special search behavior where an infected will quickly and unpredictably turn and observe its surroundings this behavior is like all others tied to the available set of animations that a character has but it uses these animations to dictate how the character will look around let me explain when canvassing an area and in fact it generates a grid over the local navigation map that shows what parts of the local environment it hasn't looked at think of it like the search map of the hunters it's a rather similar process the infected then looks at the search and emissions it has available such as turning its head or swinging its body around to face a particular direction for each animation that calculates how much of the unseen space it would see if it ran that animation at this point in time and picks the one that provides the best coverage it repeats this process for a period of time and will resume a wander or idle behavior afterwards it creates this unsettling expressive performance and keeps the infected from feeling too predictable really selling the terror of the situation the infected provide a completely different combat experience from the hunters but much like their human counterparts they emerged from heavily focused play testing during development the stalkers and their ability to ambush the player the only infected behaviour that utilizes cover on emerged in the closing months of development the sleep scale reduces the sensitivity of an infected sensors but is used to create centuries around choke points and other awkward geometry in fact it did not have any ability to communicate with one another but you may have noticed this sometimes follow each other either while exploring disturbances or attacking the player this is thanks to the follow skill which if one infected is heading to a location with purpose another infected can decide to follow it think of it like a conga line where only the infected at the front knows where they're actually going plus there are some tweaks to behavior to balance the difficulty when an infected chases the player they will periodically stop using their move behavior and instead use the canvass behavior this not only allows the infected to reorient itself but it gives the players a small break to get away and compose themselves plus the clickers are made to be far less aggressive on lower difficulty levels in fact as Mark bought a detailed in his chapter and game AI probe volume 2 the clickers originally had a completely different implementation of their behavior the original versions of the clickers used an echolocation system where they made noise that allowed them to build their own navigation and exposure maps like the hunters but it was built dynamically based on the sound bouncing of surfaces much like a bat does in the real world the clickers would screech and bark more frequently to allow them to update their data models as they walked around problem was that during play testing it didn't communicate well to players given it wasn't evident her a character that was blamed could no somehow see and kill them and so having explored the inner workings of all the enemy AI there is still one last topic to cover the companion AI systems and most notably how its applied to bring Ellie to life as noted in max deck offs GDC talk in 2014 there was a very real concern Ellie must not succumb to the same pitfalls of other companion AI tunneling the last of us into a 12 hour exercise and frustration and awkward escort missions before exploring the inner workings of how Ellie and other companions work it's worth noting that what we see in the final game was a system built during the closing months of development five months away from ship the existing system was scrapped and a new one was crafted that built atop a lot of the existing tools and systems used for hunters and infected the system I'm about to describe was actually programmed within six weeks with the remainder of development I'm working on specific design kinks and tuning of gameplay parameters in fact in one of the early playable press demos of the game in January 2013 the focus was on the sequence in the Tilted skyscraper after players escaped Boston's quarantine zone as players of the game will know in the sequence Tess and Ellie will lead or follow Joel through the building but the combat sequence with the infected which ultimately acts as the players first test and handling runners and clickers was designed to have your companions stay back given at that time the companion AI was unfinished and not meeting Naughty Dog's standards so let's walk through the priorities that Ellie's AI focuses on ensuring she stays close to Joel at all times and finding points in the world that makes sense to do so giving her a sense of utility be it to identify or attack enemies or protect Joel in certain situations making Ellie interesting as a character giving her special animations and dialogue and lastly ensuring the authenticity of the experience by preventing her a AI from cheating Ellie's positioning is one of the most important things to get right if she's standing too close then it prevents the player from having the freedom they require but too far away and it detracts from the relationship the two characters have and the need for Joel to be protecting her hence outside of combat Ellie will typically keep up with Joel often just behind him while in stealth sequences she gets in close and tries to stay next to you in cover in order to follow Joel successfully the game builds a follow region behind the player a region where it will make sense for even the lake's of tes bill Henry or Sam although those other characters typically follow farther behind than Ellie does once this region is established the game uses ray casts against the navmesh to find valid follow positions much late the cover point system follow position is rated for things such as distance to threats and allies the angle relative to the player's position and whether it isn't a good location not by geometry if they continue to head forward this is especially important if that geometry would block their view to jewel such as a dividing wall this is an incredibly difficult problem to get right and well it still has its issues it succeeds far more often that it fails this is a much more detailed and nuanced application compared to that found in the AI of Ghost Recon wildlands back in episode 36 which uses a similar approach by having the player leave bread crumbs on the navigation mesh but when the player goes into cover this presents a completely different challenge the cover points for the hunters are not as richly defined in the environment as that which Joel and Ellie need to sneak around hence the game has a runtime cover generation system for Ellie which generates what are known as cover action packs action packs are typically used for environmental interactions with the player like interacting with an object or climbing up and down a ladder in this case they're created in proximity of Joel by running a tea recasts from the player's position and are designed to tell Ellie which locations nearby are good points for her to hunker down the nearby cover points found in the collision geometry are then prioritized based on their distance to Joel distance to nearby threats and whether they're in front or behind the player at which point Ellie will select and move towards the best one at first this worked well but it meant that Ellie was always to one side of Joel and some modification allowed for a cover action pack to be generated on the point of covered that Joel is crouched behind was added this combined with a new animation allows Joel to shelter Ellie's body from harm well in cover and it helps reinforce the relationship between the two characters as players progress further into the game they are frequently pushed into situations where both find themselves in combat and Ellie gradually takes on more agency within each combat sequence as she is equipped with weapons to defend both Joel and herself one of the first abilities she earns that is a nice touch is that she can throw bricks and bottles at enemies this actually cheats a little bit as Ellie hooks into the enemy perception systems to check if there a boat to spot Joel if they are she will brandish a brick or bottle and lob at their head no she doesn't actually need to pick up a bottle or brick to do this they're more like magic bricks I mean let's be honest if I didn't tell you would you have even noticed when Ellie actually has a gun she only uses it if either the player has instigated a weapons free situation by going in and shooting first or if the player is in danger if you kill a couple of enemies and managed to hide once again Ellie will also return to stealth and not continue the gun battle by herself plus on rare occasions if she is nearby she'll give the player ammo and health care in a style much akin to Bioshock Infinite's Elizabeth this is tied into the inventory system given if you are in need of specific supplies and are running low or of ran Oh she'll give them to you but this is actually pretty rare and doesn't happen all that often outside of all of the stealth and combat performance that is still the need to give Ellie a real sense of character and much of this is achieved using a straightforward approach of contextual animations and dialogue there are hundreds if not thousands of lanes of dialogue Ellie can run throughout the game be it to react to objects in the world spot enemies be grossed out by dead bodies or react to Jules killing of hunted and infected the reason there are so many lines of dialogue is that as the player progresses through the game the set of dialogue Ellie accesses changes this is to reflect her growing confidence and acceptance of the situation it's a really subtle part of the game but it enriches her character all the more while all of the priorities I mentioned early are largely hold true there was one that simply could not be upheld and through further iteration and testing it made sense to break Ellie's AI does cheat in very specific situations but as is often the case in games it's done to minimize player frustration and in an effort to improve the overall experience first of all Ellie can teleport but only if the player is pinned down by another character so she can rush in to provide support during combat when she's armed Ellie's weapon accuracy and fire rate will vary between encounters and if she shoots anyone outside of the players view it doesn't actually hurt them however she will frequently turn to shoot someone in jaws Lane of sight partially to support the player but also to reinforce that she's actually involved in the con plagued this was interestingly a lot of effort to bounce and tweak given an earlier versions of the game she turned into a killing machine but perhaps more critically and as many players have observed Elly is invisible to hunters an infected when the player is not in combat this was to minimize the chances of a player's attempt at stealthily sneaking past NPCs being ruined by Ellie accidentally running out of cover and giving away your position I could take care of my scars have we had well we seem to be doing all right so far and now you'll be doing even better with Tommy Naughty Dog strive to craft the game that delivered an emotionally resonant story built atop a series of tense and brittle combat sequences it largely succeeds and speaks to the creative efforts and energies of all involved during what reads like another turbulent triple-a production despite this there are still improvements to be made with co-director Anthony Newman speaking ahead of the release of the last of his part two about improvements made to hunter combat systems but of course the proof is in the pudding and we'll see how players react as they take control of Ellie herself in the long awaited sequel thanks for watching this episode of AI in games it's only the second time I've explored the inner workings of a PlayStation exclusive with Gorillaz horizon zero dawn receiving two episodes back in 2019 this episode was voted for by my crowdfunding supporters on patreon and it's thanks to them you get to watch this video today but the special show Oh - Damian Anderson and Luke [ __ ] to have your say in future episodes of AI in games as well as your name on screen right now join my patreon community via the links on screen and in the description you

Original Description

Naughty Dog's 'The Last of Us' is one of the most revered titles on the Playstation platform. While the player is tasked with guiding Joel and Ellie through post-apocalyptic America, the underlying AI systems help bring the rest of the drama to life. In this episode, we explore the AI systems within the game. Not just enemy characters such as the Hunters and Infected but also the supporting characters within the story and most notably Ellie herself. Plus all the weird and interesting things that were tried, tested and discarded during development. This episode is inspired by the following sources: Game AI Pro, volume 2, chapters 33-35 by Mark Botta, Travis McIntosh and Max Dyckhoff http://www.gameaipro.com/ Ellie: Buddy AI in The Last of Us Max Dyckhoff, GDC 2014 https://www.youtube.com/watch?v=dnGzEn6swqo Programming Context-Aware Dialogue in The Last of Us Jason Gregory, GDC 2014 https://www.youtube.com/watch?v=Y7-OoXqNYgY -- Chapters [00:00] Introduction [01:19] Design Philosophy [03:44] AI Architecture [07:57] The Hunters [18:38] The Infected [27:00] Ellie [34:44] Closing -- AI and Games is a YouTube series on research and applications of Artificial Intelligence in video games. It's supported through and wouldn't be possible without the wonderful people who support it on Patreon, plus YouTube members and Paypal donations. http://www.patreon.com/ai_and_games https://www.youtube.com/channel/UCov_51F0betb6hJ6Gumxg3Q/join http://www.paypal.me/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 and Twitter: http://www.facebook.com/AIandGames http://www.twitter.com/AIandGames http://www.twitter.com/GET_TUDA_CHOPPA #TheLastOfUs #Ellie #GameDev
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AI and Games · AI and Games · 60 of 60

← Previous Next →
1 Evolving Particle Weapons in Galactic Arms Race | AI and Games #04
Evolving Particle Weapons in Galactic Arms Race | AI and Games #04
AI and Games
2 Pac-Man AI Research and Competitions | AI and Games #06
Pac-Man AI Research and Competitions | AI and Games #06
AI and Games
3 The Behaviour Tree AI of Halo 2 | AI and Games #09
The Behaviour Tree AI of Halo 2 | AI and Games #09
AI and Games
4 Researching Super Mario Bros. Level Design | AI and Games #10
Researching Super Mario Bros. Level Design | AI and Games #10
AI and Games
5 Teaching Robots to Play | AI and Games #12
Teaching Robots to Play | AI and Games #12
AI and Games
6 The Quest for AI Game Designers | AI and Games #13
The Quest for AI Game Designers | AI and Games #13
AI and Games
7 HTN Planning in Transformers: Fall of Cybertron | AI and Games #14
HTN Planning in Transformers: Fall of Cybertron | AI and Games #14
AI and Games
8 The AI of Alien: Isolation | AI and Games #15
The AI of Alien: Isolation | AI and Games #15
AI and Games
9 Status Performance Analysis in Team Fortress 2 | AI and Games #17
Status Performance Analysis in Team Fortress 2 | AI and Games #17
AI and Games
10 Training the Shadow AI of Killer Instinct (2013) | AI and Games #18
Training the Shadow AI of Killer Instinct (2013) | AI and Games #18
AI and Games
11 Resurrection & Reverence: The Return of DOOM | Design Dive
Resurrection & Reverence: The Return of DOOM | Design Dive
AI and Games
12 Left Behind on LV-426 - The Design of Aliens: Colonial Marines | Design Dive
Left Behind on LV-426 - The Design of Aliens: Colonial Marines | Design Dive
AI and Games
13 Games By ANGELINA, the AI Game Designer | AI and Games #20
Games By ANGELINA, the AI Game Designer | AI and Games #20
AI and Games
14 Prepare to Die by Simple AI - Dark Souls and Difficulty | Design Dive
Prepare to Die by Simple AI - Dark Souls and Difficulty | Design Dive
AI and Games
15 Looking for Love on Pandora: PCG and Borderlands 2 | Design Dive
Looking for Love on Pandora: PCG and Borderlands 2 | Design Dive
AI and Games
16 The AI of Shogun: Total War | AI and Games #21
The AI of Shogun: Total War | AI and Games #21
AI and Games
17 The Campaign AI of Total War: Rome II | AI and Games #23
The Campaign AI of Total War: Rome II | AI and Games #23
AI and Games
18 AI 101: Monte Carlo Tree Search
AI 101: Monte Carlo Tree Search
AI and Games
19 The Diplomacy AI in Total War: Attila | AI and Games #24
The Diplomacy AI in Total War: Attila | AI and Games #24
AI and Games
20 A History of AI Research in StarCraft | AI and Games #26
A History of AI Research in StarCraft | AI and Games #26
AI and Games
21 Dota 2, MOBA's and the Future of AI Research | AI and Games #27
Dota 2, MOBA's and the Future of AI Research | AI and Games #27
AI and Games
22 Procedural Level Generation in Sure Footing | AI and Games #28
Procedural Level Generation in Sure Footing | AI and Games #28
AI and Games
23 Behind the AI and Storytelling of Spec Ops: The Line | AI and Games #29
Behind the AI and Storytelling of Spec Ops: The Line | AI and Games #29
AI and Games
24 The AI of DOOM (2016) | AI and Games #30
The AI of DOOM (2016) | AI and Games #30
AI and Games
25 Machine Learning Analysis of Player Behaviour in Tomb Raider: Underworld | AI and Games #31
Machine Learning Analysis of Player Behaviour in Tomb Raider: Underworld | AI and Games #31
AI and Games
26 How A Navigation Mesh Works in 3D Games | AI 101
How A Navigation Mesh Works in 3D Games | AI 101
AI and Games
27 How Halo 3 Builds Large-Scale AI Battles | AI and Games #33
How Halo 3 Builds Large-Scale AI Battles | AI and Games #33
AI and Games
28 Enemy AI Design in Tom Clancy's The Division (Part 1 of 2) | AI and Games #34
Enemy AI Design in Tom Clancy's The Division (Part 1 of 2) | AI and Games #34
AI and Games
29 Building the Online World of Tom Clancy's The Division (Part 2 of 2) | AI and Games #35
Building the Online World of Tom Clancy's The Division (Part 2 of 2) | AI and Games #35
AI and Games
30 Behaviour Trees: The Cornerstone of Modern Game AI | AI 101
Behaviour Trees: The Cornerstone of Modern Game AI | AI 101
AI and Games
31 Why Friendly AI Cheat in Ghost Recon Wildlands | AI and Games #36
Why Friendly AI Cheat in Ghost Recon Wildlands | AI and Games #36
AI and Games
32 The AI of Horizon Zero Dawn | Part 1: Rise of the Machines | AI and Games #37
The AI of Horizon Zero Dawn | Part 1: Rise of the Machines | AI and Games #37
AI and Games
33 The AI of Horizon Zero Dawn | Part 2: Metal Militia | AI and Games #38
The AI of Horizon Zero Dawn | Part 2: Metal Militia | AI and Games #38
AI and Games
34 Augmented Reaction: Vanquish - 9 Years Later | Design Dive
Augmented Reaction: Vanquish - 9 Years Later | Design Dive
AI and Games
35 Building Mario Levels with Machine Learning | AI and Games #39
Building Mario Levels with Machine Learning | AI and Games #39
AI and Games
36 The AI of Half-Life: Finite State Machines | AI 101
The AI of Half-Life: Finite State Machines | AI 101
AI and Games
37 Building a Pirate's Paradise in Sea of Thieves | AI and Games #40
Building a Pirate's Paradise in Sea of Thieves | AI and Games #40
AI and Games
38 The Secrets of Skeleton and Shark AI in Sea of Thieves | AI and Games #41
The Secrets of Skeleton and Shark AI in Sea of Thieves | AI and Games #41
AI and Games
39 How Megalodon, Kraken and Skeleton Ships Haunt the Sea of Thieves | AI and Games #42
How Megalodon, Kraken and Skeleton Ships Haunt the Sea of Thieves | AI and Games #42
AI and Games
40 How Rare Tests Sea of Thieves to Stop Bugs Reaching Players | AI and Games #43
How Rare Tests Sea of Thieves to Stop Bugs Reaching Players | AI and Games #43
AI and Games
41 The Legacy of GoldenEye 007 | Design Dive
The Legacy of GoldenEye 007 | Design Dive
AI and Games
42 The Secrets of GoldenEye's AI Revealed | AI and Games #44
The Secrets of GoldenEye's AI Revealed | AI and Games #44
AI and Games
43 Sandbox Assassin: The AI of Hitman (2016) | AI and Games #45
Sandbox Assassin: The AI of Hitman (2016) | AI and Games #45
AI and Games
44 The Dangers of AI, Microtransactions & Lootboxes | Design Dive
The Dangers of AI, Microtransactions & Lootboxes | Design Dive
AI and Games
45 Minecraft Villages Built by AI - The Generative Design in Minecraft Competition | AI and Games #46
Minecraft Villages Built by AI - The Generative Design in Minecraft Competition | AI and Games #46
AI and Games
46 The Secret Reward Systems of Dark Souls II | Design Dive
The Secret Reward Systems of Dark Souls II | Design Dive
AI and Games
47 Why Adding Bots to Fortnite Was a Great Idea | Design Dive
Why Adding Bots to Fortnite Was a Great Idea | Design Dive
AI and Games
48 The Best Games Engines for AI (2019) | AI 101
The Best Games Engines for AI (2019) | AI 101
AI and Games
49 How Atriox Can Beat You in Halo Wars 2 Without Cheating | AI and Games #47
How Atriox Can Beat You in Halo Wars 2 Without Cheating | AI and Games #47
AI and Games
50 How AlphaStar Became a StarCraft Grandmaster | AI and Games #48
How AlphaStar Became a StarCraft Grandmaster | AI and Games #48
AI and Games
51 Why AlphaStar Does Not Solve Gaming's AI Problems | Design Dive
Why AlphaStar Does Not Solve Gaming's AI Problems | Design Dive
AI and Games
52 Designing the Enemy AI of Tom Clancy's The Division 2 | AI and Games
Designing the Enemy AI of Tom Clancy's The Division 2 | AI and Games
AI and Games
53 Bringing Washington D.C. to Life: The AI of Tom Clancy's The Division 2 | AI and Games
Bringing Washington D.C. to Life: The AI of Tom Clancy's The Division 2 | AI and Games
AI and Games
54 The Secret AI Testers Inside Tom Clancy's The Division 2 | AI and Games
The Secret AI Testers Inside Tom Clancy's The Division 2 | AI and Games
AI and Games
55 DOOM 64 Revisited | Design Dive
DOOM 64 Revisited | Design Dive
AI and Games
56 The Story of Facade: The AI-Powered Interactive Drama | AI and Games #49
The Story of Facade: The AI-Powered Interactive Drama | AI and Games #49
AI and Games
57 Building the AI of F.E.A.R. with Goal Oriented Action Planning | AI 101
Building the AI of F.E.A.R. with Goal Oriented Action Planning | AI 101
AI and Games
58 Revisiting the AI of Alien: Isolation | AI and Games #50
Revisiting the AI of Alien: Isolation | AI and Games #50
AI and Games
59 How Splinter Cell: Blacklist Builds Balance for Stealth | AI and Games #51
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
Endure and Survive: the AI of The Last of Us | AI and Games #52
AI and Games

The video teaches how the AI systems in The Last of Us create a believable and emotional experience for the player, focusing on finite state machines, skills and behaviors, and combat coordination systems. The game's AI was designed to make enemies feel real and believable, and the video analyzes how this was achieved.

Key Takeaways
  1. Build a follow region behind the player using ray casts against the navmesh
  2. Generate cover action packs in proximity of the player
  3. Select and move towards the best cover point based on distance to the player, threats, and position
  4. Implement finite state machines to structure individual intelligent behaviors
  5. Design skills and behaviors for characters
  6. Use combat coordination systems to manage enemy behaviors
💡 The game's AI systems were designed to create an emotional weight for the player, making enemies feel real and believable, and the use of finite state machines, skills and behaviors, and combat coordination systems helped to achieve this.

Related AI Lessons

I Spent Weeks Looking for a Research Gap Before I Realized I Was Searching the Wrong Way
Learn how to effectively find research gaps by changing your approach, a crucial skill for AI researchers and academics
Medium · AI
ICMI 2026 Reviews [D]
Learn how to interpret ICMI 2026 reviews and improve your paper's acceptance chances
Reddit r/MachineLearning
Workshop submission for main conference paper under review [D]
Learn how to navigate submitting a paper to a non-archival workshop before the final decision of a main conference like ECCV
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]
Streamline your research with a new Chrome extension and website that integrates 3M papers from arxiv, OpenReview, GitHub, and HuggingFace, including citation graphs and SPECTER2 neighbors, and provide feedback to improve it
Reddit r/MachineLearning
Up next
Beyond Big Vendors: ERP Systems Explained #shorts
Digital Transformation with Eric Kimberling
Watch →