CaddieOpen in CaddieDownload for Mac

How Stealth Game Guards See and Hear - School of Stealth Part 1

Shared by Caddie Library · Updated
Game Maker's Toolkit12:42Open on YouTube
Chapters show their main points

The bottom line

Stealth guards see and hear through simulated eyes and ears, and how much of that system the game shows the player decides the experience. Hidden, fuzzy systems build tension, while visible ones give the player confidence and a predator feel.

Key takeaways

  • Guards see with viewcones and raycasts, plus a growing awareness meter. 1:21
    • Splinter Cell Blacklist adds a wide peripheral box and a small zone behind the guard, and raycasts to eight bones on Sam Fisher.
    • Awareness fills slower when the player is far away, in low light, crouching or still.
  • Guards hear by sound traveling along the pathfinding network. 3:18
    • Each noise gets a distance tied to its volume, and a straight line would ignore walls muffling it.
    • Thief guards can pass on second-hand information, and Hitman 2 enforcers notice less when 47 faces away.
  • Even a realistic system leaves ambiguity that frustrates players. 4:51
    • Players meet guards who spot them when they thought they were invisible.
  • Developers reduce that ambiguity with interface cues, refuge spaces, player favouring and fuzzy detection. 5:08
    • Thief has a light gem, and Splinter Cell has a sound visualiser.
    • Blacklist halves a guard's hearing when offscreen, and The Last of Us raycasts to Joel's chest when he crouches.
  • Showing the system fully, as Mark of the Ninja does, trades tension for player power. 7:33
    • Mark of the Ninja shows vision cones and sound pulses, and Shadow Tactics splits its cone into three zones.
    • Alien: Isolation hides the alien's senses on purpose, because fear comes from not knowing.

It doesn't matter what the NPC can see or hear from a simulation perspective. It's what the player thinks the NPC should be able to see or hear.

Martin Walsh, Splinter Cell Blacklist programmer

Chapter summaries

0:00 Introduction

Stealth is the fantasy of staying unseen, and it only works when several linked systems are balanced.

  • The fantasy depends on balancing several systems. 0:24
    • Enemy awareness, information gathering and detection must all work.
    • Get one wrong and the whole thing can crumple in on itself.
    • The core fantasy is outsmarting an entire army that doesn't know you exist.
    • The miniseries takes one system per episode, covering the technical side, design choices and player experience.

1:11 Simulated Eyes and Ears

Guards get virtual eyes and ears that copy human sight and sound, using simple shapes, lines and paths.

  • Vision is a cone that must be checked against cover. 1:21
    • The viewcone is an invisible, cheese-like shape stuck to the guard's face.
    • A plain cone would let a player stand right next to a guard unseen, so shapes get more complex.
    • Cone height matters if players should be able to hide above enemies.
    • A raycast is an invisible line between two things, used to check if anything is in the way.
    • Spotting needs a certain number of Sam Fisher's raycast points to be visible.
  • Guards notice more than the player. 3:01
    • They can react to open doors, interesting objects and dead bodies.
    • This allows traps and distractions.
    • It also gives the impression of intelligence and awareness.
  • Hearing works by giving each sound a reach. 3:18
    • Gunshots, loud floorboards and thrown stones all get a distance.
    • Guards inside that distance are sent to check the source.
    • The pathfinding network is the same tech that lets enemies move around without bumping into objects.

4:32 Reducing Ambiguity

Players cope with guesswork when the game makes guards' status readable and gives them safe places and fair rules.

  • Guards can signal their alertness through animation and sound. 5:50
    • An idle, lazing guard suggests weak perception.
    • A suspicious guard with a raised weapon is far more alert.
    • Audio barks reveal that a guard is starting to notice you.
    • Detection indicators mimic the awareness meter and sometimes show where the guard who saw you is.
  • Refuge spaces give the player guaranteed safety. 6:11
    • Examples are Batman's gargoyles, Assassin's Creed's long grass and Hitman's crates and cupboards.
    • They give a place to scout and plan from total safety.
  • Fuzzy detection keeps the system fair. 7:15
    • Being spotted the instant you touch a vision cone would feel unfair.
    • Guards take a few moments to become aware before they are totally alerted.
    • Player favouring is the art of handicapping systems to bias the player.

