Scouting mode

 (also simply called stealth mode or sneaking) is a modal character state that can be toggled on a per character basis. It is primarily used to avoid Detection, a change of state where a character or creature becomes aware of your presence. Scouting mode goes hand-in-hand with the Stealth skill, and it can be used to circumvent encounters, scope out an area ahead of the party, set up good positions from which to start a fight, and pickpocket from unsuspecting characters without drawing suspicion.

While stealthed, a characters movement speed is reduced to walking speed, and their recovery time is reduced by -85%, making most actions recover nearly instantly.

As the name would suggest, scouting mode is also a factor in finding hidden objects and traps. If a character is not in scouting mode, they receive a -4 penalty to their Mechanics score when detecting objects. This can make it impossible to detect some objects that would otherwise be detected just fine. Note that this only applies for - scouting mode has no effect on object detection in Deadfire.

This article is primarily an overview of the stealth, detection, and suspicion mechanics in both and.

Overview
When entering scouting mode, the circle under the character's feet becomes dotted and their movement is reduced to walking speed.

The scouting state ends when:
 * The player cancels the scouting mode for that character.
 * The character performs an action (excluding modal abilities) - only in.
 * The circle become fully red (because the character stayed too close to a NPC for too long, see below).

While sneaking, this circle is used to show the maximum "suspicion" level of NPCs around the character, and fills up as the character draws more suspicion.

