CaddieOpen in CaddieDownload for Mac

How do Stealth Games Deal with Detection? - School of Stealth Part 3

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

The bottom line

A good stealth game answers detection with guard AI states that let the player escape, hide and return to stealth, not with instant failure or a forced shootout. Quick loading undermines that design, so developers should encourage hiding over reloading.

Key takeaways

  • Ending the game or forcing a shootout when the player is spotted fails the genre. 0:43
    • An instant game over, as in the Miles and MJ sections of Spider-Man, is frustrating unless levels are tiny or full of checkpoints.
    • In Uncharted 2, being spotted turns the whole area hostile and Drake cannot hide, so the player is shunted into a different kind of game.
  • Guards move between idle, combat and search states, and that structure lets the player reset the system. 2:32
    • Metal Gear Solid shows the template: a viewcone sighting means "Alert", broken line of sight means "Evasion" with a countdown timer, and a run-out timer returns the guard to patrol.
    • Pac-Man's ghosts work the same way, switching between "chase" and "escape" when a condition is met.
  • Fuzzy detection gives players room to make mistakes without failing. 3:40
    • In Dishonored 2 a lightning bolt fills with white, then red, taking guards from idle to suspicious, alerted and finally combat. The player can break line of sight at any point.
    • Guards track the player by a "last known position", only nearby guards join the hunt, and UI icons or voice barks keep the states readable.
  • The quick load key lets players erase every mistake, which kills the tension of being spotted. 8:14
    • Reasons for abuse include the power fantasy of the perfect spy, a dull search phase (sitting in a cupboard for over a minute), and rewards for never being spotted.
    • Shadow Tactics builds quick load in as its official way to handle failure.
  • Developers can curb quick loading with checkpoints, limited rewinds and lasting costs for mistakes. 10:59
    • Racing games limit the number of rewinds per race, so a few mistakes can be fixed but not every one.
    • In the Arkham games, escaping is easy, but Batman's health lost to buckshot does not regenerate until the encounter ends.

When you get spotted, an elegantly designed stealth game doesn't just end or switch to a completely different genre. Instead, it forces you to find a way out of the situation, but it also quickly lets you return to the sneaky action you came for.

Mark Brown, Game Maker's Toolkit

Chapter summaries

0:00 Introduction

Only AI states let a spotted player return to stealth
ApproachInstant game overForced shootoutAI state loop
When spottedLevel restartsWhole area turns hostileGuards chase, then search
Back to stealth?Only by restartingNo, can't hideYes, once the timer runs out
ExampleSpider-Man (Miles, MJ)Uncharted 2Metal Gear Solid
VerdictFrustratingUse with cautionThe genre's template
The game over and the shootout both end the stealth game the player chose to play.

Stealth only has tension if the player can be found, so handling detection is the genre's core design problem.

  • Being found is what gives hiding its tension. 0:06
    • Games have wrestled with this since the genre began.
    • The two simplest answers come first, to get them out of the way.
    • The instant game over only works if levels are tiny or full of checkpoints.
    • The forced shootout is a lot better than a game over and suits some games, but it needs maximum caution in a stealth-focused one.

1:37 Video Game AI

Guard behaviour is a set of states, and a met condition moves a guard from one state to another.

  • An AI character sits in one state and switches when a condition is met. 1:48
    • Most games build this as a finite state machine or a behaviour tree.
    • Each state has its own actions and animations.
    • In Pac-Man, the ghosts return to "chase" once the power pellet runs out.
    • The author's Design Icons episode on Pac-Man covers more of the detail.
  • Guards loop through patrol, combat and search, and the loop can be reset. 2:44
    • Idle guards walk a set patrol path or stand at a fixed post.
    • A guard who finds the hidden player goes straight back to combat.
    • In Metal Gear Solid, the radar shows the current state to the player.
    • Most stealth games still use this structure, with a bit more nuance.

3:40 Improving Guard Detection

A filling meter gives players room to fail
Fuzzy detection replaces Metal Gear Solid's instant, binary sighting with a spectrum of recoverable mistakes.

