Getting Started with Universal Combat Framework
Documentation Unreal Engine Combat Tutorial
Turn the plugin on, walk the demo's hallway, fight enemies on the enemy AI in three arenas, execute the dual-sword boss, and choose the layer to read first.
Turn the plugin on, open the demo map and fight enemies whose AI picks their moves and plays combos from an action graph, then bring a boss low and execute it. Then pick the layer to read first.
Set it up
5 minutes- 1
Turn the plugin on
Get Universal Combat Framework on Fab and click Install to Engine in the Epic Games Launcher (5.6, 5.7 or 5.8).In your project, open Edit > Plugins, searchUniversal Combat Framework, tick it, and restart when prompted. The engine plugins it needs switch on with it: Gameplay Abilities, Enhanced Input, Motion Warping, Animation Warping, Animation Locomotion Library, Control Rig, Niagara, MetaSound, Chaos Cloth, StateTree and GameplayStateTree. Its gameplay tags register themselves, with no collision channels, surface types or tag files to set up. - 2
Open the demo map
Turn on Show Plugin Content in the Content Browser's settings, then openDemo/Maps/LVL_UCF_Demoin the plugin's content.LVL_UCF_Demo▾Game ModeGameMode OverrideNoneSet in the demo map's World Settings. For a level of your own, set it there or as the Default GameMode in Project Settings > Maps & Modes. - 3
Take a sword
Press Play and walk down the hallway to the weapon rack on your left. Look at a sword and press E: it goes on belt slot 1 and into your hand. - 4
Fight enemies that play combos
Press 9 to jump to the three style plates at the end of the hallway and step on Over Shoulder. It hands you a sword and a shield and takes you to its arena, whose name shows at the bottom of the screen. Six combo enemies, each holding a baton, a sword or its fists picked as it spawned, pick their moves by score and come at you one at a time, swinging combos from their weapon's action graph, each combo one of several strings picked at random. Lock on with the middle mouse button, swing with the left, and press Q to raise the shield.
No editor at hand? Play the demo in your browser or on Windows, and walk the same hallway, arenas and boss fight as a packaged game.
A project already using Soulslike Enemy Combat or Universal Player Combat turns them off before turning this plugin on, since a project runs one or the other. Switching to Universal Combat Framework moves its assets and settings across.
The demo map
LVL_UCF_Demo is the whole demo: a hallway of stations, three arenas reached from style plates at its end, and the wardrobe hall, where the demo's items and inventory styles can be tried on. It streams in its rooms and lights, and the arenas' enemies, the signs describing them and the triggers that name each place sit in its sublevel LVL_UCF_Demo_Enemies. LVL_UCF_Wardrobe opens the wardrobe hall on its own. All of them sit in Demo/Maps.Each place plays its own music, crossfading as you walk from one to the next: a lounge track in the hallway and the wardrobe hall, one track for each arena, and the dual-sword boss's own. A BP_UCF_MusicZone box over each place names its track, and BPC_UCF_MusicPlayer on the player controller plays the track of the highest-priority zone the player stands in, on that player's own machine. The tracks are MetaSounds in
Demo/FX/Audio/Music.Walk the hallway
Each stop has a sign naming the assets that make it work. 7, 8 and 9 jump straight to the start, the paired actions and the style plates.
| Stop | Try | Open |
|---|---|---|
| Door | E opens it, toward or away from you depending on your side; F kicks it open | BP_UCF_Door |
| Training dummies | Strike either one; neither can die. The right one has a defense set of its own | BP_UCF_HitDummy, DefenseRuleSet_UCF_HitDummy |
| Chests | E opens a chest, F breaks the lid off | BP_UCF_Chest |
| Loot chest | E opens your inventory beside it on a style that has a screen (switch at the wardrobe's style pads first), F takes everything that fits | BP_UCF_LootChest |
| Places on the Body | Two figures draw and sheathe two swords, and a sword and shield | BP_UCF_EquipmentShowcase |
| Weapon rack | E takes a sword or the shield, or puts a sword back on an empty peg | BP_UCF_WeaponRack |
| Paired actions | Six stations loop executions, counters and a vault; step onto the ring marked (you) and press E | BP_UCF_PairedStation, Paired_UCF_* |
| Style plates | Each switches your combat style and loadout and takes you to its arena; a red plate in each arena brings you back | BP_UCF_StylePlate, Demo/Combat/Styles |
| Wardrobe plate, in the start room | Takes you to the wardrobe hall: a pad for each weapon and worn item, and pads that switch the inventory style | BP_UCF_EquipPad, BP_UCF_InventoryStylePad |
The arenas
Each enemy in the arenas runs on the enemy AI: it scores its moves, keeps its distance and takes its turn through its combat role. Each holds the player's own items, flinches and falls limp the way the player does, and drops its weapon where it dies. Stepping on a plate also puts its arena's enemies back where they started, fresh, the boss included, and clears away the weapons they dropped.
| Plate | Your loadout | Enemies | What it shows |
|---|---|---|---|
| Freeflow | Bare fists | Eight bare-handed enemies, BP_UCF_EnemyCharacter_Unarmed | Strikes aimed with the stick, and counters: a jab or a cross showing the counter marker answers a Guard press with a counter, and the red haymaker, about one swing in five, wants a dodge. The crowd punches at half speed, so each warning comes in time to answer it. Its combat roles and attack tokens decide who attacks and who circles, so only a few swing at once |
| Over Shoulder | Sword and shield | Six combo enemies, BP_UCF_ComboEnemy_RandomWeapon, each drawing a baton, a sword or its fists as it spawns | Block, parry and break an enemy's stance, against enemies that attack one at a time with the player's own combos for the weapon they hold, while the ones waiting their turn throw a baton or lunge now and then |
| Soulslike | Two swords | The dual-sword boss, BP_UCF_DualSwordBoss | A boss fight: its bar stays up the whole fight; it rests between its strings and raises its guard after a run of your blows; parry its strings to break its posture and stun it, bring its health low and it staggers, and a light attack beside it starts the sword execution, the one blow that kills it |
Places and the boss fight
Walking into the hallway, an arena or the wardrobe hall shows its name at the bottom of the screen for a few seconds. Walking into the Soulslike arena opens the fight: the bar shows Dual Sword Boss over the boss's health and stun meter for as long as the fight runs, whatever your style and whether or not you lock on. It closes when the boss dies or you leave the arena.
Each name comes from a UCF Encounter Trigger box in
LVL_UCF_Demo_Enemies. A trigger with no enemies names a place; the boss arena's BP_UCF_BossArenaTrigger lists the boss, opens the fight and ends it once the boss is dead. The bar is WBP_UCF_EncounterBar (Demo/UI/Widgets/HUD), which the demo's HUD carries and which follows the UCF Encounter Subsystem, the one place a HUD binds to hear what the player walked into.Keys
| Action | Keyboard and mouse | Gamepad |
|---|---|---|
| Move, look | W A S D, mouse | Left stick, right stick |
| Light attack | Left mouse button | Right shoulder |
| Heavy attack | Right mouse button | Right trigger |
| Guard: a sword parries on a press as the hit lands and blocks while held; a shield rises | Q | Left trigger |
| Lock on, then flick sideways to switch target | Middle mouse button, then the mouse | Top face button, then the right stick |
| Dash: a dodge with a weapon, a vault over an enemy with bare fists | Space | Left shoulder |
| Interact, and the second option (kick, break) | E, F | Bottom face button, left face button |
| Draw or put away a belt slot | 1 to 4 | D-pad |
| Drop what is in hand | G | Right face button |
| Open the inventory | I | Tap View |
| Sprint (hold) | Left Shift | Left stick click |
| Swap the camera shoulder | V | Right stick click |
| Jump to the start, the paired actions, the style plates | 7, 8, 9 | Hold the right special button, press the D-pad up, right, down |
| Open the debug views menu (Debug it) | H | Hold the right special button, press the D-pad left |
Under Freeflow the right mouse button guards instead of a heavy attack. The hallway and the arenas use the simple inventory, which has no screen: there I points you to the wardrobe hall's style pads.
What the demo player is made of
BP_UCF_Character, under Demo/Characters/Player, is a Blueprint of UCF Character Base, which creates the combat components; the Blueprint adds a camera and the optional features, and fills in the settings.| Where | Setting | Value |
|---|---|---|
| Class Defaults | Starting Ability Set | AbilitySet_UCF_Default: lock-on, interact, sprint, drop, item use, and the demo's hit reactions |
| Equipment Manager | Default Item | Item_UCF_Unarmed, the fists it fights with when nothing else is drawn |
| Equipment Manager | Body Places | Main hand hand_r, off hand hand_l, three sheaths on the back |
| Inventory | Config | InventoryConfig_UCF_Simple: it carries what the belt holds and the gear it wears, and opens no inventory screen |
| Combat | Style | CombatStyle_UCF_OverShoulder |
| Targeting | Targeting Config | TargetingConfig_UCF_OverShoulder |
| Vitals | Vitals | Health, Stamina and Stance, each 100 and refilling 10 a second after 3 seconds, and Poise, which a hit drains toward a flinch (Hit Reactions) |
| Team | Team Id | 0; the demo's enemies are on 1 |
| Mesh | Component Tags | UCF.Montage, UCF.Attachment.Body |
BP_UCF_PlayerController carries the belt (a UCF Quick Bar of four slots), the keys, the HUD and the inventory screens, and BP_UCF_GameMode names the two as its Default Pawn Class and Player Controller Class. Character Setup adds the same components to a character of your own.Project settings the demo uses
Under Project Settings > Plugins:
| Section | Setting | Default | Does |
|---|---|---|---|
| Universal Combat Framework Demo | Load Demo Hit Effects | on | Loads the demo's hit effects: the sparks, sounds and camera shakes a hit plays. Untick it to ship without the demo; hit stop still plays. Takes effect on the next start. |
| Universal Combat Framework Input Display | Glyph Sets | the plugin's PlayStation, gamepad and keyboard sheets | The key art button prompts show. Empty shows the engine's own key names. |
Nothing else needs setting.
What the enemies are made of
Every demo enemy is built on UCF Enemy Character Base: the enemy layer's Enemy Character Base, carrying the player layer's pieces as well. It holds items through a UCF Equipment Manager and its Loadout, swings the player layer's UCF Melee Trace, moves its bones under a hit through a UCF Physical Reaction, and walks with its locomotion while its AI follows a path. UCF Enemy Targetable lets the player's targeting pick the enemy and lock on, and lets go of it when it dies. UCF Enemy Attack Steering aims each swing an action graph plays at the target the AI chose, so an Approach Window on the swing turns the enemy toward it and closes the distance.
| Enemy | Built from | What it adds |
|---|---|---|
BP_UCF_EnemyCharacter | UCF Enemy Character Base | The parent of every demo enemy: its controller, its brain and its AI Config, the baton in its Loadout's Starting Items with its fists as Default Item, Item Sets rows for the baton, the sword and the fists, and the player layer's reactions, below |
BP_UCF_EnemyCharacter_Unarmed, the Freeflow crowd | BP_UCF_EnemyCharacter | No Starting Items, so it fights with its fists, and Item Sets rows that give its fists ActionSet_UCF_Freeflow_Attacker and ActionSet_UCF_Freeflow_Supporter: the unarmed sets at half their play rates, the pace of the player demo's Freeflow enemies |
BP_UCF_ComboEnemy | BP_UCF_EnemyCharacter | A UCF Action Graph component, the enemy config EnemyConfig_UCF_ComboEnemy, and combo sets for the sword and the fists |
BP_UCF_ComboEnemy_RandomWeapon, the Over Shoulder crowd | BP_UCF_ComboEnemy | Random Starting Items: the baton, the sword or its fists, picked each time it spawns |
BP_UCF_BossCharacter | BP_UCF_EnemyCharacter | The parent of every demo boss: the arena boss size, its own controller and config, a second phase at half health, and posture in place of the recoil |
BP_UCF_DualSwordBoss, the Soulslike boss | BP_UCF_BossCharacter | Two swords, its own Action and Reaction Sets, and the player layer's finisher, below |
Enemy Weapons covers the Loadout, its Item Sets rows and Random Starting Items.
The player layer's reactions
BP_UCF_EnemyCharacter hands every demo enemy the reactions the player's character has:| Set on it | Does |
|---|---|
Defense component's Defense Set DefenseRuleSet_UCF_Character | Flinches it when its poise breaks, and lets half the poise damage through while it holds hyper armor. |
| Poise and Stance rows on its Vitals | The pool the player's hits drain toward a flinch, and the one its guard spends. |
Starting Abilities GA_UCF_HitReact, GA_UCF_Stun and GA_UCF_ParryRecoil | The flinch, the stun, and the recoil that stops its swing when the player parries it. |
Physical Reaction Reaction Set PhysReact_UCF_Enemy | A hit's physical reaction moves its bones, and the killing blow drops it limp. |
Anim Effects bank AnimEffectBank_UCF_Default | Its footsteps and its body's fall. |
While the player layer stuns, flinches or recoils an enemy, or plays it in an execution, UCF Enemy Character Base holds the enemy's AI: the action and reaction it was running stop, and it starts no other until the reaction ends. A move of the enemy's own combo that blocks actions, such as a string's recovery, holds nothing, so the AI lets the string finish and rests before the next.
A combo enemy
The combo enemy keeps what makes its parent an enemy and adds a UCF Action Graph component, which runs the moves its combos play. The item it holds hands that component its action graph, so a combo enemy holding the baton walks
AG_UCF_TwoHanded, one holding the sword AG_UCF_Sword.Its enemy config points at action sets that mix the enemy's ordinary actions with four from the seam:
| Action | Runs with | What it does |
|---|---|---|
| LightCombo | Action Graph Combo | Two variants, picked by weight: three light presses (weight 2), or a light press then a heavy one (weight 1). |
| HeavyCombo | Action Graph Combo | The baton's heavy combo. |
| AbilityComboTree | Action Sequence | Runs an ability action, a combo and a Behavior Tree action in order, as one action. |
| EitherCombo | Action Sequence | Runs one of its steps, picked at random by weight. |
Those four play the baton's graph. Its Item Sets rows hand it
ActionSet_UCF_ComboEnemy_Sword while it holds the sword and ActionSet_UCF_ComboEnemy_Unarmed while it fights with its fists, each a set of strings for that item's graph. In the Over Shoulder arena every attack takes both of the player's attack tokens, so one combo enemy at a time comes at you.The ones waiting their turn play their Supporter role's set instead of the strings:
ActionSet_UCF_ComboEnemy_Support, the enemy config's Supporter set, throws the baton about every 14 seconds, and the Loadout's Supporter rows give a sword holder ActionSet_UCF_Sword_Supporter (a lunge or a slash about every 15 seconds) and a bare-handed one ActionSet_UCF_Unarmed_Supporter (a jab).Action Graphs in Action Sets and Sequences and Random Options build both from scratch.
The dual-sword boss
BP_UCF_DualSwordBoss, under Demo/Characters/DualSwordBoss, is the boss parent holding two of the player's swords and open to the player layer's sword execution:| Added | Does |
|---|---|
Loadout Starting Items: two Item_UCF_Sword | One in each hand. The one in the main hand drives its moves. |
A UCF Action Graph component and ActionSet_UCF_DualSwordBoss | Strings from the sword's action graph, picked by weight, with hyper armor on the heavy ones and a breather of 1.2 to 2.2 seconds after each. Below half health its rage, GA_UCF_DualSwordBossRage, swaps in ActionSet_UCF_DualSwordBoss_Phase2: longer, faster strings with shorter breathers. |
ReactionSet_UCF_DualSwordBoss | A parry of a telegraphed swing through GA_UCF_SwordParry, playing the enemies' own parry montage AM_UCF_Sword_EnemyParry, a counter once a parry lands, a raised guard once two of your blows land within 5 seconds (four times in five, held 1.5 to 3 seconds, Hold a guard for a while), and a dodge back once a run of hits wears its poise down. The guard cuts a light string but never a hyper-armored swing, and your blows on it spark and clang. |
GA_UCF_BossPosture, from the boss parent | Each clean parry of its attack drains its Stance; the fifth in one exchange breaks its guard and stuns it. |
Defense component's Defense Set DefenseRuleSet_UCF_Character | A health floor stops its health at 150 and opens its finisher stun, and its stance stays whole under hits. |
Starting Abilities GA_UCF_FinisherStun | The stun that holds UCF.State.Finishable until the execution. It carries UCF.Ability.InterruptsActionGraph, so it cuts whatever move the boss was playing, a raised guard included. |
UCF.Enemy.SoulslikeBoss in its UCF Combat component's Character Tags | The tag the health floor and the sword's execution set, PairedActionSet_UCF_SwordExecute, look for. |
AI Config EnemyConfig_UCF_DualSwordBoss | Its awareness, Awareness_UCF_DualSwordBoss, sees all around it as far as its closed arena reaches, so it engages you anywhere in the arena. |
The execution knocks one of its swords away, kills it and throws it; the other sword drops where it falls. While the stun or the execution runs, UCF Enemy Character Base holds the boss's actions and reactions, so neither its next attack nor its parry can cut them short. Paired Actions covers executions, and Seam Patterns the pieces that cross the two layers.
Which layer to read first
The sidebar holds every page of both layers, under the names this plugin shows in the editor.
- Building enemies first? Start with Step-by-Step Enemy for a complete enemy from an empty folder, or Minimal Enemy for the components that make a pawn of your own fight.
- Building the player first? Start with Build Your First Combo for a sword that swings three hits, or Character Setup for a character that keeps its own parent class.
- Both at once? Build the first combo, then the first enemy, then give that enemy the combo: Action Graphs in Action Sets.
One Core, Two Layers shows what the two layers share: health, hits, defense and telegraphs work one way for enemies and players alike.
Debug it
In the demo, press H for the debug views menu: a row per view, All first, each showing its console variable and whether it is on. A click, Enter or the bottom face button turns a view on or off, and H, Escape or the right face button closes the menu. A game with no other players pauses while the menu is open.
The menu,
WBP_UCF_DebugMenu, lists the rows of two data tables in Demo/UI/Widgets/Debug, in each table's order: DT_UCF_DebugViews_Overhead for the overlays above each character, both layers' sections, and DT_UCF_DebugViews_World for the views drawn in the world, such as melee traces, steering, threat and stimuli. Each row is an F_UCF_DebugView, a Label and the Console Variable it turns on, so a view of your own is one more row, or a table of your own named in the menu's Overhead Views or World Views. Shipping and Test builds leave debug drawing out, and there the menu says so in place of its rows.The overlays draw above each character in Play In Editor, enemy or player. An enemy's decision and scoring blocks are worked out on the server, so they draw where the server runs: in a single-player session, or on the listen server's own screen.
UCF.Debug.All 1 // Every overlay at once; UCF.Debug.All 0 clears them
UCF.Debug.EnemyActions 1 // An enemy's actions with their cooldowns, and the one running
UCF.Debug.Actions 1 // The action graph node a character is in, its window, any press waiting
UCF.Debug.Role 1 // An enemy's name and combat role, colored by role
UCF.Debug.Scoring 1 // What each of an enemy's actions scored, highest first
UCF.Debug.Targeting 1 // Who each player fights, and the score every candidate got
UCF.Debug.Vitals 1 // Every pool a character carries, against its maximum
UCF.Debug.WatchPawn <name> narrows every overlay to one character, part of a name being enough, and UCF.Debug.WatchClear puts them all back.The plugin logs only warnings by default, each naming a setup mistake and its fix.
UCF.Logs Verbose raises every category, and UCF.Logs on its own puts the quiet default back.AdvancedRemove the demo
The plugin's Core folder holds everything it needs to run; the
Demo folder is there to learn from. With the plugin installed to the engine, every project on that engine shares the Demo folder, so leave it in place there.- Untick Load Demo Hit Effects in Project Settings > Plugins > Universal Combat Framework Demo. It takes effect on the next start.
- Right-click each of your assets built from the demo (a Blueprint made from
BP_UCF_ComboEnemy, an item usingAG_UCF_TwoHanded, a level usingBP_UCF_GameMode) and open the Reference Viewer: each asset it lists underDemois one your asset still references. - Duplicate each of those into your own folders and point your asset at the copy. Repeat until the Reference Viewer shows nothing under
Demo. - Last, delete the
Demofolder.
AdvancedAn enemy the player can lock on to
The player's targeting picks any actor carrying a UCF Targetable component. UCF Enemy Character Base carries UCF Enemy Targetable, which turns itself off when the enemy dies and back to its earlier setting when it is revived, so a lock lets go of a dead enemy.
An enemy built on Enemy Character Base directly has no UCF Targetable. Reparent it onto UCF Enemy Character Base, or add a UCF Enemy Targetable component to it; either works the same for targeting. With Aim at Socket unset, a lock aims at the capsule's center; point it at a chest socket to aim there.
A dead enemy leaves every player's targeting at once: its lock, the soft target on it, and an attack aiming at it all let go, so the next swing goes to a living enemy.
The player's swings land on UCF Enemy Character Base with nothing set: its body mesh is a Physics Body the camera ignores, and the demo player's melee trace sweeps World Static, World Dynamic and Physics Body objects. An enemy built on Enemy Character Base keeps the engine's Character Mesh preset, a Pawn, so set its mesh's Object Type to Physics Body, or set the player's trace filter to the Pawn channel.
Who fights whom is one team check on both sides, read from the UCF Team component on each character: the player's targeting asks it through Target Teams, and an enemy's target filter through the enemy's own team.
MultiplayerDeath, revival, places and the boss bar
An enemy dies and is revived on the server, and its Targetable setting reaches every machine from there, so each player's lock lets go of the same dead enemy.
Each machine runs the encounter triggers for its own player, so a place's name or the boss bar shows for the player who walked in, and nothing about it crosses the network. The boss's health reaches each bar through the boss's own replication. The boss arena's list of enemies replicates, so a boss a plate put back is the one every machine's fight follows.
C++C++
AUCFEnemyCharacterBase(UCFBridge) derives fromAEnemyCharacterBase. It createsTargetable(UUCFEnemyTargetableComponent),AttackSteering(UUCFEnemyAttackSteeringComponent),EquipmentManagerComponent,AnimManagerComponent,PhysicalReactionComponent,AnimEffectComponentandLoadout(UUCFEnemyLoadoutComponent), setsMeleeTraceComponenttoUUCFCombatTraceComponent, and callsUUCFAbilitySystemReady::NotifyAbilitySystemReadyfromBeginPlay. While its ability system holdsUCF.State.ActionsBlockedorUCF.State.PairedAction, it holdsUCF.Action.BlockActionsandUCF.Reaction.BlockReactionson the server, stops the running action and reaction, and blocks its controller's action evaluation.UUCFEnemyTargetableComponentderives fromUUCFTargetableComponent. It follows its pawn's controller throughReceiveControllerChangedDelegateand binds that controller's Combat Controller death and revival events on the server.- The team check both sides read is
UUCFTeamHelpers. - Place names and fights come from
AUCFEncounterTriggerandUUCFEncounterSubsystem(UCFEnemy).