The circle is initially empty - as long as scouting mode was entered more than 16 meters from an NPC, or out of their direct line-of-sight. It starts to fill up yellow when getting too close to any NPC, and continues to fill up at a rate inversely proportional (more or less) to the distance between the two protagonists. In other words, if the ally stands at the very edge of the NPC's detection radii, the ally's circle will slowly fill up yellow. If the ally or NPC get closer to each other, the fill rate increases. Nothing more happens at this point (NPC don't react yet). This is just a warning to the player.

When the circle is filled with yellow color, hostile NPCs goes into investigation state and approaches the ally while the circle starts to fill red with the same rate rules. At this point, the ally is not visible yet (mechanically speaking, the scouting mode is not disclosed), but usually will be visible soon as the enemy is approaching (unless the ally flees in time, which can be difficult since its speed is greatly reduced).

When the circle is filled with red color, ally is detected. If the detecting NPC is hostile, scouting mode is cancelled and combat starts. Note that if the NPC is friendly, he/she will not investigate and scouting mode will not be cancelled, though stealing items will be noticed by the NPC and he/she may even become hostile (you can steal items unnoticed as long as the circle is empty or yellow).

The Stealth skill of the party member determines the fill rate of the circle (not the distance at which the circle starts to fill up).

Mechanics

 * Perception distance/radius - Also called "suspicion distance/radius" and "detection distance/radius". Determines the range a creature/NPC can detect a stealthed character (party member) or someone stealing from containers. This value is predetermined based on the character's perceptiveness (unrelated to Perception). While within an NPC's perception radius, their suspicion toward you increases at a base rate of 20 units per second.
 * The following table lists the perception radius of an NPC given their perceptiveness. The actual detection radius is double of either: half this radius or the character's model diameter - whichever is larger. The default perception level is Normal (5m radius).


 * Noise - employs a basic noise mechanic. When a character casts an ability, the ability makes noise at a particular noise level. For a set duration (of 1 second), the character retains this noise level, and all NPC's within two times the noise level's radius of the character will immediately investigate its source (setting the suspicion level towards the character to 100, if not already).

In
The stealth system in is based on the same basic principles, but adds a few more mechanics which change much of how detection works while in stealth.

Additional mechanics

 * Facing - The direction that an NPC is facing, represented by a cone of vision. The default vision is 8 meters ahead of the NPC in a 90 degree cone. While in an NPC's vision, their suspicion toward you increases at a base rate of 80 units per second.
 * Hearing - Represented by a "hearing radius". For most characters this radius is 6.0m in length, and cannot go below 1m. While in a bystander's hearing radius, their suspicion toward you increases at a base rate of 40 units per second. While moving, a character's hearing radius is reduced by 25%, as they themselves are muffling their ability to hear other characters. "Hearing" is the equivalent of the detection radius in.
 * Noise - All actions make noise, some more than others. Every time something makes a noise, its position is broadcast to nearby NPC's - who take action on it by roaming to investigate its source. The noise mechanic doesn't contribute to rate of detection, but is important to keep in mind to avoid attracting enemies to your position. Noisemakers such as Sparkcrackers can be used as a distraction to purposely attract enemies to a position, creating enough space for your party to sneak by or gain a positional advantage.
 * Action while sneaking - Characters may now take actions while sneaking, including casting spells, using consumables, etc. Previously in  this would force a character out of Scouting Mode. The noise mechanic adds a risk to using abilities while in stealth, as most abilities make noise which may alert bystanders.

Note that while sneaking, you can hover over an NPC to view their hearing radius and cone of vision.

The following is a list of different detection settings used for creatures and NPCs:



Suspicion rate and calculation
The suspicion/detection rate calculations are virtually identical across both games, albeit with different base suspicion rates (20 in, vs 80 in ). Deadfire also adds another layer of difficulty with its facing mechanic.

The rate of detection is determined by two main factors:
 * The character's Stealth skill versus the level of the NPC.
 * The distance between the character and the NPC.

While in the process of being detected, an NPC's suspicion towards a character increases by a base suspicion rate with a number of modifiers applied that take these factors into account. A separate suspicion level is calculated for each party member being detected. At the same time, each party member keeps track of all NPC's that have suspicion towards them. The NPC will begin to investigate a character once their suspicion reaches 100, and will detect the character when it reaches 200 or more. The fill amount of the circular suspicion indicator uses the highest suspicion level of all detecting NPCs, and is out of 100 (values > 100 wrap around, and change the indicator to red).

In, NPC's use both their hearing and vision to detect characters. These sensing methods use the exact same calculation, but increase suspicion at a different base rate. They both take the character's Stealth skill and NPC level into account, however only hearing is influenced by the distance between the character and the NPC. If the character is within the hearing radius, and the cone of vision of the NPC, the result from both sources is added together.

In, the only way an NPC is able to detect characters is via their detection radius. Other than this, noise made by the character causes the NPC to immediately enter an investigation state (suspicion >= 100) if they are within twice the noise radius.

If you can't physically see an NPC, are more than 16 meters from an NPC, or if you don't have direct line of sight with them (i.e. when there's a wall or obstacle in the way), they will not be able to detect you and the suspicion will not be changed regardless.

Once the character leaves the detection radius (hearing radius and cone of vision), the NPC's suspicion level will begin to drop after a short delay (0.75 seconds). It will then be reduced at a rate of 15 units per second, until it reaches zero.

The following is a detailed overview of factors that contribute to the suspicion rate:

Distance from NPC
The distance between the character and the NPC is used to calculate a multiplier that is applied to the base suspicion rate. At the furthest edge of the hearing radius, the multiplier is 0.5 (halved), and at the closest it is 2.0 (doubled). Note that this is measured from the edge of the character and NPC's model radius, and not the center.

Distance does not apply to the cone of vision calculation, and it instead uses a constant distance multiplier of 0.5, which will increase the suspicion at a rate of 40 per second (not taking into account Stealth vs NPC level).

Click "Expand" to show more details  Firstly, a radius is calculated which represents the sum of the model radius of both the enemy and the party member. This is done so that measurements are from the edge of both party's models, rather than from the center of their position, otherwise you could be standing on top of a character and still be some distance from them. Most characters have a radius of 0.5 meters.

Next, a  value is calculated (in a range of 0.0 - 1.0). This represents how far the character is within the hearing radius, using the  between themselves and the NPC. The  is 1.0 when the character is at the very outer edge of the hearing radius, and 0.0 when the character is directly next to the NPC. It is set to zero if the character is less than 0.9 meters from the NPC.

Note that in actuality, the distance is originally squared as a result of using a performant vector distance calculation, so the square root would have to be calculated for this - but is not shown here for simplicity.

For the cone-of-vision calculation,  is fixed at 1.0, therefore distance is not taken into account. The distance multiplier is then calculated, which increases the rate of change the closer the character is towards the NPC. This gives us a value of MaxDistanceMultiplier if the character is on the furthest edge of the hearing radius, and MinDistanceMultiplier  if the character is the closest to the NPC. The inputted distancePercent is clamped to never be above 1.0 or below 0.0.

Finally the rate is as simple as. As previously mentioned, the baseSuspicionRate is 40 for hearing, and 80 for vision. Internally the rate is also multiplied by the current frame time to determine the exact change on this frame, but can be ignored for the purposes of this example and is therefore shown as a per-second value.

Skill vs NPC level
The difference between the character's Stealth skill and the NPC's level is taken into account as a modifier to the suspicion rate (as calculated above). If your Stealth skill level is at least 75% of the NPC's level, you get a bonus reduction to the suspicion rate, otherwise you get a penalty of an increased rate. The bonus/penalty is always 25% of the character's level for each point of difference between the two, and is limited to a maximum bonus of -95%, and an inherent maximum penalty of +75%.

The calculated skill modifier is applied to the  to get the final rate, using.

Click "Expand" to show more details  The skill modifier is calculated using the formula:

The  value on the right hand side of the division operator is limited to a minimum of 1.0, as to avoid dividing by zero. Note that the above table's results are not a direct result of this calculation! They have had their sign inverted to fit the general-use final suspicion rate calculation:.

In-game the 's result is subtracted from the rate if it's a bonus (i.e. is > 0.0 using the above skill modifier calculation), or it's absolute (non-negative) value is added if it's a penalty (<= 0.0 using the above skill modifier calculation).
 * The  will be > 0.0 if your Stealth skill is at least 75% of the NPC's level. If this is the case, the   is set to be the smaller value of either itself or   . In other words it is capped at a maximum of 0.95. Then the final rate is calculated using:


 * Otherwise, if your Stealth skill is less than 75% of the NPC's level, the skillModifier is set to the smaller of the absolute (non-negative) value of itself, or  . In other words, it is capped at a maximum of 4.0. Then the final rate is calculated using:

Example As an example, here are the calculations if:
 * Both characters have a character radius of 0.5 (default).
 * The player character is 3 meters from an NPC, and their Stealth skill is 8.
 * The NPC's hearing radius is 6 meters (the default), and they are level 10.
 * The base HearingSuspicionRate is 40 and the VisionSuspicionRate is 80.

Click "Expand" to show more details This follows the format: Worded example Actual example Result Description

// Model radius radius = playerRadius + npcRadius radius = 0.5 + 0.5 radius = 1.0 The sum of the character's model radii - a distance that should not be taken into account

// Distance percent/alpha distancePercent = (distance - radius) / (characterHearingDistance - radius) distancePercent = (3.0 - 1.0) / (6.0 - 1.0) distancePercent = 0.4 The character is 40% from the edge of the NPC to the edge of the NPC's hearing radius)

// At this point, the suspicion is calculated with the above values. // If the distancePercent is less than or equal to ~0, the suspicion is set to 200

// Distance multiplier distanceMultiplier = (MaxDistanceMultiplier - MinDistanceMultiplier) * distancePercent + MinDistanceMultiplier distanceMultiplier = (0.5 - 2.0) * 0.4 + 2.0 distanceMultiplier = 1.4 The character gets a +40% to the base suspicion rate.

// Suspicion rate suspicionRate = baseSuspicionRate * distanceMultiplier suspicionRate = 40 * 1.4 suspicionRate = 56 The NPC's suspicion is increased by 56 points per second.

// Skill modifier skillModifier = (stealthSkill - (creatureLevel * 0.75)) / creatureLevel skillModifier = (8 - (10 * 0.75)) / 10 skillModifier = 0.05 This a modifier to the suspicion rate, and is subtracted or added as a percentage from it.

// The calculation of the following final result depends on whether the skillModifier is > 0 or <= 0. Below are the two calculations used

// Final calculation - If skillModifier > 0 // Firstly, limit the skillModifier to a maximum of 0.95 skillModifier = Math.Min(skillModifier, 1.0 - MaxSuspicionStealthDecelerationMultiplier) result = suspicionRate - (suspicionRate * skillModifier)

// Final calculation - If skillModifier <= 0 // Firstly, set the skillModifier to an absolute value and limit it to a maximum of 4.0 (although this limit is never hit) skillModifier = Math.Abs(skillModifier) skillModifier = Mathf.Min(skillModifier, MaxSuspicionStealthDecelerationMultiplier) result = suspicionRate + (suspicionRate * skillModifier)

// In this case, the final result is calculated using the first result = suspicionRate - (suspicionRate * skillModifier) result = 56 - (56 * 0.05) result = 56 - 2.8 result = 53.2 The suspicion rate of this NPC (for their hearing radius) is 53.2 points per second