Parry, Block, Guard Break and Executions in UE5

Documentation Unreal Engine Player Combat Defense Tutorial

Souls-like defense in Unreal Engine 5 without C++: a timed parry and a held block from the weapon, guard break when stance runs out, a counter window, and executions.


A souls-like defense is a chain: a block that holds while the button is down, a parry for a press timed to the blow, a guard that breaks when the defender runs out of stance, and a finisher on the enemy left open. In Universal Player Combat each link is an asset: a Defense Rule Set the weapon lends, a stance pool on the character, and a Paired Action the player's graph plays.
The defense runs on Unreal Engine 5.6, 5.7 and 5.8 and is set up in data assets and the action graph, in single player and multiplayer.

Try it in the demo

Play LVL_UPC_Demo and step onto the Soulslike style plate. With two swords drawn, press Q as a blow lands to parry it, or hold Q to block. After 250 damage the arena's boss stays stunned until you walk up and press light attack, and only that sword execution kills it.
What you seeWhere it comes from
A parry on a press timed to the blow, a block while Guard is heldDefenseRuleSet_UPC_Sword, lent by Item_UPC_Sword
The attacker recoiling from a parryThe rule set's Outcome Effects, and GA_UPC_ParryRecoil
The execution on the stunned bossPaired_UPC_Sword_Execute_A, a Paired Action

Parry and block

A Defense Rule Set holds an ordered list of responses. On each hit the list runs top down, and the first response that fits decides what the blow deals. A weapon lends its set while it is drawn.

Set it up

5 minutes
  1. 1

    Create the rule set

    Right-click in the Content Browser, UPC > Damage and Defense > Defense Rule Set, and name it DefenseRuleSet_MySword. Press + on Responses twice and pick UPC Guard both times.
  2. 2

    Make the first a parry, the second a block

    A Guard starts out as a block. List the parry first, so a hit inside the parry window does not reach the block.
    FieldParry (first)Block (second)
    Required Defender TagsUPC.State.ParryingUPC.State.Blocking
    Damage Multiplier00.2 (as it ships)
    Result TagUPC.DamageResult.ParriedUPC.DamageResult.Blocked
    Cost Per Damage01 (as it ships)
  3. 3

    Lend it from the weapon

    Open your sword's Item Definition, add a Guard fragment and point its Defense Set at DefenseRuleSet_MySword. The character answers hits with it while the sword is drawn.
  4. 4

    Hold the tags while the guard is up

    In the sword's action graph, wire UPC.Input.Guard from idle into a raise move. On its montage, add a UPC State Tag Window holding UPC.State.Parrying over the parry frames. After the raise, a Hold move with Applied Tags UPC.State.Blocking keeps the block up. Input Released, wired out of both the raise and the hold, leads to a lowering move or to a To Root card (Add Return To Root on the canvas menu), which ends the guard. Map IA_UPC_Guard to UPC.Input.Guard in the sword's Input Mappings.
    ROOT
    UPC.Input.Guard
    Guard Raise
    AM_Guard_Raise
    Auto
    Guard Hold
    UPC.Input.Guard
    UPC.Input.Guard
    ↩To Root
    Zoom -1
    A held guard: letting go leads to To Root from the raise and from the hold.
  5. 5

    Play and take a hit

    With the guard held, a fifth of the damage lands. Inside the parry window nothing lands, and the attacker's swing comes back marked Parried.
A Guard answers only blows inside Arc Half Angle Degrees of the character's front (60 for a block), so a hit from behind lands in full. To parry out of a swing, wire Guard from each attack with Timing Interrupt (A parry and a block).

Guard break: stance that runs out

A block that costs a pool breaks when the pool cannot pay. Set the Guard's Cost Vital Tag to a pool on the character's Vitals, such as stance, and tick Spend Remainder when Unaffordable: a blow the guard cannot afford empties the pool and falls through to the responses below it.
You wantSet
The attacker told the guard brokeA UPC Scale Damage below the guard, with UPC.State.Blocking in Required Defender Tags and UPC.DamageResult.GuardBroken as its Result Tag
A stun when the pool emptiesThe pool's Depleted Gameplay Event sends UPC.Event.GuardBreak; a stun ability triggered by that event holds UPC.State.Staggered, as the demo's GA_UPC_Stun does
An attack a block cannot stopUPC.Attack.Unblockable in the attack's Damage Tags and in the blocking Guard's Blocked Attack Tags. The block stays silent; a parry still works.
An attack a parry cannot turn asideUPC.Attack.Unparryable in the attack's Damage Tags and in the parrying Guard's Blocked Attack Tags. A block still works.
An attack the player can only dodgeBoth tags on the attack, each listed on its own Guard
A warning over an unblockable attackA UPC Telegraph Window on its wind-up; the demo draws a red cross over an unblockable swing (Telegraphs)
The demo sword's guard spends stance and no health: a parried 10-damage blow costs 5 stance, a blocked one 10. A demo enemy whose stance empties is stunned by GA_UPC_Stun, which opens it to an execution.

