top of page

Stealth Design Part 1 - Detection

  • Writer: gamedesigndiary
    gamedesigndiary
  • Feb 13, 2024
  • 10 min read

Updated: Feb 14, 2024



I've always had a love for stealth games, this is part 1 of a 8 part series on how to create a great stealth system. This first part is for designers new to stealth. Remember there are many approaches to any system so always consider What Experience your design needs to deliver, Why it needs to deliver this experience & How you will deliver this design while knitting it into other complimentary game systems to deliver on the vision.


Part 1- Player detection

Part 2 - AI states

Part 3 - States & behaviour

Part 4 - Audio detection

Part 5 - Stealth system summary

Part 6 - AI variants & equipment

Part 7 - Combat

Part 8 - Level design tips

Part 9 - The 3 C's - camera, control & character

Part 10 - Co-op


Feel free to message me (click here) if you have questions.

 

Stealth Series

Part 1 - Player Detection

 

This is the basic theory of a detection system for stealth, future posts will dive into detail of the many parts, this will cover.

 

1 - Basic detection system

2 - Light based detection system

3 - The stretched second, the key to great stealth

4 - Other types of detection gameplay

5 - Questions to challenge your design & tips

 

Detection determines the trigger to activate an AI’s interact with the player(s) & other AI(s). In stealth games it is even more important, requiring multiple levels of detection & AI reaction to allow players to react & remain in stealth.

 

1 - Basic detection system

 