7:33 Showing the Sensory Systems

Shadow Tactics splits one vision cone into readable zones
Putting the guard's whole perception on screen leaves nothing for the player to argue with.

Showing the senses on screen makes detection binary, and it works in 2D and 3D.

  • Visible senses pair with instant detection. 7:41
    • Light and shadow show on the ninja's sprite.
    • Noise pulses appear before the noise is made.
    • Only the very edges of the cones keep a slight analogue fuzziness.
    • In Shadow Tactics, a tripped cone fills with yellow, and you are spotted when the yellow touches you.
    • Its dotted refuge zones, like bushes and high grass, always hide you.
  • 3D games can show their senses too. 9:24
    • Metal Gear Solid draws cones on a top-down radar.
    • Sly Cooper guards carry torches with pools of yellow light.
    • Deus Ex: Mankind Divided still uses the radar, a hand-wavey fix.
    • Standing in the torchlight means you are spotted. Cartoony, but readable.

10:03 Conclusion

Hidden senses build tension; visible senses make you a predator
Hidden, fuzzy sensesRevealed senses
ExamplesThief, Alien IsolationMark of the Ninja, Shadow Tactics
DetectionGradual awareness meterBinary, near-instant
Player relies onGut sense of light, distance, soundVisible cones and noise pulses
FeelingHeart-pounding tensionConfidence, apex predator
SuitsFragile hiding, horrorTraps and elaborate plans
How much of the system a game shows decides whether you feel hunted or in control.

Fuzzy perception gives tension, and clear perception gives power.

  • Ambiguity keeps the player's sneaky status fragile. 10:09
    • You judge light, shadow, distance and sound yourself.
    • Thief programmer Tom Leonard: getting the player's heart pounding by holding them on the cusp.
    • This fits a fantasy where power comes from hiding, not brute force.
  • Clear perception lets the player act like a predator. 11:12
    • Players lure guards into traps or sneak in for silent kills.
    • Jamie Cheng said he cared more about creating an elaborate death trap than guessing whether a guard would hear.
    • Refuge zones and gadgets can give the same feel, but accurate prediction gets there faster.

In the growth library

Mark Brown, creator of Game Maker's Toolkit. Stealth guards perceive the player through simulated eyes and ears (view cones, raycasts, awareness meters, pathfinding-based sound), and how much of that system the game shows the player decides whether it feels tense or empowering. Comparing Mark of the Ninja's fully visible vision cones and sound pulses with Alien: Isolation's hidden senses makes the tradeoff clear.

More from Game Maker's Toolkit · The whole library, and ask it anything

Transcript182 lines
Introduction 0:00
0:03

There aren’t many genres with such a strong core fantasy, as the stealth game. These are games about staying unseen, and then striking from the shadows. About outsmarting an entire army of enemies, without them even knowing you exist. These are games about spies, assassins, and, uh, Batmen. But making this fantasy work means balancing a number of complicated game systems: from enemy awareness, to information gathering, to robust detection systems.

0:34

Get any of them wrong, and the whole thing can crumple in on itself. So, welcome to the School of Stealth. This is a short, GMTK mini-series about how stealth games work. In each episode, I’m going to take one system from the stealth game formula and break down how it works - looking, where necessary, at the technical side of things, the design considerations, and the end user experience. For episode one, we need to start where most stealth games begin: with the player being hidden.

1:05

And then ask ourselves: how do guards actually see and hear the player?

Simulated Eyes and Ears 1:11
1:11

Ultimately, guards in games are given virtual eyes and ears that are designed to simulate the two main human senses: sight and sound. To simulate vision, video game guards typically have a viewcone - which is an invisible, cheese-like entity that is stuck to the enemy’s face. If the player character enters the cone, they get detected. It’s a touch more complicated than that, of course. A simple cone would allow characters to stay unseen even if they were right next to the enemy - so more complex shapes are often used.

1:44

In Splinter Cell Blacklist, there’s a basic vision cone for the guard’s primary sightline, but a second, much wider box to simulate peripheral vision. And even a small area behind the guard to mimic that sixth sense of knowing when someone’s just over your shoulder. Developers will also need to consider the height of the cone, depending on whether the character should be able to hide when they’re above enemies. To know if the player is in cover, a game will typically use a raycast - which is basically when an invisible line is drawn between two elements to see - in this case - if anything is in the way.

