WEBVTT 00:00:03.780 --> 00:00:09.400 There aren’t many genres with such a strong core fantasy, as the stealth game. 00:00:09.400 --> 00:00:14.639 These are games about staying unseen, and then striking from the shadows. 00:00:14.639 --> 00:00:19.369 About outsmarting an entire army of enemies, without them even knowing you exist. 00:00:19.369 --> 00:00:24.540 These are games about spies, assassins, and, uh, Batmen. 00:00:24.540 --> 00:00:29.380 But making this fantasy work means balancing a number of complicated game systems: from 00:00:29.380 --> 00:00:34.160 enemy awareness, to information gathering, to robust detection systems. 00:00:34.160 --> 00:00:37.649 Get any of them wrong, and the whole thing can crumple in on itself. 00:00:37.649 --> 00:00:41.100 So, welcome to the School of Stealth. 00:00:41.100 --> 00:00:46.070 This is a short, GMTK mini-series about how stealth games work. 00:00:46.070 --> 00:00:51.079 In each episode, I’m going to take one system from the stealth game formula and break down how 00:00:51.079 --> 00:00:56.679 it works - looking, where necessary, at the technical side of things, the design considerations, 00:00:56.679 --> 00:00:58.909 and the end user experience. 00:00:58.909 --> 00:01:04.059 For episode one, we need to start where most stealth games begin: with the player being 00:01:04.059 --> 00:01:05.110 hidden. 00:01:05.110 --> 00:01:11.770 And then ask ourselves: how do guards actually see and hear the player? 00:01:11.770 --> 00:01:17.409 Ultimately, guards in games are given virtual eyes and ears that are designed to simulate 00:01:17.409 --> 00:01:21.530 the two main human senses: sight and sound. 00:01:21.530 --> 00:01:27.509 To simulate vision, video game guards typically have a viewcone - which is an invisible, cheese-like 00:01:27.509 --> 00:01:30.380 entity that is stuck to the enemy’s face. 00:01:30.380 --> 00:01:34.070 If the player character enters the cone, they get detected. 00:01:34.070 --> 00:01:37.049 It’s a touch more complicated than that, of course. 00:01:37.049 --> 00:01:41.540 A simple cone would allow characters to stay unseen even if they were right next to the 00:01:41.540 --> 00:01:44.750 enemy - so more complex shapes are often used. 00:01:44.750 --> 00:01:49.770 In Splinter Cell Blacklist, there’s a basic vision cone for the guard’s primary sightline, 00:01:49.770 --> 00:01:53.759 but a second, much wider box to simulate peripheral vision. 00:01:53.759 --> 00:01:59.070 And even a small area behind the guard to mimic that sixth sense of knowing when someone’s 00:01:59.070 --> 00:02:01.260 just over your shoulder. 00:02:01.260 --> 00:02:05.400 Developers will also need to consider the height of the cone, depending on whether the 00:02:05.400 --> 00:02:08.789 character should be able to hide when they’re above enemies. 00:02:08.789 --> 00:02:14.160 To know if the player is in cover, a game will typically use a raycast - which is basically 00:02:14.160 --> 00:02:19.569 when an invisible line is drawn between two elements to see - in this case - if anything 00:02:19.569 --> 00:02:21.260 is in the way. 00:02:21.260 --> 00:02:27.340 You can make this more complex to catch moments of partial cover: so, in Splinter Cell, the 00:02:27.340 --> 00:02:32.010 enemy raycasts to eight different bones in Sam Fisher’s player model - and will only 00:02:32.010 --> 00:02:35.190 spot him if a certain number are visible. 00:02:35.190 --> 00:02:42.180 Now, if the player enters the cone and isn’t in cover, they probably don’t get immediately spotted. 00:02:42.180 --> 00:02:45.920 Instead, the guard’s awareness of the player starts to grow. 00:02:45.920 --> 00:02:51.349 The speed at which this meter fills might be slower if the character is further away, 00:02:51.349 --> 00:02:55.880 or only in the guard’s peripheral vision, or in low light, or crouching down, or 00:02:55.880 --> 00:02:57.580 staying perfectly still. 00:02:57.580 --> 00:03:01.710 When the meter tops out, though, the guard will know exactly where you are. 00:03:01.710 --> 00:03:06.051 It’s also important to note that guards can be aware of more than just the player 00:03:06.051 --> 00:03:10.260 character - such as open doors, interesting objects, or dead bodies. 00:03:10.260 --> 00:03:14.970 This can be used to make interesting plans like traps and distractions - but it can also 00:03:14.970 --> 00:03:18.920 help give the impression of intelligence and awareness. 00:03:18.920 --> 00:03:22.450 Now, simulating hearing is a different problem. 00:03:22.450 --> 00:03:27.250 When you make a sound, like firing a gun, walking on a loud floor board, or throwing 00:03:27.250 --> 00:03:33.020 a stone - the sound will be given a distance - related to the volume of that noise. 00:03:33.020 --> 00:03:37.190 Any guard who is within that distance can then be told to go check out the source of 00:03:37.190 --> 00:03:38.510 the sound. 00:03:38.510 --> 00:03:43.720 However, a straight line between the sound and the guard won’t work, because we expect 00:03:43.720 --> 00:03:46.370 noises to be muffled by walls. 00:03:46.370 --> 00:03:51.799 So the typical solution is to use the game’s pathfinding system - the same tech that allows 00:03:51.799 --> 00:03:56.299 an enemy to find their way around a world without bumping into objects. 00:03:56.299 --> 00:04:01.390 Make the sound travel across that, and you’ll more realistically capture the way sound propagates 00:04:01.390 --> 00:04:04.100 through an environment in real life. 00:04:04.100 --> 00:04:08.920 That’s the gist of things, then, but more complex stuff might be included in certain 00:04:08.930 --> 00:04:14.360 games - for example, in Thief, guards can have second-hand information about the player 00:04:14.360 --> 00:04:17.020 based on what other enemies are up to. 00:04:17.020 --> 00:04:22.389 And in Hitman 2, enforcer characters are way less perceptive of Agent 47 if he’s facing 00:04:22.389 --> 00:04:25.780 away from them, which gives disguises more power. 00:04:25.780 --> 00:04:32.320 Links to more detailed technical information can be found in the description beneath this video. 00:04:32.320 --> 00:04:38.480 When done well, this system should create a pretty realistic representation of a human’s 00:04:38.480 --> 00:04:40.710 visual and auditory perception. 00:04:40.710 --> 00:04:45.280 You can then make educated decisions about where you will be safe, using your real-world 00:04:45.280 --> 00:04:50.090 knowledge of how sight works in different light conditions, or how sound might be muffled 00:04:50.090 --> 00:04:51.090 by a wall. 00:04:51.090 --> 00:04:55.370 But there’s always going to be a certain level of ambiguity for the player to deal 00:04:55.370 --> 00:04:58.080 with - which can lead to friction and frustration. 00:04:58.080 --> 00:05:01.830 I’m sure you’ve played a stealth game where you thought you were totally invisible, 00:05:01.830 --> 00:05:04.000 but the guard saw you anyway. 00:05:04.000 --> 00:05:08.310 So to help players make sense of this stuff, there’s a few smart ways that devs can make 00:05:08.310 --> 00:05:11.020 these perception systems more obvious. 00:05:11.020 --> 00:05:14.280 The first is helpful interface elements. 00:05:14.280 --> 00:05:18.560 Even way back in Thief, the developers knew that it was tough for players to understand 00:05:18.569 --> 00:05:23.930 how lit their character was from a first-person perspective, so there’s a light gem at the 00:05:23.930 --> 00:05:27.690 bottom of the screen to show your current visibility. 00:05:27.690 --> 00:05:32.100 And in Splinter Cell, the awkward challenge of knowing how much sound you’re making, 00:05:32.100 --> 00:05:35.690 is helped by a visualiser on Sam’s head’s up display. 00:05:35.690 --> 00:05:40.870 Also, most games have some kind of detection indicator on their interface, which mimics 00:05:40.870 --> 00:05:43.449 the guard’s awareness meter from earlier. 00:05:43.449 --> 00:05:47.050 This helps the player know that they’re about to be made - and sometimes even shows 00:05:47.050 --> 00:05:50.100 you the location of the guard who’s seen you. 00:05:50.100 --> 00:05:55.389 Next up is using animation and audio to help communicate a guard’s status to the player. 00:05:55.389 --> 00:06:00.919 A guard who is idly lazing about might suggest that they have pretty weak perception, but 00:06:00.919 --> 00:06:06.569 a suspicious enemy with their weapon raised will be way more alert to potential threats. 00:06:06.569 --> 00:06:11.380 Audio barks also let you know that the guard is starting to become aware of you. 00:06:11.380 --> 00:06:13.800 Then there are refuge spaces. 00:06:13.800 --> 00:06:17.400 These are places in the game world where, in normal circumstances, 00:06:17.400 --> 00:06:19.400 you are unambiguously hidden. 00:06:19.400 --> 00:06:24.979 That might be the high-up gargoyles in Batman, or areas of long grass in Assassin’s Creed, 00:06:24.979 --> 00:06:27.770 or crates and cupboards in Hitman. 00:06:27.770 --> 00:06:34.160 These give you at least one place where you can scout and plan from a position of total safety. 00:06:34.160 --> 00:06:39.720 Another big solution is player favouring - which is the art of handicapping systems to bias 00:06:39.720 --> 00:06:40.720 the player. 00:06:40.720 --> 00:06:45.300 As Splinter Cell Blacklist programmer Martin Walsh says, “it doesn’t matter what the 00:06:45.300 --> 00:06:49.120 NPC can see or hear from a simulation perspective. 00:06:49.120 --> 00:06:54.520 It’s what the player thinks the NPC should be able to see or hear”. 00:06:54.520 --> 00:06:59.740 So in his game, a guard’s hearing is reduced by half when they’re offscreen, because 00:06:59.740 --> 00:07:03.850 it feels unfair to be heard by someone you can’t even see. 00:07:03.850 --> 00:07:09.030 And in The Last of Us, enemies typically raycast to Joel’s head to determine line of sight 00:07:09.030 --> 00:07:14.430 - but that changes to his chest when he’s crouching, to let him peep over cover without 00:07:14.430 --> 00:07:15.810 being spotted. 00:07:15.810 --> 00:07:21.419 And then the biggest help of all, as discussed earlier, is a fuzzy detection system. 00:07:21.419 --> 00:07:25.840 If you were immediately spotted when you touched the guard’s vision cone, that wouldn’t 00:07:25.840 --> 00:07:27.110 feel very fair. 00:07:27.110 --> 00:07:32.310 So it makes sense that guards take a few moments to become aware of your presence before being 00:07:32.310 --> 00:07:34.280 totally alerted. 00:07:34.280 --> 00:07:40.120 Now there’s one final, and rather bold solution to this problem: and that’s to simply reveal 00:07:40.139 --> 00:07:41.980 these systems to the player. 00:07:41.980 --> 00:07:47.069 In the excellent side-scrolling sneak ‘em up Mark of the Ninja, the guard’s perception 00:07:47.069 --> 00:07:50.199 is about as unambiguous as you can get: 00:07:50.199 --> 00:07:52.930 Their vision cones are displayed on screen. 00:07:52.930 --> 00:07:58.180 The ninja is either in shadow or in light - and that’s shown on the character’s sprite. 00:07:58.180 --> 00:08:03.680 And when you make noises, you can see them emanating from the source as big round pulses. 00:08:03.680 --> 00:08:08.539 This is also shown to you before you even make the noise, which is helpful for knowing 00:08:08.539 --> 00:08:14.300 whether your noisy distraction or sneaky getaway will be successful. 00:08:14.300 --> 00:08:19.050 With the info on screen, there’s no arguing about what’s happening in the system. 00:08:19.050 --> 00:08:21.919 You’re either in the cone, or you’re not. 00:08:21.919 --> 00:08:25.630 And that sound either reached the guard’s ears, or it didn’t. 00:08:25.630 --> 00:08:31.110 And so Ninja’s binary perception system can be paired up with a totally binary detection 00:08:31.110 --> 00:08:37.510 system of instant awareness - though, there is a slight analogue fuzziness on the very 00:08:37.510 --> 00:08:39.400 edges of the enemy’s view cones. 00:08:39.400 --> 00:08:40.660 GUARD: "Is someone up there?" 00:08:40.660 --> 00:08:46.420 For a slightly more nuanced take on this, check out Shadow Tactics: Blades of the Shogun. 00:08:46.420 --> 00:08:52.190 Here, the vision cone is split into three zones: the bright green part near the enemy’s 00:08:52.190 --> 00:08:56.880 face is the danger zone and leads to a pretty instantaneous detection. 00:08:56.880 --> 00:09:01.570 In the dark green part, you can stay hidden if you’re crouched down, but will be spotted 00:09:01.570 --> 00:09:03.100 if you stand up. 00:09:03.100 --> 00:09:08.470 And the dotted part is for refuge zones like bushes and high grass, where you will always 00:09:08.470 --> 00:09:09.900 be invisible. 00:09:09.900 --> 00:09:15.100 If you do trip the viewcone, the whole cone will fill up with yellow - and if the yellow 00:09:15.100 --> 00:09:17.700 part touches your character, you’re spotted. 00:09:17.700 --> 00:09:24.000 It’s a very elegant way of displaying all the necessary information, right there on screen. 00:09:24.000 --> 00:09:29.010 Of course, it’s a lot harder to show this sort of stuff in a fully 3D game. 00:09:29.010 --> 00:09:33.410 The original Metal Gear Solid’s solution was to simply photocopy the game world into 00:09:33.410 --> 00:09:39.040 a top-down, 2D representation on your radar, and then draw the vision cones on that. 00:09:39.040 --> 00:09:45.520 It’s a sorta hand-wavey solution that’s still being used in games like Deus Ex: Mankind Divided. 00:09:45.520 --> 00:09:47.040 But it’s not impossible. 00:09:47.050 --> 00:09:53.280 The Sly Cooper series has guards with torches that cast obvious pools of yellow light. 00:09:53.280 --> 00:09:58.700 If you find yourself inside the light, you get spotted - but otherwise you’re safe. 00:09:58.700 --> 00:10:00.340 Cartoony, yes. 00:10:00.340 --> 00:10:03.620 But also, immediately readable. 00:10:03.620 --> 00:10:09.560 The most important thing, though, is the experience that these different perception systems lead to. 00:10:09.560 --> 00:10:15.100 When the system is made analogue and ambiguous, the player must evaluate the environment with 00:10:15.100 --> 00:10:20.500 an immersive and realistic understanding of light, shadow, distance, and sound. 00:10:20.500 --> 00:10:25.690 And it also gives the game a certain level of tension - where you can never been 100% 00:10:25.690 --> 00:10:27.190 sure that you’re safe. 00:10:27.190 --> 00:10:32.020 And I think this fits quite nicely with the core stealth fantasy: these are games where 00:10:32.020 --> 00:10:37.150 your power doesn’t come through sheer brute force, but only through your ability to hide 00:10:37.150 --> 00:10:38.510 from the enemy. 00:10:38.510 --> 00:10:43.110 So having your sneaky status be fragile and fuzzy reminds you that you’re always at 00:10:43.110 --> 00:10:46.850 risk of losing your tenuous advantage over the enemy. 00:10:46.850 --> 00:10:51.390 As Thief programmer Tom Leonard says, “it's about getting the player's heart pounding 00:10:51.390 --> 00:10:54.290 by holding them on the cusp” of being found. 00:10:54.290 --> 00:10:58.590 And it’s especially important to hide this stuff in survival horror games that borrow 00:10:58.590 --> 00:11:00.100 stealth elements. 00:11:00.100 --> 00:11:04.850 In a game like Alien Isolation, it would be rubbish if you could see exactly where the 00:11:04.850 --> 00:11:06.410 Xenomorph was looking. 00:11:06.410 --> 00:11:12.640 A huge amount of fear and anxiety is derived from your shaky knowledge of the alien’s senses. 00:11:12.640 --> 00:11:15.580 But making the system completely obvious has its own advantages. 00:11:15.580 --> 00:11:21.360 It puts way more power in your hands, and allows you to play with a huge amount of confidence. 00:11:21.360 --> 00:11:27.280 You can feel more like an apex predator, luring enemies into traps or sneaking in for a silent kill. 00:11:27.280 --> 00:11:32.440 As Ninja producer Jamie Cheng put it, “as we were iterating, I found that I wasn't nearly 00:11:32.440 --> 00:11:37.020 as interested in guessing whether a guard would hear me or not, and way more interested 00:11:37.020 --> 00:11:39.470 in creating an elaborate death trap”. 00:11:39.470 --> 00:11:44.750 Of course, the predator feel can be achieved through other methods, like those aforementioned 00:11:44.750 --> 00:11:50.010 refuge zones and by giving the player a bucketload of gadgets and super powers - but the more 00:11:50.010 --> 00:11:54.200 accurately they can predict the enemy’s perception, the quicker the player will get 00:11:54.200 --> 00:11:56.120 to that experience. 00:11:57.020 --> 00:11:59.040 So, that’s it for lesson one. 00:11:59.040 --> 00:12:04.290 Stealth game guards see and hear through a system of simulated eyes and ears - and developers 00:12:04.290 --> 00:12:09.300 can create very different experiences, depending on how much of that system they surface to 00:12:09.300 --> 00:12:10.580 the player. 00:12:10.580 --> 00:12:15.200 Come back next time for more deep dives into sneak ‘em up design. 00:12:15.200 --> 00:12:19.440 And if you subscribe to my channel, you’ll get access to the new episode as soon as it 00:12:19.440 --> 00:12:20.460 goes live. 00:12:22.580 --> 00:12:24.260 Hey. Thanks for watching. 00:12:24.260 --> 00:12:28.540 I hope you’re all doing okay in the midst of this awful coronavirus pandemic. 00:12:28.540 --> 00:12:33.192 It’s such a scary situation, so please stay safe, wash your hands, 00:12:33.192 --> 00:12:35.730 and follow the necessary guidelines. 00:12:35.730 --> 00:12:40.200 I’ll do my best to keep making interesting stuff to keep you busy and entertained.