A simple detection system works like this.


  • Player Detection - The player moves within the detection radius/vision cone for the AI

  • AI Communication - AI Barks (Potentially alerting other AI's)

  • Behaviour based on Detection - AI changes its behaviour from patrolling or an idle animation to combat or other appropriate action

  • Player Action - The players fights or interacts, else they move away resulting in the AI returning to its default behaviour after a period of time/distance.



Mario is a good example of a simple AI system that engages when close & stops as the player retreats a set distance (or leaves a particular area). Some games don't need a patrol state, their AI starts in combat as soon as the player enters the space with detection used to trigger combat.



So…..


 - What is the differentiation in stealth system detection requirements compared to Mario?

 - Isn’t a stealth system just triggered by a more complicated detection system?


 ...well yes, however there is a difference in what is required for a stealth system to be successful in combination with good detection, including:

 

  • The ability to remain in stealth after detection – The creation of a period of time after detection (a stretched second) where the player knows the AI has detected them but has not yet identified them as an enemy (or alerted others). This moment provides a chance for players to remain undetected through deliberate action.

  • A clear empowering system - Provide clear information & understanding of AI behaviours & intended actions or security systems allowing players to plan their actions to maintain an undetected state & achieve their goals.

  • An accessible array of tactical options - Players should feel empowered to express their tactical choices as a badass operative in any situation/location by distracting, hiding, trapping or taking out enemies using actions, abilities, weapons, gadgets or the environment.

 

 

2 - Light based detection system

 

We will assume we are making a stealth game like Splinter Cell, Deus-Ex or Metal Gear .e.g. Shadow based single player story title where the player has weapons & gadgets. Ultimately you will need to determine what your game needs & create a design that is appropriate.

 

The building blocks of a core stealth system include:

 

  • Player character - A player avatar with basic human movement allowing them to move in and out of patches of light & dark as well as gain distance from our AI guard

 

  • A light detection system - Our system will detect the player being in light adding 'X' points per second, multiplied by 'X' +/- based on distance from the enemy (up to a maximum of 100 points a second e.g. the player is standing in full view under a spotlight). Our systems detection value will run from 0-100 with 100+ being fully detected and 0 being fully hidden.

 

  • AI behaviour based on player detection value - With our scale of 0-100+ we can apply the following:

    • 0-40 > AI idles, patrols and they do not see anything

    • 41-70 > AI sees 'Something' and will look towards the 'thing' they detected

    • 71-100 > AI definitely sees something and will move to investigate

    • 100+ > AI enters combat, the player has been identified as hostile

 

  • A method to reset the detection calculation or exit combat back to stealth - let's use darkness to reset / lower the light calculation if the player is in shadow for 'X' seconds and again use distance to increase/decrease the timer +/- to adjust AI behaviour.

 

[Note: This doesn't take into account sound, level variables or equipment etc., you need to add these into this system for a fully featured game. To be covered in a future post]

 

If we put these pieces together it creates a system where whenever the player enters light, the AI (over time) changes their behaviour to match the detection player light value as follows:

 

Scenario 1 – Player at a distance enters the light in view of an enemy at a distance

 

0-40 player light value - The player is hidden in the shadow, the AI is unaware & in an idle or patrol state



41-70 player light value - The player partially enters light & their light value raises to 41+. The AI responds by changing their state from an 'idle state/patrol' to a 'seen something' state after 'X' seconds of the player being visible & in range. The AI turns towards the players direction to 'look' in addition to an audio prompt.



71-100 player light value - 'X' more seconds pass with the player is still in the light, this raises their light level total to 71+. The AI's state changes from 'seen something' to a 'investigate/search' sate as they have definitely 'seen something' & starts to move towards the player to identify what they have seen.



0-40 player light value - The player has time in these 'stretched seconds' to choose a tactical response to the enemy noticing them from far away before being fully detected & combat starts:

 

  1. Move back into darkness to evade the searching AI

  2. Move back into darkness & ambush the AI with close quarters combat

  3. Use equipment to distract or divert the AI away from you

  4. Use silent equipment to take out the AI (either lethal or non-lethally)

  5. Initiate combat

 

The player decides to move back into the shadows and away from the searching AI. They remaining in shadow & far enough away. The AI searches the last known position of the player & without further detection the AI's state of alertness is reduced. The AI finishes their search & returns to their original idle animation, position or patrol.



101+ player Light value - Had the player NOT returned to the shadows & remained visible in the light, their light level total will eventually reached 101+ based on visibility & closing distance of the AI. When visibility reaches 101+ the AI has identified the player as hostile & enters a 'combat state' at which point combat is initiated.



[Note: This is a layered modular system. A full game requires the AI to remember 'the last known player position' after the player disappears from sight. Once the AI arrives at the last known position, AI logic for search patterns/behaviours are required. This along with systems for multiple AI's & communication between AI's in the same area will be covered in a future post].


Scenario 2 -  Player enters light closer to the enemy

 

0-40 player light value - The player is hidden in the shadow, the AI is unaware & in an idle or patrol state



71 - 100 player light value - The player enters into the light much closer to the enemy AI. After 'X' seconds the AI instantly moves to 'investigate/search' having definitely seen something. Due to the player light value quickly reaching 41+ it skips the 'seen something' state adding 'X' multiplier to the light calculation due to the closer proximity. As in scenario 1, the player still has a 'stretched second' to make a tactical decision even if it is much shorter period in order to prevent combat & remain in stealth.



The system needs to feel natural & react as you would expect it to e.g. if your in a bright light close to enemies your going to be seen quickly vs. partially in shadow at distance taking longer for an enemy to detect that your a hostile.

 

Both these scenarios provide (if a touch exaggerated) an actionable moment (stretch second) to make a tactical choice, empowering players to avoid a combat in most cases & feel awesome. You need this moment of time when there is danger of a sudden transition from stealth to combat, remember this is a stealth game so help the player be stealthy.

 

 

3 - The stretched second, the key to great stealth

 

The key to a great stealth system is the 'stretched second', this means:

 

  • A system that clearly provides feedback that the player has been detected

  • A system that includes multiple AI states representing patrol to pre-combat awareness

  • A system that provides consistent visual (and audio) feedback for AI awareness

  • A system that forgives and allows players to correct mistakes

  • A system that provides a moment before an AI enters combat in which the player can evade, take action or attack

 

Two games that get this right are 'Splinter cell' & 'Metal Gear Solid'. Both of these games empower the player with the ability to feel like a highly trained agent letting them react first & control how the engagement will play out enhancing the feeling of being a silent operative!



[Note: The Splinter cell & Metal Gear series are amazing, I fully recommend them all]

 

Many titles attempt a 'stealth' system but fail to make a functioning 'stretched second'. So instead of an empowering the player to remain in stealth, AI's go from unaware to instant combat. This leads to:

 

  • A frustrating & punishing gaming experience

  • Confusion as to why or when you were seen due to the speed of detection/reaction

  • Players preferring to reloading a checkpoint when detected due to the game-loop taking too long to return them a stealth or it simply not being possible to get back to stealth vs a simple reload.

 

 

4 - Other types of detection gameplay

 

Detection systems with detected as hostile vs. hidden unseen, or undetected as a enemy can be adapted to multiple game experiences:

 

  • Daytime stealth - Move through a a daytime environment full of hostiles using a hide & seek via objects & the environment (System to be detailed in a future post)

  • Conversation stealth - Replicate a conversation system that allows the player to move and bluff their way through restricted areas without combat & multiple outcomes

  • Racing stealth - A police awareness/pursuit system in an open city racing game

  • Sniper stealth - Replicate sniping & the time before being detected & avoiding detection via relocation.

 

Example: Sniper detection system variant

 

Below is a take on the stealth system repurposed as a sniping detection system.


What gameplay your trying to achieve?

  • Create a long distance sniping system that replicates fire & relocate strategy of snipers.

 

How do you alter the light based stealth system?

  • Switch visibility in light for time after the first shot is detected

  • Points system counts from 0-100+

  • States react to points system e.g. 0-40 Dive for cover, 40-70 randomly fire, 70-100 fire close to player, 100+ hit player with accurate fire

  • Distance is a factor that increases points the closer you are by a factor of 'X'

  • Every shot taken before moving to a new position increases counter multiplier by 'X'

  • AI type is a factor with rival snipers & more experience enemies increasing points per second with a multiplier of 'X'

  • Replace shadow with the player moving to a new sniping location to reset the points to 0

  • Better sniping perches reduce points counter by a multiplier of 'X'

  • Player equipment supressing muzzle flash & sound reduces the points counter by 'X'

 

How does this system empower the player?

  • The player feels like a sniper by getting to see reactions to their shot from a place of safety and tactical advantage

  • Players need to be able to start the encounter when they are ready

  • The players tactical choice of a good sniping position increases the time before your discovered

  • Players get enough time to aim & firing before having to move or fear being shot depending on enemies and equipment

  • Players is more aware of when it is time to relocate to a new position before taking damage

  • Impacts & near misses around player create tension & drama



5 - Questions and tips

 

Remember to consider these questions when developing any system.

 

  • Audio – How will audio support your system & effect potential gameplay & immersion?

  • HUD - How are you going to communicate gameplay to the player in a clear way?

  • AI - What AI states does system need?

  • AI types - How do the different AI types, combinations & abilities effect the system?

  • Communication - How is detection information transmitted between AI's?

  • Animation – What is required from animation to provide player feedback? Are they clear?

  • Security - How do cameras or other security systems integrate with AI states?

  • Gadgets - How do the player/AI equipment affect systems & gameplay?

  • Variety - How can your system create variety or create level objectives & challenges?

  • Scalability - Does your system scale for difficulty? Does it need to?

  • Online/co-op play – Does your system need to support multiple players?

  • Misc. – How does weather, environments, physics etc. fit into your system?

 

Here's are a few personal don'ts from my experience.

 

  • Don't attach vision cones to AI's eyes (Or fast moving heads), if they move too fast players can't read or react. Its easier to read if locked to the torso with a 120 degree field of view.

  • Don't instantly tell every AI in the level where the player is the second they enter combat, so many games do this & it breaks immersion as well as being frustrating. It is also a massive barrier to the return to a stealth state.

  • Don't instantly fire on the player even if they step out I front of an AI from a stealth state, play a reaction

  • Don't over design your system, focus on the experience your creating nothing more & be modular allowing you to add new gameplay later or as required by new level/story ideas.

  • Don't have too many similar subtle states, be obvious with the reactions in a few states or players won't be able to read it.

 

Remember to take time to support the vision & empower the player to execute on the desired experience. I’ll cover others systems in subsequent posts in this series.

Comments


© 2023 by Sasha Blake. Proudly created with Wix.com

bottom of page