# Common Patterns & Examples

> Seven enemy archetypes as recipes: the numbers to type, and the field each one goes in.

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

> Seven enemies you have fought before, each written out as the values to type and the field they go in.

> **Warning**
>
> Every recipe below starts from an enemy that already works: a pawn, an AI controller, a registered combat target, and an **Enemy AI Config** carrying both a **Target Selector** and an **Awareness Config**. Leave **Awareness Config** empty and the enemy senses nothing, so it never adds you to its targets on its own. The built-in brain still fights a target you register with **Register Combat Target**. Two setups leave the enemy standing still whatever you type into the assets: an **Awareness Filtered Target Selector**, which passes nobody the enemy has not sensed, and a StateTree that gates its combat on **Awareness State At Least**, which holds at Unknown. The same goes for the target: with none registered or sensed, nothing selects one, and the failure is silent. See [Getting Started](https://rigbak.com/docs/soulslike-combat/getting-started), [Targeting](https://rigbak.com/docs/soulslike-combat/targeting-system) and [Awareness](https://rigbak.com/docs/soulslike-combat/awareness-system).

Each recipe names two assets: a [Movement Behavior Profile](https://rigbak.com/docs/soulslike-combat/movement-system) for how it stands, and an [Action Set](https://rigbak.com/docs/soulslike-combat/action-system) for what it does. Point the enemy's **Enemy AI Config** at both, under **Default Movement Profile** and **Default Action Set**, and leave the two **Manage ... Automatically** boxes ticked.

Every action uses the **Gameplay Ability** execution method with **Ability Class** set to **GA_SEC_MontageAbility** and its own montage in the payload, unless a recipe says otherwise.

Distance and angle bands are written as four numbers, the **Range** on a scorer: **Min Value / Optimal Min / Optimal Max / Max Value**. The action scores 0 outside the first and last, and 1 across the middle pair.

An action ships with no scorers, so every Distance Scorer Range below needs a **Distance Scorer** added to that action's **Scoring > Scorers** list before the four numbers have anywhere to go. See [Action System](https://rigbak.com/docs/soulslike-combat/action-system).

## Pick a shape

| Archetype | Fights at | What makes it that |
| --- | --- | --- |
| [Grunt](https://rigbak.com/docs/soulslike-combat/patterns#the-grunt) | 250 cm | Two swings and a chain link between them |
| [Rusher](https://rigbak.com/docs/soulslike-combat/patterns#the-rusher) | 120 cm | Tight far edge, no strafe rest, one-second cooldowns |
| [Duelist](https://rigbak.com/docs/soulslike-combat/patterns#the-duelist) | 350 cm | A parry rule on a Reaction Set, and a recovery gap |
| [Flanker](https://rigbak.com/docs/soulslike-combat/patterns#the-flanker) | 300 cm | An Angle Preference Rule at 90 degrees |
| [Archer](https://rigbak.com/docs/soulslike-combat/patterns#the-archer) | 600 cm | A ranged scorer band, pinned to back-line roles |
| [Guard](https://rigbak.com/docs/soulslike-combat/patterns#the-guard) | its post | Territory posts, a leash, an awareness config |
| [Boss](https://rigbak.com/docs/soulslike-combat/patterns#the-boss) | 300 cm | Elite role, and a second-phase moveset swap |

---

## The grunt

Circles at mid range, opens with a light swing, follows it with a heavy, and gives ground when you walk into it.

**Movement Behavior Profile**

| Field | Value |
| --- | --- |
| Desired Distance | 250 |
| Distance Tolerance | 0.2 |
| Crowd Tolerance | 0.45 |
| Enable Strafe Rest | on |

**Action Set**, three actions:

| Action ID | Distance Scorer Range | Cooldown Duration | Selection Weight |
| --- | --- | --- | --- |
| `LightAttack` | 0 / 100 / 250 / 400 | 2 | 1.0 |
| `HeavyAttack` | 0 / 150 / 300 / 450 | 4 | 0.8 |
| `Backstep` | 0 / 0 / 100 / 180 | 3 | 1.5 |

On `LightAttack`, add a **Chain Link** with **Target Action ID** `HeavyAttack` and **Bonus Multiplier** 1.5. The heavy scores half again as high for a moment after the light finishes, so the two read as a combo without being scripted. Roll out of range in between and the heavy's Distance Scorer drops it, and the enemy picks something else instead of swinging at air.

`Backstep` peaks at point blank and scores 0 past 180 cm, which is how the grunt answers being crowded rather than eating a hit.

> **Tip: Copy the shipped one**
>
> Turn on Show Plugin Content in the Content Browser settings, then open Demo/AI in plugin content. MovementProfile_SEC_Attacker under MovementProfiles and ActionSet_SEC_Attacker under ActionSets are the pair the demo enemy fights with. Duplicate them into your own content and retune from there.

---

## The rusher

Closes fast, refuses to be pushed off you, and never stops to breathe.

**Movement Behavior Profile**

| Field | Value |
| --- | --- |
| Desired Distance | 120 |
| Distance Tolerance | 0.1 |
| Crowd Tolerance | 0.8 |
| Enable Strafe Rest | off |

The tight **Distance Tolerance** keeps it closing until it is on top of you. The high **Crowd Tolerance** stops it giving ground when you walk in. **Enable Strafe Rest** off removes the pause a circling enemy otherwise takes every 10 seconds.

**Action Set**

| Action ID | Distance Scorer Range | Cooldown Duration | Selection Weight |
| --- | --- | --- | --- |
| `Lunge` | 250 / 350 / 550 / 800 | 1 | 1.5 |
| `Slash` | 0 / 60 / 160 / 260 | 1.5 | 1.0 |
| `Grab` | 0 / 0 / 90 / 140 | 6 | 1.0 |

Add a **Chain Link** on `Lunge` naming `Slash` with **Bonus Multiplier** 2.0, so the gap-closer flows into the follow-up.

On the **Enemy AI Config**, under **Combat Role**, set **Preferred Role** to `SEC.Role.Attacker`. The assignment pass scores every enemy for every role, by distance to the target out of the box, and a matching Preferred Role adds a small bonus on top, enough to settle a near-tie rather than reserve the slot. The rusher earns Attacker by closing first. Leave the **Recovery** fields at 0; anything above that puts a gap between its moves.

---

## The duelist

Holds a longer range, answers a telegraphed swing with a parry, and leaves a beat between its own attacks.

**Movement Behavior Profile**

| Field | Value |
| --- | --- |
| Desired Distance | 350 |
| Distance Tolerance | 0.2 |
| Crowd Tolerance | 0.3 |

The low **Crowd Tolerance** makes it give ground sooner than most, so it keeps the space its parry needs.

**Reaction Set**

1. Add a reaction with **Reaction ID** `Parry`, pointing at your parry montage.
2. Add a trigger rule with **On Stimulus** `SEC.Stimulus.AttackTelegraphed`, **Chance** 0.4, and **Min Interval** 2.
3. Under the rule's **Conditions**, add an **Incoming Angle Gate** with **Half Angle Degrees** 60, so a blow from behind goes unparried.
4. Wire the rule to the reaction: add an entry to the rule's **Reaction Links** with **Reaction ID** `Parry`. In the [Reaction Set editor](https://rigbak.com/docs/soulslike-combat/reaction-set-editor) the same link is the arrow drawn from the rule card to the `Parry` card.
5. Put your unblockable tag in the rule's **Block Context Tags** so heavy attacks land.
6. Point the **Enemy AI Config** at the asset under **Default Reaction Set**. See [Reaction System](https://rigbak.com/docs/soulslike-combat/reaction-system).

**Action Set**

| Action ID | Distance Scorer Range | Cooldown Duration | Selection Weight |
| --- | --- | --- | --- |
| `Counter` | 0 / 100 / 250 / 400 | 5 | 1.0 |
| `Poke` | 0 / 150 / 300 / 450 | 2.5 | 1.0 |

Under **Tag Score Multipliers** on `Counter`, add `SEC.State.Staggered` with a value of 2.5. Multipliers read tags on the enemy, on its target and on the world, so the counter is worth two and a half times as much while the player is reeling.

Set **Action Recovery Time** to 0.8 under **Recovery** on the **Enemy AI Config**. The duelist keeps strafing and parrying through that window and starts no new attack, which is what turns a pressure enemy into one you can read.

> **Warning**
>
> A parry needs something to parry. Drag a **SEC Telegraph Window** across the wind-up frames of the player's attack montage, or nothing reaches the enemy and the rule never runs. See [Telegraphs](https://rigbak.com/docs/soulslike-combat/attack-telegraphs).

---

## The flanker

Circles for your side instead of standing in front of you, and works as the second enemy in a pack.

**Movement Behavior Profile**

| Field | Value |
| --- | --- |
| Desired Distance | 300 |
| Distance Tolerance | 0.2 |
| Crowd Tolerance | 0.45 |

Under **Positioning Rules**, add an **Angle Preference Rule**:

| Field | Value |
| --- | --- |
| Preferred Angle | 90 |
| Angle Tolerance | 30 |
| Direction Commitment | 45 |
| Weight | 1.0 |

The angle is measured from the target's facing, and it is unsigned, so 90 means either flank and the enemy settles on whichever it reaches first. Use 180 for one that wants your back, 0 for one that insists on your face. **Direction Commitment** stops it flip-flopping between the two ways round while it is roughly equidistant.

**Action Set**: the grunt's three actions work as they are. What makes this a flanker is where it stands.

**Enemy AI Config**: add an entry to **Role Movement Profiles** naming `SEC.Role.Flanker` and this profile, and leave **Default Movement Profile** pointing at the grunt's. One enemy then circles while it holds the Flanker role and fights straight when the pass moves it to Attacker. Two Flanker slots ship per target. See [Combat Roles](https://rigbak.com/docs/soulslike-combat/combat-roles).

---

## The archer

Holds the back line, shoots, and steps away when you reach it.

**Movement Behavior Profile**

| Field | Value |
| --- | --- |
| Desired Distance | 600 |
| Distance Tolerance | 0.2 |
| Crowd Tolerance | 0.45 |

> **Warning**
>
> Keep **Desired Distance** under 700. The enemy hands over to the pathfinding layer past 800 cm and takes direct input back only inside 700, so a range set between the two walks it in instead of holding it out. **Distance Tolerance** stretches the far side of the comfortable band, 0.2 out to 120 percent of Desired Distance, so leave room for that too.

**Action Set**

| Action ID | Distance Scorer Range | Cooldown Duration | Selection Weight |
| --- | --- | --- | --- |
| `Shoot` | 300 / 500 / 1000 / 1800 | 3 | 1.0 |
| `Kite` | 0 / 0 / 250 / 400 | 4 | 2.0 |

Tick **Require Line Of Sight** on `Shoot` so it holds fire through a pillar. Add a **Combat Token Gate** with **Token Tag** `SEC.Token.Ranged`, which caps how many archers fire at the same target at once, two out of the box. See [Combat Tokens](https://rigbak.com/docs/soulslike-combat/combat-tokens).

`Kite` is the panic button: it peaks at point blank and carries twice the weight of the shot. A backstep montage covers it. For a longer retreat, author a behavior tree around the **Make Distance** task and point a **Behavior Tree Sequence** execution method at that asset. Its list holds behavior tree assets, and the showcase ships none built around that task.

**Enemy AI Config**: set **Allowed Roles (empty = any)** to `SEC.Role.Waiter` and `SEC.Role.Supporter`. The assignment pass then never sends the archer to the front, whoever else is on the field.

---

## The guard

Walks a route, notices you on its own, fights inside its ground, and goes home when you run.

1. Drag a **SEC Territory Post** into the level for each stop on the route. One post is a guard station; three are a patrol.
2. Select the placed enemy. On its **SEC Territory** component, add the posts to **Posts** in walking order, set **Resting Behavior** to **Patrol Posts** and **Post Order** to **Sequential Loop**.
3. Tick **Leash Enabled**, set **Leash Radius** to 2000, and leave **Leash Anchor** on **Self**.
4. On the **Enemy AI Config**, fill in **Awareness Config** and set **Target Selector** to **Awareness Filtered Target Selector**. Both are needed: the filter offers only what this enemy has perceived, and the config is what does the perceiving.
5. Leave **Default State Tree** empty so the built-in brain runs the patrol, or point it at a StateTree carrying the territory tasks.

Any movement profile and action set work here. The grunt's numbers are a fine fight to come home from.

> **Note**
>
> **Only Fight Inside Leash** ships on, so the guard ignores a target standing beyond its ring and engages the moment one steps inside. Turn it off for a guard that charges anything it notices and gets dragged home by the leash instead. See [Territory & Patrols](https://rigbak.com/docs/soulslike-combat/territory) and [Awareness](https://rigbak.com/docs/soulslike-combat/awareness-system).

---

## The boss

One enemy the rest of the pack works around, with a second moveset for the back half of the fight. [Souls-like Boss Fights](https://rigbak.com/docs/soulslike-combat/boss-fights) walks through the same boss as a guide, with attacks that read the player.

**Movement Behavior Profile**: the grunt's numbers with **Desired Distance** at 300, which keeps a large pawn at the reach of its own weapon rather than inside your camera.

**Enemy AI Config**, under **Combat Role**:

| Field | Value |
| --- | --- |
| Allowed Roles (empty = any) | `SEC.Role.Elite` |
| Priority | 200 |
| Ignore Target Redistribution | on |

Elite slots are unlimited out of the box, so the boss keeps its role whatever else joins. **Priority** 200 gives it first pick, and **Ignore Target Redistribution** pins it to the player it started on while the adds shuffle around.

**Phase one Action Set**: whatever the fight opens with.

**Phase two Action Set**: the moves for the back half of the fight, plus one action with **Selection** set to **Manual Only**, `PhaseSlam` for instance. A manual-only action never wins a poll and waits for a Blueprint to call **Execute Action** with its **Action ID**, so a scripted beat lands on your cue rather than the scorer's. It belongs in the phase-two set because **Execute Action** looks only in the Action Set in force.

**The phase swap**, in the boss Blueprint: bind **On Vital Changed** on the boss's **SEC Vitals**, and when the **Vital Tag** is `SEC.Vital.Health`, **Old Value** is at or above the threshold you pick and **New Value** is below it, run these once:

1. Call **Set Runtime Override** on the pawn's **SEC Action Set Component**, passing the phase-two Action Set. That beats every other source, the config and any weapon included.
2. Call **Execute Action** with `PhaseSlam`.
3. Call **Add World Tag** with `SEC.World.Boss.Phase2`.

Under **Tag Score Multipliers** on each phase-two opener, add that tag with a value of 2.0. Give a move that should retire an entry of 0 on the same tag, which drops it out of the running entirely.

**Clear Runtime Override** runs the normal lookup again, where an equipped weapon's **Weapon Action Set** comes before the config's sets. A boss whose weapon carries none gets the config's set back. A boss whose weapon carries one gets that weapon set, so to hand it the opening moveset again, call **Set Runtime Override** with the phase-one set.

**The arena and its bar**: place **BP_SEC_BossArenaTrigger** from the demo's `Demo/Game` folder around the arena, fill in **Encounter Name**, and point **Enemies** at the boss. The player walking in opens the fight on the **SEC Encounter Subsystem**. Once every listed enemy is dead or gone, the trigger ends the fight as **Defeated**. Untick **End When Player Leaves** for a fight that follows the player out of the arena.

The trigger puts nothing on screen. The demo's health bar is `WBP_SEC_HUD_Encounter`, which the demo's `BP_SEC_PlayerController` adds. With your own player controller, add a widget that binds **On Encounter Started** and **On Encounter Ended** on the **SEC Encounter Subsystem**; the demo widget shows how.

A plain **SEC Encounter Trigger** opens the same fight and leaves the ending to you: call **End Triggered Encounter** with **Defeated** when **On Vital Depleted** on the boss's **SEC Vitals** reports its health vital.

---

## Turn one number into a different enemy

| What you see | What to change |
| --- | --- |
| It closes all the way in | Raise **Distance Tolerance** on the profile |
| It backs off the moment you step toward it | Raise **Crowd Tolerance** |
| It circles without a break | Tick **Enable Strafe Rest**, and lower **Strafe Rest Time Limit** |
| It swings from across the room | Add a **Distance Scorer** to that action |
| It spams one move | Set **Max Consecutive Uses** to 2 |
| The pack attacks in lockstep | Raise **Randomization (%)** on each cooldown, and set **Spawn Cooldown Chance** |
| Three of them swing at once | Add a **Combat Token Gate** to every attack |
| It presses with no gap to punish | Set **Action Recovery Time** on the **Enemy AI Config** |
| Staring at it changes nothing | Tick **Adjust Distance by Threat**, with a Threat Detection component on the controller |
| It opens with its heaviest hit | Set **Initial Cooldown** on that action |

---

## Debug it

```
SEC.Debug.All 1                  // Every overlay at once
SEC.Debug.Scoring 1              // What each action scored, highest first
SEC.Debug.Actions 1              // Cooldowns above each enemy
SEC.Debug.Movement 1             // Layer, strafe side and heading
SEC.Debug.Territory 1            // Posts, leash ring and route
SEC.Debug.Reactions 1            // Reaction list with priorities and cooldowns
SEC.Debug.LogActionDecisions 1   // Why each action scored what it did
SEC.Debug.LogReactions 1         // Which rule answered, and with what
```

`SEC.Debug.WatchPawn <name>` narrows every overlay to one enemy, which is what you want the moment two of these archetypes share a room. Run it with no argument to list the pawns it can watch.

<details>
<summary>One pawn that plays several of these (Alternative)</summary>

Rather than a Blueprint per archetype, give one enemy a different profile and moveset per [combat role](https://rigbak.com/docs/soulslike-combat/combat-roles) and let the assignment pass decide which it is at any moment.

On the **Enemy AI Config**, add entries to **Role Movement Profiles**, **Role Action Sets** and **Role Reaction Sets**:

| Role | Profile | Action Set |
| --- | --- | --- |
| `SEC.Role.Attacker` | the grunt's | the grunt's |
| `SEC.Role.Flanker` | the flanker's | the grunt's |
| `SEC.Role.Waiter` | the archer's | the archer's |

Fill in **Default Movement Profile** and **Default Action Set** as well. An enemy holding a role you did not list, or holding none yet, takes the default; leave it empty and it gets nothing.

Three enemies on one Blueprint then read as three enemy types, and the pack rotates between them as the fight moves.

</details>

<details>
<summary>Stop a pack swinging all at once (Advanced)</summary>

Two caps stack, and they answer different questions.

**Role Limits**, in **Project Settings**, **Plugins**, **Soulslike Enemy Combat**, cap how many enemies *hold* a role per target. Attacker ships at 3, Flanker and Supporter at 2. Lower Attacker to 1 and only one enemy at a time takes the front-line profile and moveset.

A **Combat Token Gate** on each attack caps how many *swing* at the same moment, whatever role they hold. Add one with **Token Tag** `SEC.Token.Attack` to every offensive action in every set, and set **Cost** to 2 on a heavy so it occupies two slots and fewer enemies come in alongside it.

Roles change slowly and read as positioning. Tokens are claimed and released per swing and read as timing. Most fights want both. See [Combat Roles](https://rigbak.com/docs/soulslike-combat/combat-roles) and [Combat Tokens](https://rigbak.com/docs/soulslike-combat/combat-tokens).

</details>

<details>
<summary>Give an archetype its own weapon instead (Alternative)</summary>

A weapon carries its own moveset, so arming an enemy changes what it is without touching its config. Set **Weapon Action Set** and **Weapon Reaction Set** on the weapon Blueprint, and while the enemy holds it those beat the config's role entries and defaults alike.

The same grunt with a bow fights the archer's fight, and drops back to its config's moveset when the bow leaves its hand. See [Weapons](https://rigbak.com/docs/soulslike-combat/weapons).

</details>

<details>
<summary>The recipe reads wrong in play (Advanced)</summary>

- **The rusher will not lunge.** A **Combat Token Gate** on the gap-closer holds it behind the pack while the pool is full. Take the gate off the opener and leave it on the swing that follows.
- **The archer strolls into melee.** **Desired Distance** sits past 800, or its tolerance band reaches there, which hands it to the pathfinding layer; the layer gives way again only inside 700.
- **The flanker stands in front of you.** The Angle Preference Rule reads the target's forward vector, so a target with no meaningful facing gives it nothing to orbit. Check **Weight** is above 0, and that the profile with the rule is the one the enemy's current role resolves to.
- **The guard patrols but never fights.** **Only Fight Inside Leash** with a tight **Leash Radius** keeps it ignoring you. Widen the radius or untick the box.
- **The duelist never parries.** No **SEC Telegraph Window** on the incoming montage. `SEC.Debug.Stimulus.Draw 1` shows whether anything is going out at all.
- **The boss keeps its phase-one moves.** **Set Runtime Override** belongs on the pawn's **SEC Action Set Component**. Check the node's target pin holds that component rather than the controller.
- **The boss bar stays after the kill.** A plain **SEC Encounter Trigger** ends a fight only on **End Triggered Encounter**. **BP_SEC_BossArenaTrigger** counts an enemy dead once the health vital on its **SEC Vitals** empties, and gone once it is destroyed, so a boss without SEC Vitals ends the fight only as it is destroyed. A bar that outlives **On Encounter Ended** means the HUD's handler skips that end reason: remove the bar whatever the reason.
- **Nothing in any recipe fires.** No registered combat target. It logs nothing, and from the outside it looks the same as everything else on this list.

</details>

Previous page: [Core Architecture](https://rigbak.com/docs/soulslike-combat/architecture). Next page: [Troubleshooting](https://rigbak.com/docs/soulslike-combat/troubleshooting)
