# Getting Started with Soulslike Enemy Combat

> Turn the plugin on and get a live enemy that spots the player, closes the distance and holds its range, with no C++.

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

> One pawn Blueprint, one data asset, two fields filled in, and you have an enemy that notices the player and comes for them.

## See a finished enemy first

Turn on **Show Plugin Content** in the Content Browser's settings menu, then open `Demo/Maps/LVL_SEC_Demo` in plugin content and press Play. It ships with a player, a navmesh, and armed enemies to fight.

The pieces worth reading are under `Demo/Characters/Enemy`:

| Asset | What it is |
| --- | --- |
| `BP_SEC_EnemyCharacter` | The enemy pawn |
| `BP_SEC_EnemyController` | Its AI controller |
| `EnemyConfig_SEC_Default` | Its AI config: per-role action sets and movement profiles, an awareness config, an awareness-filtered target selector, and `ST_SEC_Core` as its brain |

Copy them into your own content and edit from there, or build fresh with the recipe below.

For the Blueprint calls behind each system, open the demo map's Level Blueprint (**Blueprints > Open Level Blueprint** on the toolbar). It holds unconnected example nodes of the calls used most, one comment box per system, from the combat role subsystem and the action and movement evaluators to threat detection and the team helpers. Nothing runs them; copy the ones you need into your own Blueprints.

---

## Set it up (2 minutes)