2:21

You can make this more complex to catch moments of partial cover: so, in Splinter Cell, the enemy raycasts to eight different bones in Sam Fisher’s player model - and will only spot him if a certain number are visible. Now, if the player enters the cone and isn’t in cover, they probably don’t get immediately spotted. Instead, the guard’s awareness of the player starts to grow. The speed at which this meter fills might be slower if the character is further away, or only in the guard’s peripheral vision, or in low light, or crouching down, or staying perfectly still.

2:57

When the meter tops out, though, the guard will know exactly where you are. It’s also important to note that guards can be aware of more than just the player character - such as open doors, interesting objects, or dead bodies. This can be used to make interesting plans like traps and distractions - but it can also help give the impression of intelligence and awareness. Now, simulating hearing is a different problem. When you make a sound, like firing a gun, walking on a loud floor board, or throwing a stone - the sound will be given a distance - related to the volume of that noise.

3:33

Any guard who is within that distance can then be told to go check out the source of the sound. However, a straight line between the sound and the guard won’t work, because we expect noises to be muffled by walls. So the typical solution is to use the game’s pathfinding system - the same tech that allows an enemy to find their way around a world without bumping into objects. Make the sound travel across that, and you’ll more realistically capture the way sound propagates through an environment in real life.

4:04

That’s the gist of things, then, but more complex stuff might be included in certain games - for example, in Thief, guards can have second-hand information about the player based on what other enemies are up to. And in Hitman 2, enforcer characters are way less perceptive of Agent 47 if he’s facing away from them, which gives disguises more power. Links to more detailed technical information can be found in the description beneath this video.

Reducing Ambiguity 4:32
4:32

When done well, this system should create a pretty realistic representation of a human’s visual and auditory perception. You can then make educated decisions about where you will be safe, using your real-world knowledge of how sight works in different light conditions, or how sound might be muffled by a wall. But there’s always going to be a certain level of ambiguity for the player to deal with - which can lead to friction and frustration.

4:58

I’m sure you’ve played a stealth game where you thought you were totally invisible, but the guard saw you anyway. So to help players make sense of this stuff, there’s a few smart ways that devs can make these perception systems more obvious. The first is helpful interface elements. Even way back in Thief, the developers knew that it was tough for players to understand how lit their character was from a first-person perspective, so there’s a light gem at the bottom of the screen to show your current visibility.

5:27

And in Splinter Cell, the awkward challenge of knowing how much sound you’re making, is helped by a visualiser on Sam’s head’s up display. Also, most games have some kind of detection indicator on their interface, which mimics the guard’s awareness meter from earlier. This helps the player know that they’re about to be made - and sometimes even shows you the location of the guard who’s seen you. Next up is using animation and audio to help communicate a guard’s status to the player.

5:55

A guard who is idly lazing about might suggest that they have pretty weak perception, but a suspicious enemy with their weapon raised will be way more alert to potential threats. Audio barks also let you know that the guard is starting to become aware of you. Then there are refuge spaces. These are places in the game world where, in normal circumstances, you are unambiguously hidden. That might be the high-up gargoyles in Batman, or areas of long grass in Assassin’s Creed, or crates and cupboards in Hitman.

6:27

These give you at least one place where you can scout and plan from a position of total safety. Another big solution is player favouring - which is the art of handicapping systems to bias the player. As Splinter Cell Blacklist programmer Martin Walsh says, “it doesn’t matter what the NPC can see or hear from a simulation perspective. It’s what the player thinks the NPC should be able to see or hear”. So in his game, a guard’s hearing is reduced by half when they’re offscreen, because it feels unfair to be heard by someone you can’t even see.

7:03

And in The Last of Us, enemies typically raycast to Joel’s head to determine line of sight - but that changes to his chest when he’s crouching, to let him peep over cover without being spotted. And then the biggest help of all, as discussed earlier, is a fuzzy detection system. If you were immediately spotted when you touched the guard’s vision cone, that wouldn’t feel very fair. So it makes sense that guards take a few moments to become aware of your presence before being totally alerted.

