Revisiting the AI of Alien: Isolation

May 20, 2020
None

Image via SEGA.
<iframe title="Embedded content" src="//www.youtube.com/embed/P7d5lF6U0eQ?enablejsapi=1&amp;origin=https%3A%2F%2Fwww.gamedeveloper.com" height="360px" width="100%" data-testid="iframe" loading="lazy" scrolling="auto" class="optanon-category-C0004 ot-vscat-C0004 " data-gtm-yt-inspected-91172384_163="true" id="196886866" data-gtm-yt-inspected-91172384_165="true" data-gtm-yt-inspected-113="true"></iframe>

'AI and Games' is a crowdfunded YouTube series that explores research and applications of artificial intelligence in video games.  You can support this work by visiting my Patreon page.

The AI of Alien: Isolation is a topic I have previously explored and is without doubt the most popular video/blog I've ever produced.  So to celebrate the 50th video in the YouTube series, I revisit this topic in more detail.

Alien: Isolation left an indelible mark on artificial intelligence for video games. A game where the success or failure of its core premise relied heavily on players believing in the intelligence and cunning of its primary antagonist. If the design and implementation of the xenomorph did not stand up to scrutiny, then the game would have quickly collapsed in on itself. From a developers perspective now in 2020, there have been many exciting and novel applications of AI across the games industry - including many we've seen on this channel - but I don't think any other game has quite caught the attention and imagination of players in recent years.

It's a testimony to the hard work of everyone involved at Creative Assembly. And while I have previously explored the inner workings of the AI of Alien: Isolation, there are still many secrets left to uncover for developers seeking to replicate its inner working, or for players old and new as they attempt to escape the Sevastapol space station.

Related:Game Design Deep Dive: The save system of Alien: Isolation

AI_AI_1.jpg

Recap

If you never read or watched my original piece, or need a recap, here's some of the key information you need to know about the xenomorph in Alien: Isolation. It's important to recognise there are two systems that control the alien. The xenomorph itself is controlled by whats known as a behaviour tree - a very common technique used in AAA video games to control non-player characters. I explain how behaviour trees work in episode 2 of my AI 101 subseries, so check that out if you need to know more. The xenomorphs behaviour tree can search the corridors of the space station, hunt down errant noises or investigate areas the creature is interested in. With specific behaviours such as searching lockers and crawling into smaller vents only activated after the player has repeatedly escaped its clutches using these methods several times, thus providing the illusion that the creature is learning. The behaviour tree is ultimately responsible for ensuring the alien hunts down and kills the player. But it has to do this of its own accord and rely on what it detect within the world from its own audio and visual sensors. However, this can lead to the alien either trapping the player in a corner of the map or completely losing you as you make a break for it. And that's where the second AI system kicks in.

Related:The Perfect Organism: The AI of Alien: Isolation

OpenCAGE-300x169.jpg

The second system is an AI-director, much like that seen in Left 4 Dead and is designed to manage the pacing of the game. The director always knows not only the location of the xenomorph is, but where the player is as well. The directors job is to periodically tell the xenomorph to head towards the player throughout a given level. It never tells the alien exactly where you are, but advises it to head towards your general, and the behaviour tree will take it from there. This means that while the director is trying to keep you under pressure, the alien still needs to hunt you down and kill you on its own merit. When the creature is wandering the corridors, this is whats known as front-stage. The alien is searching for the player either because the director told it to go that location or it heard something that caught its attention. Once the alien is in proximity of the player, the director maintains a 'menace gauge', which is designed to record the intensity of the creatures presence. The menace gauge increases at different rates depending on whether the creature is nearby and whether the player can hear it moving or actually see it in front of them. Once it reaches a threshold, then the alien will go into the vents for a time, known as backstage mode. During which it wanders the vents and potentially lays a trap for you.

Related:Fear in unpredictability: Alien: Isolation's brand of survival horror

AI_AI_2.jpg

This is all the core systems in a nutshell. But there are still so many unknowns about how the Xenomorph works, not to mention a lot of the other AI characters in the game, the Working Joes, the Facehuggers and the all the human characters be they friend or foe. Hence I was keen for this episode to dive deeper into the AI systems. But more critically begin to better understand the inner workings of the xenomorph itself. To do this I reached out to Matt Filer - a game developer based in the UK - who has developed OpenCAGE, a suite of modding tools named after the Creative Assembly Game Editor. OpenCAGE provides a variety of tools that allows anyone with the PC build of the game to manipulate the AI behaviour in the game, alongisde many other features.

