Seam Patterns

Documentation Unreal Engine Combat Framework Recipes

What the enemy layer and the player layer do together: an enemy fighting with the player's weapon, one damage path both ways, enemies reading the player's guard, telegraphs both ways, targeting both ways, a reaction cutting a combo, and an enemy the player executes.


The enemy layer and the player layer share one set of combat systems, so a hit, a guard, a telegraph and a lock work the same in both directions. Each pattern below names the demo assets that show it and the settings that make it work.
Every pattern names the assets to open. They sit in the plugin's content under Demo; turn on Show Plugin Content in the Content Browser's settings to see them.
Build on copies of the demo assets. A plugin update replaces the plugin's content and drops any edit made in place, so a change you mean to keep belongs on a copy: duplicate the asset into your own content, change the copy, and point your enemy or character at it.

Pick a pattern

PatternSee it in the demoWhat makes it work
An enemy that fights with the player's weaponThe Over Shoulder arena and the dual-sword boss in LVL_UCF_DemoAn item drawn through the enemy's Loadout, and actions that play its graph
One damage path, both waysAny hit, either wayOne receiving side for every hit
Enemies that read the player's guardBuilt on the combo enemy's setOne state tag both layers use
Telegraphs, both waysThe baton's and the fists' attacksOne announcement with two listeners
Targeting, both waysLock on to a combo enemyUCF Enemy Targetable and one team check
A reaction that cuts a comboHit a combo enemy mid-comboCancel Current Action on the reaction
An enemy the player executesThe dual-sword bossThe player layer's finisher on the enemy, and an AI that holds still for it

An enemy that fights with the player's weapon

In the demo: the Over Shoulder arena of LVL_UCF_Demo holds six combo enemies, BP_UCF_ComboEnemy_RandomWeapon. Each draws the baton, the sword or its fists as it spawns, the same items the player carries, and plays combos from that item's action graph. The Soulslike arena's dual-sword boss holds two of the player's swords and plays strings from the sword's graph. The Freeflow arena's bare-handed crowd plays the ability attacks of its Action Sets, for comparison.
What makes it work:
  1. The enemy holds the item through its Loadout: Starting Items or Random Starting Items name it, and its UCF Equipment Manager draws it the way the player's character draws. The item hands the enemy its action graph, its animation layer and its trace sockets, exactly as it does for the player. UCF Enemy Character Base carries the Loadout, the Equipment Manager and a UCF Anim Manager; Enemy Weapons covers them.
  2. The enemy carries a UCF Action Graph component, which runs the graph, and UCF Enemy Attack Steering, which aims each move at the target the AI fights. Action Graphs in Action Sets lists each piece.
  3. The Loadout's Item Sets rows hand the AI an Action Set per item. The baton's, ActionSet_UCF_ComboEnemy, mixes ability attacks with Action Graph Combo actions that press the baton's inputs, and with Action Sequence actions that string both together; the sword's and the fists' play strings from their own graphs.
Change the item and the enemy's combos follow it: a combo with Action Graph left empty plays whatever graph the drawn item carries.

One damage path, both ways

In the demo: hit a combo enemy with the player's sword, then let it hit you with the baton.
Every swing ends in the same place, whichever side swings. Both swing the same UCF Melee Trace and pass their hits through the same confirmed hit step: a player's machine reports its hits and the server checks them, and an enemy's swings are swept on the server. Both then go through one function: it builds the damage from the swing's Damage Config and hands it to the struck actor's UCF Damageable answer. Both character bases answer through the same defense step, which walks their defense responses and then drains their vitals. One consequence each:
WhatWorks both ways because
A Damage ConfigIt describes the hit, whichever side deals it: one config serves a player's sword and an enemy's.
A Defense Rule SetAn enemy's guard blocks a player's sword the way a player's guard blocks an enemy's club.
HealthUCF.Vital.Health is one tag, the pool both sides lose.
A dodgeBoth melee traces pass through a victim holding UCF.State.Intangible, so one UCF State Tag Window on a dodge montage dodges either side's swings.
TeamsBoth traces ask one team check: with Team Filter on Enemies Only, a swing passes over teammates on either side. The player's trace and the one on UCF Enemy Character Base start there; Enemy Character Base starts on No Filter.
Two names stay apart, one for each layer, and a project picks one of each. Damage kinds: the enemy layer's sit under UCF.Damage.*, which the ready-made configs in Core/Damage name, and the player layer's under UCF.DamageType.*, which every demo weapon's config names, the enemies' swings included. Answer tags a defense response reports: the enemy layer's UCF.Defense.* and the player layer's UCF.DamageResult.*. Every demo set reports UCF.DamageResult.*, and every demo asset that reads an answer reads that family. A resistance or a hit effect that waits on an answer matches whichever family its attacks and responses carry.
Melee Trace and Damage and Defense cover each side in full.

Enemies that read the player's guard

Build it on a copy of ActionSet_UCF_ComboEnemy.
A player raising a guard holds UCF.State.Blocking, and an enemy's block holds the same tag: both layers name it the same way. An enemy's action reads tags through Tag Score Multipliers: an entry counts while the exact tag sits on the action's target, on the enemy itself or on the world, so the action can answer what the player is doing.
  1. Open the combo enemy's Action Set and select the action that should wait out a guard, such as LightCombo.
  2. Under Scoring, add an entry to Tag Score Multipliers: UCF.State.Blocking at 0.3. The combo scores 0.3 times as high while the player guards.
  3. Select an action that breaks a guard, such as HeavyCombo, and add UCF.State.Blocking at 2.0. It is twice as likely against a raised guard.
