# Awareness System

> Give an enemy senses: it spots you on sight, hears what it cannot see, remembers where you went, and gives up when the trail goes cold.

Markdown version of https://rigbak.com/docs/soulslike-combat/awareness-system, a page of the Soulslike Enemy Combat documentation. Link that page when citing it.

> An enemy that fights what it has noticed and ignores the rest. Sight fills a meter, a sound raises suspicion, a hit reveals the attacker, and losing you starts a countdown.

## Set it up (45 seconds)

1. **Create an Awareness Config**

   Right-click in the Content Browser, **SEC**, **AI**, **Awareness Config**.

   Create the asset: right-click in the Content Browser, choose **SEC > AI > Awareness Config**, and name it **DA_Awareness_Guard**.

   *Right-click in the Content Browser, SEC, AI, Awareness Config.*

   The defaults are a working guard: 1500 cm of sight across a 180 degree cone, 1200 cm of hearing, and a damage sense that reveals whoever hits it.
2. **Point the AI Config at it**

   Open the enemy's **Enemy AI Config**, and under **Awareness** set **Awareness Config** to the asset. Leave **Manage Awareness Automatically** ticked.

   In **EnemyConfig_Grunt**, under Awareness, set:

   | Property | Value |
   | --- | --- |
   | Manage Awareness Automatically | true |
   | Awareness Config | DA_Awareness_Guard |

   *The controller applies the asset at possession, and builds the perception the enemy needs.*

   Awareness lives on a **SEC Awareness** component on the **AI controller**, and **Enemy Controller Base** carries one already. On an AI controller of your own, add that component first, or the config is applied to nothing and the enemy senses nothing.
3. **Make combat obey it**

   On the same config, set **Target Selector** to **Awareness Filtered Target Selector**. That is the step that stops the enemy fighting people it has not perceived.

   In **EnemyConfig_Grunt**, under Combat Role, set:

   | Property | Value |
   | --- | --- |
   | Target Selector | Awareness Filtered Target Selector (replaces None) |

   *Expand it and Min Required State appears, defaulting to Lost.*
4. **Play, and walk into view**

   Press Play and run `SEC.Debug.Awareness 1`. Each enemy gets a line above its head naming its most-aware target, that target's state, and how full the meter is. Walk into the cone and watch it climb to `Detected`.

> **Warning**
>
> Skip the **Target Selector** and the enemy still engages anything in the fight, whether it has perceived that target or not. Awareness records everything correctly; nothing reads it. The log warns about this once at possession.