As mentioned the xenomorph is reliant on a behaviour tree architecture for controlling its behaviour. In previous developer talks - and in my own video - it was highlighted that this was a rather large behaviour system. Thanks to the Filer's mod tools, we can actually look at it and spot specific aspects of its behaviour. However, it might be a little hard for you to see in the video. Y'see, the Xenomorph has 36 branches it can take from the root of the tree. This ranges from attacking the player to investigating disturbances that its sensors have detected, climbing in and out of the vents and fleeing from fire. But also some special tools and other secrets that hint at cut content from the game. In addition, Filer's tools expose several of the aliens sensory systems which are alluded to in the behaviour tree. Giving us a richer and more comprehensive view of the xenomorphs behaviour.

So let's take a look at some of the interesting elements of the aliens behaviour and new things that have come to light.

Sense

As mentioned previously, the xenomorph must hunt down and kill the player on its own. While the director always knows where the player is, the creature has to earn its kill. To achieve this, the alien has a variety of different senses, it has multiple modes of vision, it can hear noises within proximity and recognise their severity and also has some basic touch senses that allow it to recognise when the player bumps into it or its been hurt by gunfire or the flamethrower. But critically, the creature needs these senses to be working together in order to attack the player. There are three ways to guarantee the alien will sense and then try to kill you: either the visual or touch sensors say with absolute confidence that they register the player, or one of several sensors activate while you're in a crawlspace or similar hiding spot. And thanks to Filer's mod tools, you can essentially disable its vision sensors, making it blind - like you can see right here. The alien cannot see me right now, but its other senses are still active and it knows there's something nearby. Hence it's still a highly credible threat. So let's walk through how these senses work and what it needs to know before it can go for the kill.

Vision is the easiest way for the alien to register you as a target. For it's vision, the alien uses what is known as a vision cone or view-cone, where it can see in front of itself within a certain range, typically in the shape of a cone and registers when objects have been in the cone for a period of time. View cones are a very common technique for visualising how an enemy can 'see' something in the world, given they're easy to visualise and debug. In fact many games communicate whether they're being detected by a view cone, such as that in Splinter Cell or Far Cry while others such as Metal Gear Solid explicitly showing the view cone via the in-game HUD such that players can react to it accordingly.

All characters in Alien: Isolation, be they human, android or xenomorph have four different view cones. The normal cone for reading directly in front, which can see pretty far ahead, a tighter view cone known as 'focussed', which it uses when it's looking at specific objects or locations but within a shorter range, the 'peripheral' cone that is shorter in length but much wider, and lastly a cone called 'close' that is very short, but very broad and is designed to catch anything right next to it. Meaning you can't go crawling around sitting mere inches away dodging all of its other visual sensors.

AI_AI_3.jpg

Now the typical idea is that should the player intersect the view cone and there is nothing that would block the line of sight from the alien to the player, then in theory the xenomorph has seen you, but the sensor doesn't register the player as spotted immediately. The longer you stay in a given view cone, the signal from that visual sensor becomes stronger. Once that sensor reaches a certain value it enables certain paths within the behaviour tree to become available to the alien, because it most definetely can see you now. Now the strength of the signal from each view cone varies and will increase at different rates depending on which view cone the player is sitting in.

However, it's worth nothing that the vision of the alien and other characaters can be obscured based on light levels as well as smoke in the environment. In fact each view cone has modifiers that dictate how well the alien can see you in different conditions. Hence using the air purity controls on the space station is a very useful tactic, given it can help obscure the creatures view, even if it does limit your own! In addition, the light levels within a range of the map have a huge impact on the vision strength of humans and Working Joe's, but has - as near as I can tell - absolutely no effect on the xenomorph.

With all that said, the aliens next best sense is sound, where the creature can hear a variety of different noises at different strengths. Each sound you make in the game has a variety of strength levels. In a manner similar to vision, a sound being heard by a given NPCs is driven by activation thresholds, with weapon firing in particular scaled to trigger sensor activation much faster than other sounds. These sounds pinpoint the alien to a location to invesigate and if it is quite far away from the point of the side, it will run towards it rather than more gracefully walk. In the case of louder noises with stronger signals, this will also force the alien out of backstage mode to investigate.