1. **Turn the plugin on**

   Get **Soulslike Enemy Combat** on [Fab](https://www.fab.com/listings/7087cec0-6975-4de5-82e0-0de0b9b3e9a7), open the Epic Games Launcher, and click **Install to Engine** for 5.6, 5.7 or 5.8.

   In your project, open **Edit > Plugins**, search `Soulslike Enemy Combat`, tick it, and restart when prompted. It switches on what it needs alongside it: Gameplay Abilities, State Tree, Gameplay State Tree, Motion Warping, Animation Warping and Enhanced Input.
2. **Make the enemy Blueprint**

   Right-click in the Content Browser, **Blueprint Class**, and search for **Enemy Character Base**. Name it `BP_MyEnemy`.

   Open it and assign your skeletal mesh and its Anim Class. In **Class Defaults**, **AI Controller Class** already reads **Enemy Controller Base**; leave it there.

   In **BP_MyEnemy**, under Pawn, set:

   | Property | Value |
   | --- | --- |
   | AI Controller Class | Enemy Controller Base |

   *The pawn is the body. That controller is the brain, and it ships carrying every component the AI needs.*
3. **Create an Enemy AI Config**

   Right-click in the Content Browser, **SEC**, **AI**, **Enemy AI Config**. Name it `DA_AIConfig_Grunt`.

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

   *Right-click in the Content Browser, SEC, AI, Enemy AI Config.*
4. **Fill in the two fields that ship empty**

   Open the config. Under **Combat Role**, set **Target Selector** to **Awareness Filtered Target Selector**, and leave its **Inner Selector** empty so it picks the nearest candidate. Under **Awareness**, set **Awareness Config** to a new asset from the same **SEC** menu, and leave that asset's defaults alone.

   In **DA_AIConfig_Grunt** set:

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

   *Both ship empty. Without the selector the enemy takes the first target it may fight; without the awareness config it senses nothing, and nothing puts you among its targets.*

   The two work as a pair: the awareness config is what does the perceiving, and the filter offers the enemy only targets it has perceived. Fill in the config alone and the enemy senses targets, but its selector can still pick a hostile it has not sensed, and the built-in brain waits until it senses that one. Set the filter alone and it perceives nothing, so it fights nothing.

   The awareness 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 from behind.
5. **Point the pawn at the config, and play**

   Back in `BP_MyEnemy`, under **Class Defaults > AI**, set **AI Config** to `DA_AIConfig_Grunt`.

   In **BP_MyEnemy**, under AI, set:

   | Property | Value |
   | --- | --- |
   | AI Config | DA_AIConfig_Grunt (replaces None) |

   *The controller reads this the moment it possesses the pawn, so one controller class serves every enemy type.*

   Drag the enemy into a level that has a **NavMesh Bounds Volume**, press Play, and run `SEC.Debug.Awareness 1` in the console. Walk into its cone. The line above its head climbs to `Detected`, and the enemy closes to 400 cm and starts circling.

> **Warning**
>
> **Keep AI Controller Class on Enemy Controller Base, or a Blueprint made from it.** Enemy Character Base ships with it set. A pawn whose Class Defaults point it at another controller, such as the engine's **AIController**, gets one that holds none of the combat components, so nothing on the AI Config reaches the enemy and the log stays quiet about it.

---

## Give it something to hit you with

The enemy from the QuickStart chases and holds its range. Attacks are one more data asset.

1. Create an **Action Set** and add an action to its canvas.
2. Set the action's **Ability Class** to `GA_SEC_MontageAbility`, which ships with the plugin, then set the **Montage** on the payload underneath.
3. Add a **Distance Scorer** so the action knows what range it works at.
4. Set **Default Action Set** on the AI Config to that asset.

The [Action System](https://rigbak.com/docs/soulslike-combat/action-system) walks it through with screens. For the swing to deal damage, the montage also needs a trace window: see [Melee Trace](https://rigbak.com/docs/soulslike-combat/melee-trace).

---

## What the pieces are

| Piece | Made from | Holds |
| --- | --- | --- |
| **Enemy pawn** | Blueprint from **Enemy Character Base** | The body: mesh, ability system, health, melee trace, defense, equipment, team and territory |
| **AI controller** | Blueprint from **Enemy Controller Base** | The decisions: movement, action scoring, reactions, awareness, threat, and the brain that ticks them |
| **Enemy AI Config** | Data asset under **SEC** | Which sets and profiles this enemy uses, how it picks targets, what it can sense |
| **Action Set**, **Reaction Set**, **Movement Behavior Profile** | Data assets under **SEC** | The moveset, the defensive answers, and the footwork |

Everything the AI decides runs on the server. The pawn replicates the results, so a client's UI can read an enemy's role, action and health without any of the decision-making crossing the wire. See [Multiplayer](https://rigbak.com/docs/soulslike-combat/multiplayer).

### What goes on the config

**Category: Action Sets**

| Property | Value |
| --- | --- |
| Manage Action Sets Automatically | true |
| Default Action Set | ActionSet_SEC_Waiter |
| Role Action Sets | 4 Array elements |

**Category: Reaction Sets**

| Property | Value |
| --- | --- |
| Manage Reaction Sets Automatically | true |
| Default Reaction Set | ReactionSet_SEC_TwoHanded |
| Role Reaction Sets | 0 Array elements |

**Category: Movement Profiles**

| Property | Value |
| --- | --- |
| Manage Movement Profiles Automatically | true |
| Default Movement Profile | MovementProfile_SEC_Waiter |
| Role Movement Profiles | 3 Array elements |

Each **Default** covers every [combat role](https://rigbak.com/docs/soulslike-combat/combat-roles), so one entry per category is enough to start. The **Role** arrays override it per role: an aggressive moveset for Attacker, a patient one for Waiter. The three **Manage Automatically** switches are ticked out of the box; untick one to drive that category from Blueprint instead.

The pawn's own health lives on its **Vitals** component, which ships one Health row at 100. See [Vitals](https://rigbak.com/docs/soulslike-combat/vitals).

> **Note**
>
> Leave **Default State Tree** empty on the config and the enemy runs the plugin's built-in brain: build context, move, then pick and run the best action on a 0.1 second cadence. Nothing needs authoring for that. Point it at a StateTree to take the sequencing over yourself.

---

## Where to go next

| You want | Read |
| --- | --- |
| A moveset that picks the right attack | [Action System](https://rigbak.com/docs/soulslike-combat/action-system) |
| To wire that moveset on a canvas | [Action Set Editor](https://rigbak.com/docs/soulslike-combat/action-set-editor) |
| Circling, spacing and backing off | [Movement System](https://rigbak.com/docs/soulslike-combat/movement-system) |
| Parries, flinches and counters | [Reaction System](https://rigbak.com/docs/soulslike-combat/reaction-system) |
| Attacks that deal damage | [Melee Trace](https://rigbak.com/docs/soulslike-combat/melee-trace) |
| Stealth, patrols and investigating a noise | [Awareness System](https://rigbak.com/docs/soulslike-combat/awareness-system) |
| Several enemies taking turns instead of swarming | [Combat Roles](https://rigbak.com/docs/soulslike-combat/combat-roles) and [Combat Tokens](https://rigbak.com/docs/soulslike-combat/combat-tokens) |
| Who each enemy fights | [Targeting System](https://rigbak.com/docs/soulslike-combat/targeting-system) |
| A weapon that carries its own moveset | [Weapons](https://rigbak.com/docs/soulslike-combat/weapons) |
| Guards that hold a post and give up the chase | [Territory](https://rigbak.com/docs/soulslike-combat/territory) |
| A full armed enemy, start to finish | [Step-by-Step Enemy](https://rigbak.com/docs/soulslike-combat/step-by-step-enemy) |

---

## Debug it

Every overlay draws above the enemy's head in Play In Editor.

```
SEC.Debug.All 1          // Every overlay at once; SEC.Debug.All 0 clears them
SEC.Debug.Awareness 1    // What each enemy has noticed, and how sure it is
SEC.Debug.Role 1         // Name and combat role, colored by role
SEC.Debug.Decision 1     // Distance, angle, line of sight, speed, threat
SEC.Debug.Movement 1     // Movement layer, strafe side and heading
SEC.Debug.Scoring 1      // What each action scored, highest first
```

`SEC.Debug.WatchPawn <name>` narrows every overlay to one enemy, part of a name being enough, and `SEC.Debug.WatchClear` puts them all back. `SEC.Debug.MaxDistance` sets how far from the camera a block still draws (4000 cm) and `SEC.Debug.TextScale` sizes the text.

<details>
<summary>The enemy stands there and does nothing (Advanced)</summary>

In the order worth checking:

- **AI Controller Class names another controller** on the pawn Blueprint. It ships set to **Enemy Controller Base**, and a controller not made from it carries none of the combat components.
- **Target Selector is empty** on the AI Config, and the project's **Default Target Selector** ships empty too. The fallback still hands the enemy the first target it may fight, so check this when the enemy engages the wrong one rather than when it engages nothing.
- **Awareness Config is empty**, so the enemy senses nothing and never adds you to its targets. The built-in brain still fights a target that reaches it another way, such as **Register Combat Target**; a StateTree that gates its combat on the **Awareness State At Least** condition never enters combat.
- **No navmesh.** Past 800 cm the enemy asks for a path, the request fails, and it asks again about every 0.25 seconds without closing in. Add a **NavMesh Bounds Volume**, build navigation, and press **P** to check it covers the floor.
- **AI Config is empty on the pawn.** On **Enemy Character Base** the pawn's **AI Config** is the one read, even when empty, so the controller's **Default AI Config** never backs it up. That controller field counts only for a pawn that provides no config of its own.

`SEC.Debug.Role 1` reads `None` for an enemy that never took a target. No block above the pawn at all means it carries no SEC components, which points at the first cause. [Troubleshooting](https://rigbak.com/docs/soulslike-combat/troubleshooting) covers the longer list.

</details>

<details>
<summary>Use a character Blueprint you already have (Alternative)</summary>

Reparent it rather than rebuilding it.

1. Open your character Blueprint.
2. **File > Reparent Blueprint**, then pick **Enemy Character Base**.
3. Your existing components, variables and graphs stay. You inherit the ability system, the combat components, the damage interfaces and the dedicated-server socket fix.
4. Delete any duplicate the Blueprint added itself, such as its own ability system component, so only the inherited ones remain.
5. Set **AI Config** in Class Defaults and check that **AI Controller Class** reads **Enemy Controller Base**, since a controller your Blueprint named before the reparent stays. Then carry on as normal.

A character that has to inherit from a different C++ base can still work: it needs the same components, an initialized ability system, and the AI config interface implemented. The [API Reference](https://rigbak.com/docs/soulslike-combat/api-reference) lists what to reproduce.

</details>

<details>
<summary>Use an AI controller you already have (Alternative)</summary>

**File > Reparent Blueprint** to **Enemy Controller Base**, the same as the pawn.

Adding the components to a bare AI controller is not equivalent. The base class holds the AI's facing during an attack and turns it toward a target's last-known location, and attack abilities rely on that. A plain controller keeps tracking the target mid-swing and loses that facing logic.

</details>

<details>
<summary>Start the fight the moment the level loads (Alternative)</summary>

Skip stealth for an arena or a boss room.

Tick **Always Aware** on the Awareness Config. The enemy then knows about every hostile target from the start, without needing to see or hear one, and never forgets. Sight, hearing and the escalation meter are bypassed while it is on.

A target still has to exist in the shared pool for that to bite. Register the player once, on the player pawn's **Event BeginPlay**: add **Get AICombat Role Subsystem**, then call **Register Combat Target** with **Target Actor** set to **Self** and **Auto Assign Unassigned** ticked. Branch on **Has Authority** first, since AI decisions run on the server.

Blueprint graph, nodes in reading order:

- **Comment box: Player pawn · Event BeginPlay**

  - **AICombatRoleSubsystem** (subsystem getter)
  - **Register Combat Target** (function; Target is AICombat Role Subsystem); inputs: Target, Target Actor = Self, Auto Assign Unassigned = true, Reevaluate Existing = false

With awareness doing the work instead, that node is optional: an enemy that reaches **Detected** on its own adds that target to the pool, so the rest of the pack can be assigned to it too. See [Targeting](https://rigbak.com/docs/soulslike-combat/targeting-system).

</details>

<details>
<summary>Run a StateTree instead of the built-in brain (Alternative)</summary>

Set **Default State Tree** on the AI Config to take over the sequencing: patrol, investigate, engage, retreat, phase transitions. `ST_SEC_Core` under `Demo/AI/StateTrees` is a working graph to start from or copy.

The evaluation components stay the same either way. The graph decides when to poll and when to act; the components still do the scoring and the steering. See [StateTree Integration](https://rigbak.com/docs/soulslike-combat/statetree).

</details>

<details>
<summary>Which engine versions, and what ships in the box (Advanced)</summary>

Version 3.2.0 runs on Unreal Engine 5.6, 5.7 and 5.8, in single player and in multiplayer on a listen or dedicated server.

The plugin ships three runtime modules and an editor module. Its content sits in two folders: **Core** holds the pieces a shipping game reaches for (the montage ability, the reaction ability, the damage types, the default impact surfaces), and **Demo** holds the demo level, its player, its enemies and their data assets, one folder per purpose.

</details>

Next page: [Step-by-Step Enemy](https://rigbak.com/docs/soulslike-combat/step-by-step-enemy)
