Category:Detection

From the CreationKit Wiki
Jump to navigation Jump to search

Detection Value[edit | edit source]

Detection is a complicated process involving many variables. The factors break down into three categories: skill, visibility, sound. These three factors are added together to determine whether one actor detects another. Actors can also detect Detection Events -- sounds directly or indirectly generated by a target actor -- even if they don't detect the target directly.

The basic formula is as follows:

Detection Value = fSneakBaseValue + (Sound factor * Distance attenuation ) + (Visual factor * Distance attenuation) + (Actor Skill factor * Distance attenuation) + ( Actor Skill factor - Target Skill factor )

Distance Attenuation[edit | edit source]

Each of the three detection factors is modified by distance using the following formula:

( ( fSneakMaxDistance - distance ) / fSneakMaxDistance ) ^ fSneakDistanceAttenuationExponent

Sound is further attenuated if there is no line of sight between the actor and the target using fSneakSoundLosMult (0.3).

Sound[edit | edit source]

Sound is made up of 2 factors: movement and action.

Movement is the sound made when moving. If the target is stationary, this is 0. Otherwise:

Movement Sound = ( fSneakEquippedWeightBase + fSneakEquippedWeightMult * armor weight)
If running, use fSneakRunningMult.

Action is the "action sound" made by the target -- the sound of any weapon being used.

 Action Sound = Action * fSneakActionMult

Sounds subtotal:

Sound factor =  Attenuation * fSneakSoundsMult * (Movement + Action)

Visual[edit | edit source]

The visual factor is determined as follows:

Visual Contact: If can't see target, visual element is 0
Movement Multiplier: 1 + Moving * fSneakLightMoveMult + Running * fSneakLightRunMult
Light: ( fDetectionSneakLightMod + light level ) * fSneakLightMult
Blindness: ( 100 - blindness )/100
Invisibility: If Invisible== 1, multiply by fSneakStealthboyMult

Visual subtotal:

Visual factor = Attenuation * VisualContact * Light * Movement * Blindness * Invisibility

Skill[edit | edit source]

The actor running detection uses Sneak skill to determine a base Sneak skill:

Base Sneak Skill = fSneakPerceptionSkillMin + (fSneakPerceptionSkillMax - fSneakPerceptionSkillMin) * Sneak / 100

This can be further modified by various factors: is the actor in the Alert state; is the actor sleeping; is the actor in combat with something else.

Modified Sneak Skill = Base Sneak Skill * (1 + Alert * fSneakAlertMod + Sleeping * fSneakSleepBonus + NotCombatTarget * fSneakCombatMod)

Detection States[edit | edit source]

The detection value is used to determine when an actor changes its detection state.

Actors pass through 4 detection states: Normal->Alert->Combat->Lost->Normal. Actors enter the Alert state when they either "almost" detect an enemy, or detect a "detection event" generated by an enemy. Alerted actors will search towards detection events, which will allow them to detect enemies and enter the Combat state. If all targets become undetected, an actor will drop out of combat into the Lost state, searching towards the last known locations of its targets until it either redetects them or all targets regain their full Stealth Points and they return to Normal state.

Definitions[edit | edit source]

Actors are always in one of the following detection states:

Normal
Default state of all actors.
Alert
I am aware of a Detection Event. May include search behavior, but always includes "weapon out". Actors have increased Perception when in this state.
Combat
I am in combat with at least one actor in my target list.
Lost
I've transitioned from Combat because all of my targets became undetected. Similar to Alert state in most respects.


State Transitions[edit | edit source]

Actors transition between detection states according to the following rules:

Normal --> Alert[edit | edit source]

This transition happens when a hostile actor (an actor that I would attack if I detected it) either:

  1. Comes within my detection threshold (detection > 0). Add a detection event to my alert list at the actor's current location with the magnitude of current detection.
  2. Creates a "Detection Event" that I detect (e.g. firing a weapon). Add the detection event to my alert list.
  3. Damages me. Add a detection event to my alert list at the enemy's current location with magnitude of current detection.

Normal --> Combat[edit | edit source]