Movement has three stages of noise, crouched, walking and running, and the noise generated and sound radius is quite different. Meanwhile weapons used, including even hitting your wrench on surfaces, will trigger the aliens interest and have a much faster rate of activation than movement. Loud sounds are very much the players enemy, given not only will they lure the alien to your location if it's out on patrol, they will also trigger the alien to leave its backstage mode in the vents and come down to investigate: so running around and especially firing a gun is a very bad idea. It will know exactly where that sound came from.

Now despite all this, there are some useful tips to take on board: each sensor detection has a rate of decay and the alien will eventually forget a specific sensory reading. Plus there are a handful visual and audio cues that - from what I can gather - have zero impact on the alien and other NPCs. This includes the opening and closing of lockers, doors and vents. But the important one to remember is the motion tracker: it only makes audible noise that other NPCs can hear within a very short radius. So if the alien is nearby while you're in a hiding spot, keep it stowed, otherwise it will hear it.

AI_AI_4.jpg

But like I said at the beginning, the alien can only attack if it can outright see you or you're rubbing yourself against it. So if you're being smart and hiding, then it checks against several sensors for activation. Many crawlspaces in the game are built by designers to ensure that either the alien can no longer see you, or it's chances of doing so are drastically reduced. That said, there are still ways to catch the aliens attention and its behaviour tree has a specific set of conditions for when the player is hiding. The easiest way is to accidentally turn on your flashlight. The flashlight has a scaled trigger and response activation compared to normal visuals. Hence you have to be very careful using it, given the alien will spot it almost immediately. Plus you can accidentally touch its body while hiding, make too much noise or expose yourself enough that the aliens vision sensors are registering you beneath a lower-than-normal threshold.

Now with the alien having seen you, it has a handful of final checks to make before it makes its move. This includes not being in a vent (unless its an ambush attack, which I'll come back to in a bit), having a valid path to its intended target on the navigation mesh, meaning can it reach you. But also whether it maintains the target in either it visual or combined sensor thresholds. Hence in theory, it is possible to escape the creature and once it no longer registers you, it will have to find you all over again. Not that I've had much luck doing that.

And speaking of surviving an alien attack, let's talk about it's extra special flame touch sensor! The flamethrower is your one true friend in many of the latter stages of the game, given while it can't kill the alien, it can sure as hell hurt it and scare it off. The alien distinguishes attacking a target - a human that has no weapon - as separate from that of an armed character, known as a threat. While the sensory conditions as mentioned earlier are the same, how it behaves differs in execution. However, the critical part is that it has a sub-tree for reacting to being attacked by the flamethrower and how it should respond.

The alien records whether it has previously interacted with the flamethrower and that influences how it attacks. Hence after its first interaction with the flamethrower, it approaches the problem in different ways in subsequent attempts. This ranges from merely hissing at the player for holding it at bay, to setting ambush attacks in the vents to trying to flank you to attack from different angles depending on the distance, so as to catch you off guard.

If it does make a move and you let lose some fiery rage, the alien has a separate touch sensor for recognising being hit by the flamethrower and once that reaches a threshold, it's going to force it to retreat, but not before it tries to take a swipe at you. The hit-and run sub-tree makes a quick calculation of how far away the player is and whether the path to them is occluded in any way, if it isn't the alien executes a hit-and-run where it smacks you to the ground as it makes a run for it. If those conditions can't be met, it will just run away. But all that said, you still have to be careful as this is all based on whether the alien is not too close. If it is within one unit of distance, it will just fight through the pain and grab you. So make sure you always maintain your distance before scorching the creature.

In any case, triggering the hit and run will cause the alien to retreat, typically into backstage mode. And on that note, let's take a look at the new things we've discovered about the aliens front and backstage routines.

Menace

AI_AI_5.jpg

The view of the (invisible) alien while in the backstage 'vents'.

As mentioned earlier, the alien operates in two modes: front-stage when its out hunting you and backstage when it crawls around in the vents, giving the player a breather and allow you to progress.

When in either front-stage or backstage, the alien will move around the map in activity known as a Sweep. Wh

JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.

Read More>>