Enemies That Take Turns Attacking

Documentation Unreal Engine AI Tutorial Combat Tokens Combat Roles

Stop a group of enemies from attacking the player all at once in Unreal Engine 5: one swings, the rest circle and wait their turn, set up in Blueprint with no C++.


Five enemies around the player and only one swings. The others circle, hold their distance, and step in when the attacker finishes. Soulslike Enemy Combat does this with one gate on the attack and one number in Project Settings.

The problem

Drop several melee enemies into an Unreal Engine level with a plain Behavior Tree and each one runs the same logic: see the player, walk up, attack. They arrive together and swing together, and the fight turns into a pile of overlapping hits the player cannot read or answer.
Souls-like and action games solve this with an attack token system, sometimes called the kung fu circle. The player hands out a small number of attack permissions. An enemy needs one to swing, gives it back when the swing ends, and waits its turn without one. The waiting enemies keep moving, so the group still looks alive and threatening.
Building that by hand means a token manager, claim and release logic on every exit path of every attack (finished, interrupted, canceled, the enemy dying mid-swing), and movement for the enemies that are waiting. Soulslike Enemy Combat ships the token pool, the claim and release on each of those paths, and the waiting movement.

You need an enemy that already attacks through an Action Set. If you have none, Getting Started builds one in a few minutes.

Set it up

1 minute
  1. 1

    Gate the attack

    Open the enemy's Action Set, select each melee attack, and add a Combat Token Gate to its Scoring > Gates list. Set Token Tag to SEC.Token.Attack.
    DA_ActionSet_Grunt
    ▾Combat Token Gate
    Token Tag 
    Cost1
    Every attack with this tag draws from one shared pool.
    Leave dodges, repositions and taunts ungated, so a waiting enemy can still do them.
  2. 2

    Allow one attacker at a time

    Project Settings > Plugins > Soulslike Enemy Combat > Combat Tokens. Set the Budget of SEC.Token.Attack to 1. It ships at 2.
    Project Settings
    ▾Combat Tokens > SEC.Token.Attack
    Budget2
    Reissue Delay0.0
    Budget is how many may swing at once. Reissue Delay is the pause before the next one steps in.
  3. 3

    Give the turns a rhythm

    Set Reissue Delay to about the length of one attack recovery, somewhere between 0.5 and 1 second. One enemy swings and backs off, a beat passes, and the next one comes in. At 0 the next swing starts the same frame the last one ends.
  4. 4

    Play and watch the turns

    Press Play with three or more enemies and run SEC.Debug.Tokens 1 in the console. A line above the player reads Token.Attack 1/1 while the slot is free and 0/1 while an enemy holds it.
An enemy that finds the slot taken drops the attack from its choices and picks something else, so it keeps strafing, circling or backing off while it waits. The slot comes back when the attack ends, however it ends, and a dying enemy hands back what it holds. Nothing queues: the next enemy to reach for the free slot gets it.
Slots belong to the target. Two players each get their own pool, so enemies fighting one player never use up the other player's turns.

Make the waiting enemies look smart

With tokens alone, every enemy without a slot moves the way its normal movement profile says. To give the front-line enemies and the ones hanging back different behavior, add Combat Roles on top.
Roles split the group into Attackers that press in close, Waiters that hold their distance, and Flankers that circle for an angle, and they swap each enemy's moveset, reactions and movement to match. A common setup:
SettingValueResult
Role Limits, Attacker3Three enemies stay close and pressing
SEC.Token.Attack Budget1One of those three swings at a time
Default Movement ProfileMovementProfile_SEC_WaiterEveryone else circles at range
Roles decide who is in the fight and how they move. Tokens decide who swings right now. Each works on its own, and they stack.

Common questions

Can a boss allow more than one attacker? Yes. Add an SEC Token Budget Component to the actor being fought and give it its own row, say SEC.Token.Attack at 3. Set Token Budget For This Actor changes it mid-fight, for a phase that opens the arena up. See Combat Tokens.
Do parries and dodges wait for a turn too? No. A token gate on a reaction passes without taking anything, so an enemy defends itself whether or not it holds a slot.
Can a heavy attack use the whole turn? Set Cost on its gate to 2 with a Budget of 2. The heavy attack runs alone, while two light attacks at Cost 1 can pair up.
Does it work in multiplayer? Yes. The token ledger runs on the server, and clients see the result through the attacks the enemies play.
Do I need C++? No. Every step on this page is a Data Asset or a Project Settings value.
They still all attack at once. Check that each attack carries the gate and that the tag has a Budget row. Combat Tokens lists the other causes.

PageWhy
Combat TokensEvery token setting, per-target budgets, and the Blueprint nodes
Combat RolesAttackers, Waiters and Flankers, and how roles swap behavior
Movement SystemHow waiting enemies strafe, circle and keep their distance
Action SystemWhere gates sit and how an enemy picks its next move