# Tactical Enemy Movement: Strafing, Circling and Spacing

> Make enemies strafe, circle the player and keep their distance instead of walking straight at them in Unreal Engine 5, set up in Blueprint with no C++.

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

> An enemy that holds a range, circles the player, gives ground when crowded and closes in when the player backs away. Soulslike Enemy Combat does this from one data asset and one number to start.

## The problem

Give an Unreal Engine enemy a Behavior Tree with **Move To** on the player and it does one thing: it walks in a straight line until it is next to them. Once there it stands still, or it stacks on top of every other enemy doing the same. Nothing in that loop circles, backs off or keeps a gap.

The usual fixes each cover part of the problem:

- **Set Focus with a strafe blendspace.** The enemy keeps facing the player and your blendspace plays side-step animations. That fixes how the enemy looks while it moves. Something else still has to decide where it moves and when.
- **EQS.** An Environment Query can score points on a ring around the player. It answers where a good spot is. You still write the logic that picks a spot, walks there, re-queries as the player moves, switches sides, rests and gives ground when the player charges.
- **Move To on a point you compute.** This is the same job, done by hand every tick.

Tactical movement in a souls-like or action game needs all of it together: a preferred range, circling around that range, a retreat when the player pushes in, and a side swap now and then so the enemy does not orbit one way forever. Soulslike Enemy Combat ships that as a **Movement Behavior Profile** data asset. You pick the numbers, and the plugin steers the enemy by scoring 16 directions around it each tick.

---

You need an enemy that already runs on SEC. If you have none, [Getting Started](https://rigbak.com/docs/soulslike-combat/getting-started) builds one in a few minutes.

## Set it up (1 minute)

1. **Create a Movement Behavior Profile**

   Right-click in the Content Browser, **SEC**, **AI**, **Movement Behavior Profile**.

   Create the asset: right-click in the Content Browser, choose **SEC > AI > Movement Behavior Profile**, and name it **DA_Move_Attacker**.

   *Right-click in the Content Browser, SEC, AI, Movement Behavior Profile.*
2. **Set the range the enemy holds**

   Double-click the asset. Set **Desired Distance** to the range this enemy fights at, in centimeters.

   In **DA_Move_Attacker**, under Distance, set:

   | Property | Value |
   | --- | --- |
   | Desired Distance | 250.0 (replaces 400.0) |
   | Distance Tolerance | 0.2 |
   | Crowd Tolerance | 0.45 |

   *Desired Distance is the range. The two tolerances widen the band around it.*
3. **Point the AI Config at it**

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

   In **EnemyConfig_Grunt**, under Movement Profiles, set:

   | Property | Value |
   | --- | --- |
   | Manage Movement Profiles Automatically | true |
   | Default Movement Profile | DA_Move_Attacker |

   *Default Movement Profile covers every role, so one entry is enough to start.*
4. **Play and watch it circle**

   Press Play and run `SEC.Debug.Movement 1` in the console. Each enemy gets a line above its head showing its movement layer, whether it is strafing and which way, and its heading.

> **Warning**
>
> An enemy only moves once it has something to fight. Movement reads the controller's focus actor, and nothing sets that until a combat target is registered. If the enemy stands still with everything above filled in, that is what is missing. See [Targeting](https://rigbak.com/docs/soulslike-combat/targeting-system).

---

## Shape the circling and the spacing

An enemy holds a band around **Desired Distance**. Inside the band it circles, closer than the near edge it gives ground, and past the far edge it closes in. The two tolerances set how wide each half of the band is.

> **Warning**
>
> Keep **Desired Distance** under 700 cm. Past that the enemy hands over to the pathfinding layer, where it walks toward the target and never circles.

The profile also sets how much the enemy prefers circling over closing in, whether it switches sides on its own, when it pauses for breath, and which angle it seeks (in front, on the flank, behind). [Movement System](https://rigbak.com/docs/soulslike-combat/movement-system#the-rest-of-the-profile) lists each field.

---

## Different behavior for different enemies

Add entries to **Role Movement Profiles** in the Enemy AI Config to give each [combat role](https://rigbak.com/docs/soulslike-combat/combat-roles) its own profile: an aggressive one for Attacker, a patient one for Waiter. A role you do not list falls back to **Default Movement Profile**, and the swap happens on its own when the role changes. The demo content ships `MovementProfile_SEC_Attacker` through `MovementProfile_SEC_Elite` to start from.

Roles also cap how many enemies press in at once. The **Flanker** role is the one that circles for an angle.

> **Warning**
>
> Leave no entry with an empty **Movement Profile**. An entry that names a role but no asset applies nothing, so the enemy keeps whatever the previous role gave it.

---

## Common questions

**Do I need EQS, Set Focus or Move To?** No. The Movement Evaluator on the AI controller handles direction, range and side swaps. Past 800 cm it hands over to navmesh pathfinding by itself.

**How do I make an enemy stop walking straight at the player?** Set **Desired Distance** on its profile. The enemy closes to that range and circles there.

**How do I make an enemy back off when the player gets close?** Close range is the near half of the band, set by **Crowd Tolerance**. Inside it the enemy gives ground. Lower **Crowd Tolerance** for an enemy that insists on its space.

**Can the player's stare change the movement?** Yes. With a [Threat Detection](https://rigbak.com/docs/soulslike-combat/threat-detection) component on the controller, tick **Swap Strafe on High Threat** and **Adjust Distance by Threat** under **Threat Response**. Both ship off.

**Can I drive the strafe with my own blendspace?** Yes. Untick **Apply Movement Input** on the Movement Evaluator, then read **Get Current Direction Angle** or **Get Current Direction Local** each tick in your Anim Blueprint. See the root motion drawer on [Movement System](https://rigbak.com/docs/soulslike-combat/movement-system#how-it-steers).

**Do I need C++?** No. Every step on this page is a data asset or a Blueprint value.

**It moves, but it never circles.** Check **Desired Distance** first (under 700 cm), then run `SEC.Debug.Movement 1`. [Movement System](https://rigbak.com/docs/soulslike-combat/movement-system#debug-it) lists the other causes.

---

## Related

| Page | Why |
| --- | --- |
| [Movement System](https://rigbak.com/docs/soulslike-combat/movement-system) | Every profile field, the Movement Evaluator settings, and the debug overlays |
| [Combat Roles](https://rigbak.com/docs/soulslike-combat/combat-roles) | Attackers, Waiters and Flankers, and a movement profile per role |
| [Threat Detection](https://rigbak.com/docs/soulslike-combat/threat-detection) | Make enemies swap sides or give ground under the player's stare |
| [Enemies That Take Turns Attacking](https://rigbak.com/docs/soulslike-combat/enemies-take-turns) | One enemy swings while the rest circle and wait |