After a parry: recoil and a counter window

Outcome Effects on the rule set run once a hit is resolved, gated on its result. Two rows make a parry pay off:
RowDoes
UPC Send Gameplay Event to the attacker, requiring UPC.DamageResult.ParriedStarts a recoil ability on the attacker, as UPC.Event.ParryRecoil starts the demo's GA_UPC_ParryRecoil
UPC Apply Gameplay Effect on the defender, requiring UPC.DamageResult.ParriedApplies GE_UPC_CounterWindow, which holds UPC.State.CanCounter for a second
Put UPC.State.CanCounter in a transition's Required Tags, and that move, a riposte, plays only after a parry (Defense).

Executions on a stunned enemy

An execution is a Paired Action: one move two characters play together, each in a role with its own montage, lined up around one spot. Build it in the Pairing Editor (Paired Actions), then gate it on the stun:
  1. On the Victim role, set Required Actor Tags to UPC.State.Staggered, so only a stunned enemy fits. Add UPC.State.Intangible to Tags During Action, so other swings pass through the victim, and tick Stand Down Actions on Join.
  2. Set Release Rule to When All Finish, so the victim stays in the action until the attacker's part ends.
  3. In the player's action graph, add a move with the Play Paired Action payload naming the action, Owner Role Id Attacker, and wire idle to it on UPC.Input.Execute.
The press finds an enemy that fits the Victim role within reach, slides both into place and plays both montages. With nobody fitting, the move fails and its Action Failed wire runs. Step by step: An execution on a stunned enemy.
Attacker (anchor)Victim
At Role, with the Attacker as the anchor: the attacker holds its ground and the victim glides onto the ring in front of it, turned to face it.

Counters on an enemy's swing

A counter answers a blow on its way: Guard pressed while a counterable swing comes in plays a paired move instead of a guard. The swing's montage marks it counterable with an attack tag, a Paired Action Set holds one row per counter, and the Paired Action Available condition on the Guard wire picks the counter only while one fits. The demo's Freeflow arena shows a counter marker over each punch you can counter (A counter).
AdvancedDodges, armor and poise
You wantSet
A dodge that swings pass throughHold UPC.State.Intangible over the dodge; the attacker's Pass Through Tags list it (Patterns)
Frames that take no damage but still play the impactUPC Invulnerable at the top of the list, with its Required Defender Tags
Armor against one kind of damageUPC Scale Damage at the bottom, the damage type in Required Attack Tags
A flinch only when poise breaks, and hyper armor on a heavy swingA poise pool and Outcome Effects that start a flinch (Hit Reactions)
MultiplayerDefense online
  • The server resolves every hit against the defender's responses, charges the pools and runs the outcome effects. Vitals replicate on their own.
  • Only the server starts and ends a paired action. The graph move asking for an execution starts at the press like any other move, and the paired part follows a round trip later.
  • Preview Incoming Damage gives a real hit's answer on any machine and charges nothing, for a guard meter.

Common questions

Can a shield block while a sword attacks? Yes. A drawn shield lends a block of its own through its Guard fragment, and its guard moves fold into the sword's graph while it is out (A shield bash).
Does a block work from any direction? No: a Guard answers blows inside its arc. Set Arc Half Angle Degrees to 180 to accept every direction.
Can enemies parry the player? The defense runs on any character with a UPC Defense component, enemy or player, so an enemy holding a guard tag blocks the same way. Deciding when to parry is enemy AI, which is not included; in Soulslike Enemy Combat, the enemy AI plugin of the same family, enemies parry, dodge and counter.
Does a timed parry feel like Sekiro or Dark Souls? A press timed to the blow lands inside the parry window: the blow deals nothing, and with a recoil row in the outcome effects, as the demo sword has, the attacker recoils. A held block takes the blow at its Damage Multiplier and spends its cost, such as stance. How tight the timing feels is the length of the parry window on the raise montage.
Can I use my own execution animations? Yes. Give each role its montage and press Derive Offsets in the Pairing Editor to line them up.
Do I need C++? No. A response of your own is a Blueprint child of UPC Defense Response.

PageWhy
DefenseEvery response, field and outcome effect
Paired ActionsRoles, anchors, picking the victim, and counters
Pairing EditorLine up roles, time montages and key a camera shot
VitalsHealth, stamina and stance pools
For a Dark Souls style player, Souls-like Player Combat in UE5 lists each part in the order to build it.