Gradual detection, fair searching and readable feedback give players room to fail without losing stealth.

  • A fuzzy middle between idle and combat is kinder than instant detection. 3:40
    • Halfway up the bolt, a suspicious guard walks toward the player.
    • When it fills, the guard draws a weapon and moves faster.
    • Break line of sight while idle and the guard never registers the player.
    • Escape while suspicious or alerted and the guard searches, then returns to patrol.
  • Guards should search with senses a player can understand. 4:36
    • Splinter Cell: Blacklist shows the last known position as a ghostly white Sam Fisher.
    • Only nearby guards are drawn in, so the player can remove the threat and reset.
    • Some games send the spotter to an alarm tower for reinforcements.
    • That gives a clutch moment to kill them first, or a payoff if the alarm is booby trapped.
  • Guards can stay wary after the player escapes. 6:02
    • Instantly returning to idle after friends are killed feels unrealistic.
    • In The Phantom Pain, the area stays cautious for many in-game hours.
    • Guards there give up the active hunt quite quickly.
    • In Arkham Asylum, guards settle into a "nervous" state, walking back to back with weapons raised.
  • Escape and reset give stealth a second, chaotic rhythm. 7:24
    • Slow, patient sneaking pairs with frantic improvised action.
    • Readable feedback keeps this clear: thought bubbles in Untitled Goose Game, voice barks elsewhere.
    • Examples include slipping an optic fibre camera under a door, then chasing down a witness.
    • Others are diving through a window, or riding a horse away in a blizzard of gunfire.

8:14 Dealing with Quick Load

Quick load is the strongest gadget in stealth games, so designers should limit it and reward good play without pushing everyone toward it.

  • Players use quick load to erase every mistake. 8:28
    • Many players save before anything sneaky and reload when it goes wrong.
    • Mark Brown counts himself in that group.
    • Sam Fisher is never spotted and never screws up.
    • Arkane brought quick save to the console versions of Dishonored 2.
  • Ghosting is a fine way to play, but a bad way to teach. 10:03
    • Like speedrunning, no developer would push it on a first playthrough.
    • Assault Android Cactus tracks enemy chains silently until the player first does one.
    • Good players get rewarded without confusing new ones.
    • Brown's verdict: Developers, just copy that.
  • Limited saves and rewinds keep mistakes meaningful. 10:51
    • Console-born games put checkpoints at the start of each encounter, so players try to salvage a screw up.
    • Racing rewinds are more intuitive than manual saving.
    • Limited rewinds mean no perfect lap built from redoing every error.
    • In the Arkham games, a few gargoyles reset the system to stealth almost at once.
    • Lost health means Batman can only make a finite number of mistakes.

12:13 Conclusion

Stealth design rules are there to be learned, used and then ignored.

  • The series gives basic rules, not a complete system. 12:44
    • More could be covered, like multiplayer stealth games.
    • Early submarine sims inspired the genre.
    • The hope is that players learn, use, and then, most importantly of all, ignore the rules.
    • The future of the stealth genre is left open.

In the growth library

Mark Brown, creator of Game Maker's Toolkit. Explains how stealth games handle being spotted, from the guard state machine in Metal Gear Solid to the fuzzy detection meter in Dishonored 2, and why quick loading undermines the genre. The Arkham games' lasting health loss, compared with the limited rewinds in racing games, is the example that shows how to stop save scumming.

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

Transcript196 lines
Introduction 0:00
0:03

Stealth games are all about staying hidden. But for there to be any tension at all, that means games must also include the opposite: being found. This is perhaps the most fundamental problem that stealth game designers have to solve, and it's something that games have wrestled with since the very invention of the genre. So, what better way to finish off the School of Stealth, which is my three part miniseries on the design of sneaky games, than to ask: How do stealth games deal with detection?

0:36

First, let's talk about the two most simple solutions for handling detection, just to get them out of the way. One is the instant game over, as seen in the Miles and MJ bits of the most recent Spider-Man game. This is just inherently frustrating, and unless your levels are absolutely tiny or littered with checkpoints, it should probably be avoided. Another approach is to irreversibly shift the situation into a more traditional combat set-up.

1:04

So In Uncharted 2, you start most combat encounters in stealth. But if you get spotted, the entire area becomes immediately aware of your presence and the game transitions into a typical Uncharted shootout - and there's no way for Drake to hide. This is a lot better than the instant game over, and can work pretty well in certain games. But if stealth is the focus of the experience then the player is suddenly no longer playing the game they bought - and is awkwardly shunted into a completely different type of gameplay.

1:33

So it's an approach that should be used with maximum caution.

Video Game AI 1:37
1:37

Okay, with those covered, let's move on to some proper solutions. And to talk about this stuff, we need to briefly discuss how video game AI works. Most games use either a "finite state machine" or a "behaviour tree" and without getting into the nerdy details, the basic concept is this: AI characters exist in a specific state, with relevant actions and animations available to them. When a suitable condition is met, the character will shift into a different state.

2:09