Once a target reaches Detected it joins the shared combat pool on its own, so an enemy with awareness starts its own fight. See [Getting Started](https://rigbak.com/docs/soulslike-combat/getting-started) and [Targeting](https://rigbak.com/docs/soulslike-combat/targeting-system).

---

## The five states

*Interactive diagram on the page: Seen = Detected. Lose sight = Lost (grace), then Forgotten, then Unknown.*

| State | Means |
| --- | --- |
| **Unknown** | This enemy has no memory of the target. |
| **Suspicious** | Something registered: a sound, a glimpse at the edge of vision, a meter part way up. The enemy knows where the stimulus came from, not where the target is. |
| **Detected** | Confirmed. Live sight at a full meter, a hit taken, a point-blank target, or a scripted reveal. Last-known location tracks the target as it moves. |
| **Lost** | Was Detected, sight broke. Last-known location freezes at the moment of loss and the grace countdown runs. |
| **Forgotten** | The countdown ran out. The enemy announces it once and drops the memory, so the state reads Unknown after that. |

Anything that compares two states ranks them by confidence: Unknown lowest, then Forgotten, Suspicious, Lost, and Detected highest. That ordering is what **Min Required State** and the **Awareness State At Least** condition test against.

---

## Tune how fast it notices you

Sight fills a 0 to 1 meter. Cross **Suspicion Threshold** and the enemy is Suspicious; reach 1 and it is Detected.

**Details panel: SEC Awareness Config** (data asset, in DA_Awareness_Guard)

**Category: Escalation**

| Property | Value |
| --- | --- |
| Gradual Escalation | true |
| Escalation Rate | 0.9 |
| Suspicion Threshold | 0.2 |
| Hearing Bump | 0.45 |
| Distance Rate Curve | None |
| Angle Rate Curve | None |

*Escalation category on the awareness config asset.*

**Escalation Rate** is meter per second at best range and dead center, so the 0.9 default is about 1.1 seconds to spot someone standing in front of the enemy. Drop it to 0.3 for a sleepy guard and raise it past 2 for an alert one.

**Hearing Bump** is where a sound puts the meter. It is floored at **Suspicion Threshold** and capped below 1, so a noise sends the enemy to investigate and no further.

Damage skips the meter. A hit sets it to 1 and the attacker is Detected at once, whatever the enemy was facing.

**Distance Rate Curve** and **Angle Rate Curve** scale the fill rate. Leave them empty and distance and angle change nothing. Fill them and the X axis runs 0 to 1: distance over **Sight Radius**, and angle over **Peripheral Vision Half Angle**, where 0 is dead center and 1 is the edge of the cone. Y is the multiplier.

Untick **Gradual Escalation** for the flat version: sight fills at 1 per second, ignoring distance and angle, so anything in the cone is Detected in a second.

---

## Tune how long it remembers

**Details panel: SEC Awareness Config** (data asset, in DA_Awareness_Guard)

**Category: Memory**

| Property | Value |
| --- | --- |
| Grace Loss Duration | 5 |
| Suspicious Decay Duration | 8 |
| Evaluation Interval | 0.1 |
| Track Last Known Location | true |

**Category: Proximity**

| Property | Value |
| --- | --- |
| Proximity Radius | 220 |

**Category: Hysteresis**

| Property | Value |
| --- | --- |
| Confirm Lost Delay | 0.5 |

*Memory, Proximity and Hysteresis categories on the awareness config asset.*

**Grace Loss Duration** is the chase tail. For those 5 seconds after sight breaks, the enemy stays engaged, and it snaps back to Detected the instant it sees the target again. Raise it for a dog that will not let go, drop it to 1 for an enemy you can lose around a corner.

**Suspicious Decay Duration** is the other clock. It drains the meter at 1/8 per second while nothing escalates, and the target is forgotten the moment the meter reaches zero, skipping Lost. A sound puts the meter at **Hearing Bump** 0.45, so a noise nobody follows up is forgotten about 3.6 seconds later.

**Confirm Lost Delay** absorbs brief breaks in sight. Without it, an enemy strafing past a pillar would flicker between Detected and Lost.

**Proximity Radius** is the point-blank floor. Inside 220 cm the meter fills at full speed with no line of sight needed. It holds a target the enemy already carries in memory rather than finding a new one: an enemy that has never seen, heard, or been hit by you keeps no record of you, and walking up behind it creates none. Break its sight and then close in, and it pins you back to Detected inside a second. It never holds a target on the enemy's own side. Set it to 0 to allow a backstab from touching distance.

---

## Tune what it senses

**Details panel: SEC Awareness Config** (data asset, in DA_Awareness_Guard)

**Category: Perception**

| Property | Value |
| --- | --- |
| Auto Create Perception Component | true |

**Category: Perception > Sight**

| Property | Value |
| --- | --- |
| Enable Sight | true |
| Sight Radius | 1500 |
| Lose Sight Radius | 1800 |
| Peripheral Vision Half Angle | 90 |
| Sight Max Age | 5 |

**Category: Perception > Hearing**

| Property | Value |
| --- | --- |
| Enable Hearing | true |
| Hearing Range | 1200 |
| Hearing Max Age | 4 |

**Category: Perception > Damage**

| Property | Value |
| --- | --- |
| Enable Damage Sense | true |

*Perception tuning on the awareness config asset the Enemy AI Config points at.*

**Sight Radius** is where the enemy can pick someone up; **Lose Sight Radius** is where an already-seen target drops out. Keep the second larger than the first, since a value below it is raised to match at runtime. **Peripheral Vision Half Angle** is measured from the enemy's forward vector, so 90 is a 180 degree cone and 45 is a 90 degree one.

Once the enemy has spotted a target, it keeps seeing it while the target stands in the cone with the middle, top or bottom of its body in clear view. Only the world blocks that view, never a character or anything a character holds, so another enemy, a passing sword or a thin pole across the target's middle does not drop it to Lost. See **What the sight sense still decides** below for the cases left to the engine's own sight.

**Hearing Range** answers noise the game reports, which means a **Report Noise Event** call or a **Make Noise** on an actor. Nothing is heard until something makes a noise.

Each sense has its own switch, so a blind enemy that hears is one untick away. **Sight Max Age** and **Hearing Max Age** cap how long the engine holds a stimulus before it counts as gone.

> **Warning**
>
> Sight and hearing pick up enemies and neutrals, not friendlies. An enemy defaults to **Team Id** 1 on its **SEC Team** component, and a plain player pawn carries no team, which reads as neutral and is sensed. Put the player on team 1 as well and the enemies go blind to it.

Change a team during play with **Set Team Id** and every enemy's senses read the new team at once, so an enemy can see a player from the moment it turns hostile. An enemy lets go of a target that joins its side: the target drops to Lost after **Confirm Lost Delay** and the enemy forgets it after **Grace Loss Duration**, even when the target stands inside **Proximity Radius**.

An enemy senses only actors it is willing to fight. The **Target Filter** on the AI Config decides that, and a stimulus from an ally is dropped whichever sense reported it, which is what stops a stray sweep from making a friend into a target. See [Targeting](https://rigbak.com/docs/soulslike-combat/targeting-system).

---

## Decide when combat drops

**Min Required State** on the Awareness Filtered Target Selector is the whole feel of disengagement.

**Details panel: Awareness Filtered Target Selector** (instanced object, in Enemy AI Config → Combat Role)

**Category: Awareness Filter**

| Property | Value |
| --- | --- |
| Min Required State | Lost |
| Inner Selector | None |

*Instanced selector on the Enemy AI Config. Needs a SEC Awareness component on the AI controller.*

| Setting | Feel |
| --- | --- |
| **Detected** | Combat drops the moment sight breaks, and the enemy picks a target again as this one drops to Lost. Duck behind a wall and the fight stops, which is what a stealth patrol wants. |
| **Lost** | The default. Combat holds through the grace window and drops at Forgotten, so breaking sight buys you a few seconds rather than a clean escape. The enemy keeps its target through the whole window, whether the target drops to Lost or comes back into view, and picks again once it forgets it. |
| **Suspicious** | The enemy will fight a target it has only heard. Good for something that hunts by sound. |

**Inner Selector** picks among what survives the filter. Leave it empty for the nearest candidate, or nest another [target selector](https://rigbak.com/docs/soulslike-combat/targeting-system) inside it.

---

## Turn a camp instead of one guard

Tick **Alert Allies on Detect** on the Awareness Config and the first confirmed sighting is shared with nearby allies, so a whole camp turns.

| Field | Default | Does |
| --- | --- | --- |
| **Alert Allies on Detect** | off | Shares a target the moment this enemy confirms it. |
| **Ally Alert Radius** | 1500 cm | How far the alert carries. Allies outside it hear nothing. |
| **Ally Alert Cooldown** | 3 s | Shortest gap between two alerts from this enemy, so a target flickering in and out cannot spam the camp. |

Allies need a **SEC Awareness** component of their own to be told, a matching team id, and **Auto-Register for Combat Roles** left ticked on their AI Config. The automatic alert reaches the enemies registered with the combat role system, and with none registered it logs that the alert reached nobody and stops. To fire an alert from a scripted cue instead (an alarm bell, a horn), call **Broadcast Awareness to Allies** with a radius and leave the tick off; that one sweeps the world, so it finds allies whether they registered or not.

---

## React to what it notices

Bind these on the enemy controller's **SEC Awareness** component to drive patrol, investigate and return.

| Event | Fires when |
| --- | --- |
| **On Target Suspicious** | A target first reaches Suspicious. Carries the stimulus location, which is where to send the enemy to investigate. |
| **On Target Spotted** | A target first reaches Detected. |
| **On Target Lost** | A Detected target drops to Lost and the grace window opens. |
| **On Target Forgotten** | The memory is dropped. This is the cue to go home. |
| **On Awareness Progress** | The meter crosses a quarter step (0.25, 0.5, 0.75, 1.0). Drive a UI tick or an audio sting from it. |
| **On Alert Level Changed** | The highest state across all remembered targets changes. |
| **On Target State Changed** | Any transition, carrying the old and new state. |

**Get Last Known Location** returns where a target was last placed and how many seconds ago, which is what a search behavior walks to. **Get Awareness Progress** feeds a meter bar: the live meter while Suspicious, 1 while Detected, and the draining grace fraction while Lost.

In [StateTree](https://rigbak.com/docs/soulslike-combat/statetree), the **Awareness State At Least** condition branches the graph and the **Poll Last Known Location** task feeds an AI Move To.

---

## Debug it

```
SEC.Debug.Awareness 1          // State, meter and last-known age above each enemy
SEC.Debug.All 1                // Every overlay at once
SEC.Debug.WatchPawn <name>     // Narrow the overlays to one enemy
```

The line reads `awareness Detected BP_Player meter 1.00 seen 0.3s ago`, or `awareness aware of nothing` when the enemy remembers no one. It is worked out on the server, so it draws there.

The **SEC Awareness** component carries a **Debug Overlay Awareness** checkbox that turns the same drawing on for one enemy without the console, and it survives a restart.

<details>
<summary>It senses nothing (Advanced)</summary>

In the order worth checking:

- **The player is on the enemy's team.** Sight and hearing skip friendlies outright, and enemies default to **Team Id** 1.
- **No Awareness Config.** The component with no settings senses nothing and logs nothing. Check **Awareness Config** on the AI Config, and that **Manage Awareness Automatically** is ticked.
- **Nothing is making noise.** Hearing waits on a **Report Noise Event**; footsteps do not emit one on their own.
- **The Target Filter refuses the actor.** A stimulus from an actor this enemy will not fight is dropped before it reaches the memory, whichever sense reported it.
- **The class is on Ignored Actor Classes.** Debug and spectator pawns often end up there.
- **Auto Create Perception Component is off** with no perception component on the controller. Awareness warns once and stops.
- **A client.** Perception and awareness run on the server.

</details>

<details>
<summary>It senses everything, or forgets too fast (Advanced)</summary>

- **It engages targets it has not seen.** The **Target Selector** is something other than an Awareness Filtered Target Selector. The log says so at possession.
- **It fights on after you break sight.** That is **Min Required State** at Lost plus **Grace Loss Duration**. Set the state to Detected for an instant drop, or shorten the grace.
- **It spots you through a wall.** **Proximity Radius** ignores line of sight inside 220 cm for a target already in memory. Drop it to 0 to remove the floor.
- **It flickers between states.** Raise **Confirm Lost Delay**.
- **A sound sends it straight into combat.** **Min Required State** is on Suspicious, or **Stimulus to State Map** promotes hearing to Detected.
- **The filtered selector passes everything through.** No **SEC Awareness** component on the controller. It warns once per controller and stops filtering.

</details>

<details>
<summary>What the sight sense still decides (Advanced)</summary>

Seeing a target through characters runs beside the engine's sight sense and keeps to its rules:

- **The first sighting is the sense's.** A target the sense has not seen yet, or one the perception has forgotten, is left to the sense, so a target never registered for sight is not seen this way.
- **The sense has to be on.** An enemy whose sight sense is off sees nothing by sight; only **Proximity Radius** still holds a target.
- **Teams.** A team the sight config's **Detection by Affiliation** leaves out is not seen. The perception the awareness component creates detects enemies and neutrals.
- **A target that answers for itself.** An actor implementing the engine's `IAISightTargetInterface` in C++, on itself or on one of its components, is left to that answer, so a stealth system deciding visibility keeps the last word.

The view is traced from the enemy's eyes on the project's default sight collision channel, against complex collision, as the engine's sight traces it. It reaches **Lose Sight Radius** for a target the enemy holds at Detected or Lost, and **Sight Radius** otherwise.

</details>

<details>
<summary>Hiding a target from an enemy that watches it (Advanced)</summary>

A target stays seen while it stands in a watching enemy's view cone in clear view. Two switches hide it:

- **Put it on the enemy's team** with **Set Team Id**. The enemy lets it go at any distance.
- **Turn the enemy's sight sense off** with **Set Sense Enabled** on its **AI Perception** component, passing **AISense_Sight**. The enemy lets it go outside **Proximity Radius**.

Either way the target reaches Lost after **Confirm Lost Delay** and is forgotten after **Grace Loss Duration**.

Taking the target off the sight sense, with **Unregister from Sense** on its **AI Perception Stimuli Source** component for one, does not hide it from an enemy already watching it. With **Forget Stale Actors** ticked under **Project Settings > Engine > AI System**, the perception forgets the target once all its stimuli have expired: **Sight Max Age** after the sight sense last reported it, and **Hearing Max Age** after its last noise. The enemy stops seeing it from then. A hit the damage sense reported never expires, so a target that has struck the enemy is not forgotten this way.

</details>

<details>
<summary>Everything the component answers (Advanced)</summary>

Reads:

| Node | Answers |
| --- | --- |
| **Get Awareness State** | The state for one target, Unknown when there is no memory. |
| **Get Awareness Progress** | 0 to 1 for a UI bar: live meter while Suspicious, 1 while Detected, draining grace fraction while Lost. |
| **Get Last Known Location** | Where a target was last placed, plus its age in seconds. |
| **Get Most Aware Target** | The single target to react to, ranked by state and then by meter. |
| **Get Targets in State** | Everything at or above a state. |
| **Get Highest Awareness State** | The alert level across all remembered targets. |
| **Get Awareness Entry** | The whole record for one target. |

Writes:

| Node | Does |
| --- | --- |
| **Force Aware Of** | Set a state directly, for a cutscene sting or an alarm. Promoting to Detected fires the spotted event. Passing Unknown or Forgotten forgets the target instead. |
| **Forget** / **Clear All Awareness** | Drop one memory or all of them, with no events. |
| **Set Awareness Enabled** | Stop or start sensing while keeping the settings. Stopping forgets everything, which suits a dead or switched-off enemy. |
| **Apply Config** | Swap the whole config at runtime, for an enemy that gains sharper senses or is blinded mid-fight. Passing None stops sensing. |
| **Broadcast Awareness to Allies** | Push this enemy's Detected targets onto same-team allies within a radius. |

</details>

<details>
<summary>Making one target harder to notice than another (Advanced)</summary>

**Awareness Rate Multipliers** on the **SEC Awareness** component scales the gain from one sense across all targets: below 1 is harder to notice, above 1 easier, 0 mutes that sense. **Set Awareness Rate Multiplier** changes an entry at runtime, and each holds until changed again. Sight scales the meter fill rate; hearing scales the bump. A hit and the proximity floor ignore it, so neither can be muted this way.

For per-target rules (crouching, standing in shadow, an invisibility tag) override **Get Awareness Rate Multiplier** on a Blueprint subclass of the component. It receives the sense and the target and replaces the map.

Two more overrides on the same component:

- **Should Ignore Actor** blocks all senses for an actor. The default answers yes for anything listed in **Ignored Actor Classes**.
- **Resolve Stimulus State** decides what a sense is worth. The default reads **Stimulus to State Map** on the config, then falls back to sight and damage meaning Detected and everything else meaning Suspicious. Add a row to that map for an alert archetype whose hearing goes straight to Detected.

</details>

<details>
<summary>Which way the enemy looks while it searches (Advanced)</summary>

**Face Last Known when Not Detected** on the enemy controller (on by default) tracks the live target only while it is Detected. While Suspicious or Lost the enemy faces the last-known location instead, so it stops staring through a wall at someone it cannot see.

Untick it to track the target whatever the state. Override **Get Desired Facing Location** on the controller to replace the logic outright: the default answers for awareness facing and for a movement layer asking for travel-direction facing, so an override takes both. A rotation lock during an ability still outranks the override.

</details>

<details>
<summary>Patrol, investigate, return (Advanced)</summary>

The shape most stealth loops take:

- **Investigate a noise.** Bind **On Target Suspicious** and send the enemy to the stimulus location it carries. If the target is visible when it arrives, the meter fills and the state goes to Detected; if not, it drains and the enemy forgets.
- **Search after losing sight.** Bind **On Target Lost** and walk the enemy to **Get Last Known Location** for the length of the grace window.
- **Go home.** Bind **On Target Forgotten** and send the enemy back. [Territory](https://rigbak.com/docs/soulslike-combat/territory) gives it a home post and a leash to return to.
- **A meter bar.** Bind **On Awareness Progress**, or poll **Get Awareness Progress** on a widget tick.

In a StateTree, the same loop reads as one graph: patrol below Suspicious, investigate at Suspicious, combat at Detected, search at Lost through **Poll Last Known Location**, return on Forgotten. See [StateTree Integration](https://rigbak.com/docs/soulslike-combat/statetree).

</details>

<details>
<summary>Skip stealth entirely (Alternative)</summary>

Tick **Always Aware** on the Awareness Config for an arena or a boss room where the fight starts as the level loads. The enemy holds hostile combat targets at Detected without needing to see or hear them, and the meter, the sight cone and the hearing range stop mattering.

A target counts only after something registers it for combat, so pair this with a trigger or a spawner that calls **Register Combat Target**. See [Getting Started](https://rigbak.com/docs/soulslike-combat/getting-started).

</details>

<details>
<summary>Bring your own perception setup (Alternative)</summary>

Untick **Auto Create Perception Component** and add an **AI Perception** component to the controller yourself, configured however you like. Awareness binds to it and leaves its settings alone, so the sight, hearing and damage fields on the config stop applying.

Everything else on the config still applies: the meter, the memory windows, the proximity floor and the stimulus mapping all run on whatever stimuli your component reports. A sight config whose **Implementation** is your own subclass of **AISense_Sight** counts as sight, the same as the engine's. With no perception component and auto-create off, awareness warns once and stops updating.

</details>

---

## Integration

| System | How they meet |
| --- | --- |
| [Targeting System](https://rigbak.com/docs/soulslike-combat/targeting-system) | The filtered selector gates candidates, and **Min Required State** sets the disengage feel. |
| [StateTree Integration](https://rigbak.com/docs/soulslike-combat/statetree) | **Awareness State At Least** condition, **Poll Last Known Location** task. |
| [Territory & Patrols](https://rigbak.com/docs/soulslike-combat/territory) | Awareness decides what the enemy knows, territory decides where it belongs. Together they give patrol, investigate and return. |
| [Telegraphs](https://rigbak.com/docs/soulslike-combat/attack-telegraphs) | The Awareness filter on a trigger rule gates a reaction on whether the enemy already knows about the attacker. |
| [Threat Detection](https://rigbak.com/docs/soulslike-combat/threat-detection) | Awareness is what this enemy sensed. Threat is whether its target is looking back. |

---

Previous page: [Threat Detection](https://rigbak.com/docs/soulslike-combat/threat-detection). Next page: [Territory & Patrols](https://rigbak.com/docs/soulslike-combat/territory)