An entry cannot tell those three apart: an enemy holding UCF.State.Blocking through its own block reaction counts the entry too, at a decision made while that reaction still holds the tag.

Telegraphs, both ways

In the demo: the baton's attack montages, AM_UCF_TwoHanded_SingleAttack, _DoubleAttack and _TripleAttack, and the fists' combo carry a UCF Telegraph Window, so an enemy swinging them raises a marker, whether its AI plays them as ability attacks or through the item's action graph. The player character, BP_UCF_Character, carries a UCF Telegraph Viewer set to TelegraphStyle_UCF_Default.
A telegraph window on an attack announces the attack once, and two listeners hear it:
  • A player sees an enemy's attack. Each player's UCF Telegraph Viewer shows the marker its style set picks for the attack, on that player's own machine. An enemy playing a baton combo raises the same markers a player swinging it would show to another player.
  • An enemy hears a player's attack. The server passes the announcement to every enemy inside the window's shape as the stimulus UCF.Stimulus.AttackTelegraphed, and an enemy's Reaction Set can answer it with a parry or a dodge before the blow lands. The demo's ReactionSet_UCF_TwoHanded carries a rule on that stimulus.
Neither direction needs wiring beyond the window and the listener. Show Marker on a UCF Telegraph Subject shows a marker to players only; Report Area Stimulus reaches enemies only. Telegraphs covers the window, the marker styles and the stimulus.

Targeting, both ways

In the demo: walk up to a combo enemy in LVL_UCF_Demo and lock on. The player soft-targets and locks the enemy while the enemy picks the player and attacks; put both on one team and they leave each other alone; kill the enemy and it drops out of targeting.
What makes it work:
  1. The enemy is a target the player can pick. UCF Enemy Character Base carries a UCF Enemy Targetable component, so the player's targeting finds it and can lock it. It turns off when the enemy dies, so a lock lets go of a dead enemy, and goes back to its earlier setting when the enemy is revived. An enemy on Enemy Character Base gets the same by adding UCF Enemy Targetable.
  2. One team check decides who fights whom. The player's targeting asks it through its config's Target Teams, an enemy through its own team. Each side carries a UCF Team component as TeamComponent: an enemy's starts on team 1, and a character on UCF Character Base starts on no team until its Team Id is set, which every Enemies Only filter treats as hostile. The demo player is on team 0. Give the player the enemies' Team Id and both sides leave each other alone.
  3. The enemy keeps its distance. Set Keep Distance to On on the enemy's UCF Approach component and its ability attacks stop short of the target they aim at, as a player's attacks stop short of an enemy.
Targeting covers the player's side, and Targeting System the enemy's.

A reaction that cuts a combo

In the demo: hit a combo enemy in the middle of a combo. Its reaction starts, the combo ends with the Interrupted reason, and the enemy's action graph stands back at idle, free for the reaction.
What makes it work: a reaction's Cancel Current Action, under its Execution settings behind Advanced, is ticked by default. When the reaction fires it stops the running action, and an Action Graph Combo stopped early cuts the move its graph is running. Nothing else is needed: every reaction cuts a combo the way it cuts an ability attack.
Untick Cancel Current Action on a reaction that should play over the combo, such as a shout, and the combo plays on.

An enemy the player executes

In the demo: in the Soulslike arena, bring the dual-sword boss's health low. It staggers and stays down, and a light attack beside it plays the sword execution: the player knocks one of its swords away, kills it and throws it.
What makes it work:
  1. The enemy carries the player layer's finisher. BP_UCF_DualSwordBoss answers hits through the player layer's character rule set, DefenseRuleSet_UCF_Character, whose health floor stops its health at 150 and opens its finisher stun, GA_UCF_FinisherStun, which holds UCF.State.Finishable. Its own tag, UCF.Enemy.SoulslikeBoss, is the one the sword's execution set asks for. Getting Started lists every piece.
  2. The enemy needs no paired setup. The execution gives the enemy its role as it plays, the same way it does for any character.
  3. The AI holds still for it. While the player layer stuns, flinches or recoils an enemy on UCF Enemy Character Base, or plays it in a paired action, the base stops the action and reaction the enemy is running and holds its actions and reactions, so its next attack cannot break the stun and its parry or dodge cannot cut the execution short. An enemy on Enemy Character Base needs the same: put UCF.Action.BlockActions and UCF.Reaction.BlockReactions on it while it holds UCF.State.PairedAction.
Paired Actions builds an execution, and Hit Reactions the stun and the flinch.

Debug it

RunShows
UCF.Debug.EnemyActions 1Each enemy's actions above its head, the running one in yellow.
UCF.Debug.Actions 1The node each character's action graph stands in, enemies included.
UCF.Debug.Melee.DrawTracing 1Every melee sweep, either side's.
UCF.Debug.Stimulus.Draw 1The ground each announcement covers, and a sphere on every pawn it reached, colored by what that pawn did with it.
UCF.Debug.Teams 1The team each pawn fights for, above its head.
UCF.Debug.Paired.Draw 1Both roles' spots while an execution plays.