Think of Pac-Man, where the ghosts typically exist in the "chase" state where they hunt down Pac-Man. But if you grab the power pellet, the ghosts will transition into the "escape" state and try to run away. Until the pellet runs out, that is, and we're back to the "chase" state. There's a bit more to it than that, so check out my Design Icons episode on Pac-Man if you're interested. Anyway. In the world of stealth games, 1998's Metal Gear Solid provides a really clear template for the different states that stealth game guards can move between - with clear distinctions shown right there on your radar.

2:44

Typically, the guards are in an idle state, as they walk along a predetermined patrol path or stand guard at a specific point. If Snake walks into a guard's viewcone, the radar says "Alert" and the enemy enters a combat state. They now shoot at Snake and chase after him. If Snake manages to break the guard's line of sight and find somewhere to hide, the guard enters the search state. Now the radar says "Evasion" and a timer starts counting down.

3:10

If the guard finds Snake, they go back to the combat state. But if the timer runs down, the guard goes back to their idle patrol path, and system is reset. This simple structure is still used in most stealth games today, but just with a tad more nuance. For starters, Metal Gear Solid's instant, binary system of detection can be pretty harsh, so many games introduce a certain amount of fuzziness between the idle and combat states.

Improving Guard Detection 3:40
3:40

Let's look at Dishonored 2. If we get inside a guard's view cone, they stay in idle but a lighting bolt icon appears and starts filling up with white. If it gets to about half way, the guard will enter a new state - suspicious - and walk towards us. When the bolt fills up all the way, the guard becomes alerted, draws their weapon, and moves more quickly. Now the lighting bolt fills up again, this time with red, and when that tops out, the guard finally enters combat.

4:10

At any moment here, we can break line of sight with the enemy and avoid entering combat. If we do so while idle, the guard doesn't register us at all. And if we escape during the suspicious or alerted states, the guard will search the area for a while before giving up and returning to their patrol. This is a much more generous approach to stealth, because it gives the player more leeway to make mistakes without feeling the sting of complete failure.

4:36

Another thing to consider is how the guards hunt you down when they're in their search state. We don't want to feel like the guards are cheating and have unfair knowledge of your location, after all. So video game guards typically use the same senses as discussed in episode one to follow an escaping player. And if they lose line of sight, they'll register a "last known position" and converge on that. In the game Splinter Cell Blacklist, you can even see that for yourself as a ghostly white outline of Sam Fisher.

5:07

Also, how many guards should come after you when you get spotted? Another classic stealth game grumble is the feeling of an entire fortress of baddies becoming alert because you got seen by one dude. In Dishonored 2, any guards close enough to hear an enemy's scream of "hey, you over there!" will join in the hunt - but characters who are further away will remain unaware of your presence. This is important because it gives players the ability to neutralise the nearby threat and return the system to stealthiness, but it doesn't encourage a Rambo-like rampage of the entire level.

5:43

Other games actually turn this into an interesting bit of gameplay. So an enemy who sees you will run to an alarm tower to gather reinforcements for the fight. This gives you a clutch moment to kill that guard before they alert their friends - or, if you booby trapped the alarm - a wonderful outcome to your sneaky plan. And then there's the question of how quickly should the guards return to idle after you escape? We want to give players the ability to reset the system back to its original stealthy set-up, but it can feel weirdly unrealistic for a guard to give up and go back to idly wandering back and forth after three of their friends just got assassinated.

6:23

So in The Phantom Pain, while guards will quite quickly give up on actively hunting for you, the entire nearby area will stay on alert for much longer - with guards stuck in a more cautious patrol path for many in-game hours. And in Arkham Aslyum, guards never go back to their original calm state after Batman is spotted. Instead, there's a new normal state: nervous, where guards walk back to back and keep their weapons raised.

6:52

Now, when you're creating all these complex new states and systems, it's vitally important that the player understands what is happening. This can be done through user interface elements like the lightning bolt and ghostly outline I talked about before - but voice barks are also great. GUARD 1: "I saw you, no use hiding!" GUARD 2: "Keep your eyes peeled" GUARD 3: "Anybody?" GUARD 4: "Nothing!" And if that's not within budget, look at Untitled Goose Game which uses thought bubbles and cute icons to explain what its characters are thinking about.

7:24

And when you put all of this stuff together, you get a pretty good detection system. It's a somewhat realistic representation of how someone would react to an intruder, but with enough gaminess to remain readable and exploitable. The fuzziness between idle and combat gives the game a generous failure spectrum where players get to mess up without breaking out of the stealth mode. And letting players escape, hide, and reset the system back to zero, means stealth games actually get a second type of gameplay: the cautious, slow, methodical rhythm of sneaking gets neatly paired with a chaotic flurry of improvisational action.