Showing the Sensory Systems 7:33
7:34

Now there’s one final, and rather bold solution to this problem: and that’s to simply reveal these systems to the player. In the excellent side-scrolling sneak ‘em up Mark of the Ninja, the guard’s perception is about as unambiguous as you can get: Their vision cones are displayed on screen. The ninja is either in shadow or in light - and that’s shown on the character’s sprite. And when you make noises, you can see them emanating from the source as big round pulses.

8:03

This is also shown to you before you even make the noise, which is helpful for knowing whether your noisy distraction or sneaky getaway will be successful. With the info on screen, there’s no arguing about what’s happening in the system. You’re either in the cone, or you’re not. And that sound either reached the guard’s ears, or it didn’t. And so Ninja’s binary perception system can be paired up with a totally binary detection system of instant awareness - though, there is a slight analogue fuzziness on the very edges of the enemy’s view cones.

8:39

GUARD: "Is someone up there?" For a slightly more nuanced take on this, check out Shadow Tactics: Blades of the Shogun. Here, the vision cone is split into three zones: the bright green part near the enemy’s face is the danger zone and leads to a pretty instantaneous detection. In the dark green part, you can stay hidden if you’re crouched down, but will be spotted if you stand up. And the dotted part is for refuge zones like bushes and high grass, where you will always be invisible.

9:09

If you do trip the viewcone, the whole cone will fill up with yellow - and if the yellow part touches your character, you’re spotted. It’s a very elegant way of displaying all the necessary information, right there on screen. Of course, it’s a lot harder to show this sort of stuff in a fully 3D game. The original Metal Gear Solid’s solution was to simply photocopy the game world into a top-down, 2D representation on your radar, and then draw the vision cones on that.

9:39

It’s a sorta hand-wavey solution that’s still being used in games like Deus Ex: Mankind Divided. But it’s not impossible. The Sly Cooper series has guards with torches that cast obvious pools of yellow light. If you find yourself inside the light, you get spotted - but otherwise you’re safe. Cartoony, yes. But also, immediately readable.

Conclusion 10:03
10:03

The most important thing, though, is the experience that these different perception systems lead to. When the system is made analogue and ambiguous, the player must evaluate the environment with an immersive and realistic understanding of light, shadow, distance, and sound. And it also gives the game a certain level of tension - where you can never been 100% sure that you’re safe. And I think this fits quite nicely with the core stealth fantasy: these are games where your power doesn’t come through sheer brute force, but only through your ability to hide from the enemy.

10:38

So having your sneaky status be fragile and fuzzy reminds you that you’re always at risk of losing your tenuous advantage over the enemy. As Thief programmer Tom Leonard says, “it's about getting the player's heart pounding by holding them on the cusp” of being found. And it’s especially important to hide this stuff in survival horror games that borrow stealth elements. In a game like Alien Isolation, it would be rubbish if you could see exactly where the Xenomorph was looking.

11:06

A huge amount of fear and anxiety is derived from your shaky knowledge of the alien’s senses. But making the system completely obvious has its own advantages. It puts way more power in your hands, and allows you to play with a huge amount of confidence. You can feel more like an apex predator, luring enemies into traps or sneaking in for a silent kill. As Ninja producer Jamie Cheng put it, “as we were iterating, I found that I wasn't nearly as interested in guessing whether a guard would hear me or not, and way more interested in creating an elaborate death trap”.

11:39

Of course, the predator feel can be achieved through other methods, like those aforementioned refuge zones and by giving the player a bucketload of gadgets and super powers - but the more accurately they can predict the enemy’s perception, the quicker the player will get to that experience. So, that’s it for lesson one. Stealth game guards see and hear through a system of simulated eyes and ears - and developers can create very different experiences, depending on how much of that system they surface to the player.

12:10

Come back next time for more deep dives into sneak ‘em up design. And if you subscribe to my channel, you’ll get access to the new episode as soon as it goes live. Hey. Thanks for watching. I hope you’re all doing okay in the midst of this awful coronavirus pandemic. It’s such a scary situation, so please stay safe, wash your hands, and follow the necessary guidelines. I’ll do my best to keep making interesting stuff to keep you busy and entertained.