This transition happens when a hostile actor suddenly becomes detected without triggering the Alert state on me. This can happen in several ways:

  1. The hostile actor goes very rapidly from detection < 0 to detection above the combat detection threshold (iCombatStealthPointSneakDetectionThreshold or iCombatStealthPointDetectionThreshold, depending on if the target is sneaking or not) - in which case the target's Stealth Points are ignored.
  2. The state changes such that the target is suddenly considered hostile (this is usually a quest situation, or due to the player committing a crime).

Alert --> Combat[edit | edit source]

This transition happens when I fully detect any actor to which I'm hostile:

  1. Detection against the target exceeds the combat detection threshold - in this case, the target is immediately detected regardless of its remaining Stealth Points.
  2. Target's Stealth Points reach 0, and my detection against the actor is > 0.

Alert --> Normal[edit | edit source]

This transition happens when my detection against all targets in my alert list is < 0, AND all the targets have Stealth Points = 100.

Combat --> Normal[edit | edit source]

This transition occurs whenever I have no targets in my combat list (i.e. they're all dead or no longer considered hostile), and I have nothing in my alert list.

Combat --> Lost[edit | edit source]

This transition occurs whenever all my targets are undetected (detection < 0) AND their timers have all expired (see below), and I have events in my alert list.

Lost --> Normal[edit | edit source]

This transition occurs whenever all my targets < 0 AND all the targets have Stealth Points = 100.

Lost --> Combat[edit | edit source]

This transition occurs whenever one of these happens:

  1. I detect any of my targets (detection > 0), AND the target's Stealth Points = 0
  2. I detect any of my targets > combat detection threshold (iCombatStealthPointSneakDetectionThreshold or iCombatStealthPointDetectionThreshold, depending on if the target is sneaking or not).

Target List[edit | edit source]

Actors in combat (which includes Alert, Combat, and Lost states) hold a list of hostile actors in their target list.

Whenever an actor in my target list becomes undetected (detection < 0), start running a timer on that target. If timer expires and target is still undetected AND not currently being searched for (either I'm searching for someone else, or still in combat with someone else), remove the target from my list.

Actor Behavior[edit | edit source]

Alert State[edit | edit source]

The Alert State is a combat state -- the actor is in combat, although it has not located a target to attack. If allowed by its current package, the actor will engage in search behavior towards detection events in its alert list (see Combat Search).

Lost State[edit | edit source]

The Lost State is also a combat state -- the actor remains in combat, but has lost detection on its targets. The actor will engage in search behavior, starting with its current combat target if more than one target remains in its list (see Combat Search).

Voice/Sound cues[edit | edit source]

When actors are in a combat search (Alert or Lost states), they will occasionally use these default Detection topics for dialogue barks.

  • LostIdle: Used when actors are in the Lost state. Examples: "Nothing yet.", "Keep looking. He's got to be here somewhere."
  • AlertIdle: Used when actors are in the Alert state. Examples: "I could have sworn I heard something.", "Hmm. Maybe I'm just hearing things.", "I'll check over here.", "Anybody there?"

Transitions: there also default Detection topics for the transitions between detection states:

  • NormalToAlert
  • AlertToCombat
  • NormalToCombat
  • AlertToNormal
  • CombatToNormal
  • CombatToLost
  • LostToNormal
  • LostToCombat

Detection Events[edit | edit source]

A detection event is a sound/action at a location, that can be detected by an actor in a similar manner that it detects other actors. In general, actors will only respond to a detection event if it was produced by an actor that they are aggressive towards.

A Detection Event has the following data attached to it:

  • Owner -- Actor that caused it
  • Action rating -- this plugs into the detection formula, and is the main component of how "loud" the event is. This comes from the projectile or explosion.
  • Location -- used by alerted actors as the location of their search.

Procedure[edit | edit source]

Generating a Detection Event[edit | edit source]

A detection event is generated when a projectile impacts something -- arrow, spell, etc. Action rating = taken from the projectile.

When a detection event is generated:

  1. Actors within the detection radius (fSneakMaxDistance) run detection on the event to see if they detect it. Actors who would not respond aggressively toward the detection event owner ignore the event, as do actors who are already in Combat state.
  2. If an actor detects the event (>fSneakNoticedMin), they are immediately put into Alert state. If they are already Alert, add the event owner to their target list.

Pages in category "Detection"

The following 2 pages are in this category, out of 2 total.