8:02

One moment you're slipping an optic fibre camera under a door or waiting patiently in the shadows. The next you're frantically chasing down a witness, diving through a window, or riding your horse away in a blizzard of gunfire.

Dealing with Quick Load 8:14
8:14

Except… in many games, that's not actually the case. Because forget all the stealth game gadgets I talked about in episode two: the most powerful gadget in many stealth games is this one: the quick load key. It's no secret that many stealth game players experience these games by saving before trying anything remotely sneaky, and then quickly loading back to that save point if things go wrong. And I've got to include myself in that group.

8:42

We use the power of save game time travel to remove mistakes and turn our stealth game story into one where Sam Fisher is never spotted, and never screws up. It's become so prevalent that it's just baked into Shadow Tactics as the official way to deal with failure, and Arkane brought the experience from PC to console in its Playstation and Xbox versions of Dishonored 2. And I think this kinda sucks! It completely breaks the flow of the experience.

9:10

It kills the tension of being spotted if you're one button away from fixing it. It removes all that dynamism of escaping from danger. So how did we get here? Well I think there's a lot of reasons why we abuse these quick save systems. For starters, there's the inherent power fantasy that these games provide. They tell us that we're supposed to be an impossibly good spy, ninja, assassin or whatever. Someone who goes through missions without ever being spotted and would never make a mistake.

9:39

So recovering from an unforced error just doesn't really fit with that. And I don't know how to fix that one - that's maybe one for the narrative people Then there's the fact that the searching part of this whole equation is really dull. Escaping is fun, but sitting in a cupboard for more than a minute before the system is reset is incredibly boring and so why wouldn't you just reload to the moment before you got spotted?

10:03

And then you've got achievements, score rankings, and end-of-level checkboxes for playing without ever being spotted. Now don't get me wrong, I think these are cool because "ghosting levels" is a legitimately interesting way to play stealth games. Just, in the same way that speedrunning is an interesting way to play - and yet, no developer would ever try to encourage players to do that on their first ever playthrough of a game.

10:26

So developers should try to find ways to get around this. For example, the game Assault Android Cactus rewards players who can chain together every single enemy in a single level. But the game doesn't tell you that it's tracking this until you do it for the first time. So this rewards particularly good players, without confusing new ones about how to play the game. Developers, just copy that. That's… that's really smart.

10:51

And then there's the fact that these quick save systems exist at all. They don't have to be in there, and there's plenty of games - especially those that originated on console - which just have checkpoints at the start of each encounter. That way, you're encouraged to keep playing and see if you can salvage your screw up. And I mean, developers could at least limit the ridiculous effectiveness of quick save. Let's look to another genre where a single screw up can be disastrous: racing games.

11:17

For about a decade now, racing game developers have offered the ability to rewind time, back to the exact moment before you took that terrible corner and crashed into a tree. And this is really smart. Not just because rewinding is way more intuitive than manually saving. But because these developers almost always limit the number of rewinds you can use per race. This means that you can overcome a few mistakes, but can't just redo every single error until you have an absolutely perfect lap.

11:47

There's already a similar system in the Arkham games. It's very easy to escape from danger, bounce around a few gargoyles, and almost immediately reset the system back to stealth. But batman will take a face-full of buckshot in the process and lose some health - which does not regenerate until the end of the encounter. This means that Batman can only make a finite number of booboos before it's game over.

Conclusion 12:13
12:12

So, when you get spotted, an elegantly designed stealth game doesn’t just end or switch to a completely different genre. Instead, it forces you to find a way out of the situation - but it also quickly lets you return to the sneaky action you came for. This is achieved through clever AI states, and design that encourages players to hide - rather than kill or quick load. And that's it for the School of the Stealth. Thank you so much for following this short mini-series and I hope you found it interesting.

12:44

Of course, there's more I could talk about, like multiplayer stealth games, or the early submarine sims that inspired the genre. But I hope this gives you the basic rules that you can learn, use, and then, most importantly of all, ignore. I can't wait to see what the future of the stealth genre looks like. Hey! Mark here. Just wanted to say a quick "thank you" to everyone who's signed up to the game jam over on itch.io.

13:10

We've already had over 5,000 sign-ups, meaning that this one is on pace to be even bigger than 2019's jam. Which broke itch.io's servers because it was so big. Uh... fingers crossed that that doesn't happen again. Anyway. Thanks and see you soon.