Bootstrap
A Combo Attack System for Dual Swords

Project Overview

Project Type: Personal
Focus: Combo Attack System, Animation State Machines, Animation Montages
Role: Technical Designer
Game Engine: Unreal 5
Language: Unreal Blueprint
Description:
The focus of this project is on using animation sequences to create a combo attack system.
The system supports keyboard-only, keyboard with mouse, and controller.

Controls:
     - WSAD / Left Joystick = Move
     - Space / (Controller A) = Jump
     - J / Left Mouse Button / (Controller X) = Normal Attack
     - K / Right Mouse Button / (Controller Y) = Charge Attack
     - L / Middle Mouse Button / (Controller B) = Skill
     - Left Alt / (Controller RB) = Evade
     - I / (Controller LT) = Guard
     - Left Shift / (Controller LB) = Accelerate
Features:
     ▪  Animation Montages with Root Motion
     ▪  Combo Attack Map Design
     ▪  Combo Attack Input Detection
     ▪  Animation Notifies and Notify States
     ▪  Weapon Damage Collision - Sword Trace
     ▪  Weapon Damage Collision - Basic Shape Trace
     ▪  Special FX for Charge Attack and Skill


01 - Combo Input Map

A BP macro has been created to detect whether the saved input is "X"(Normal Attack key) or "Y"(Charge Attack key).
If rotated 90 degree, the part of BP nodes resembles the designed combo input key map.
BP for Combo Input Map
Combo Input Map
Air combo map is a simplified version of ground combos.
BP for Air Combo Input Map
Air Combo Input Map
The whole BP for combo input feature is shown below.
The C0(Y-Y-Y) and C1(X-Y-Y-Y) are special. Because C0 starts with "Y" and C1 has pick-up effect which will affect jumping.
BP for Input Action Normal Attack (X) and Charge Attack (Y)

02 - Anim Notifies

In the referenced animation montages of the combo attack system, many things are handled as shown below.

Anim Notifies and Anim States in Montage Assets
+   Notify State - Attack State : used to calculate valid conditions for other actions.
+   Montage Notify - Should Combo: used to detect last saved input ("X", "Y", or none) to blend to next normal attack or charge attack.
+   Montage Notify - Deal Damage : using static simple shape collisions to deal damage.
+   Notify State - Melee Collision : using dynamic sphere trace between last frame (previous frame) and this frame to deal damage.
+   Skeletal Notify - Melee Collision: using dynamic sphere trace between last frame and this frame to deal damage.
+   Skeletal Notify - Play Sound : for Attack woosh SFX
+   Skeletal Notify State - Trail : for left and right sword trails.
BP macro of Combo Attack

03 - Damage Collision

Two different ways of damage collision trace have been tested.
One is using collision shapes relative to character body, and the other one is using collision shapes relative to swords.
For both ways, each hit object will only be damaged once for every slash of an attack animation.
Damage Collision - Trace relative to Body
The body-relative trace suits quick attack slash animations, since all objects in the trace area will get notified at the same time.
The effects of this way looks good for melee combat with multiple enemies.
While the collision simulation is kind of fake (simultaneous hits of objects), an advantage is that it won't be severely affected by frame drop. Because collisions are bound to a body bone which won't move drastically.
Damage Collision - Trace relative to Weapon
The weapon-relative trace suits slow attack slash animations, since the trace area will move through objects one by one.
If with slow slash animations and combating one or two enemies, this way can simulate weapon damage better than the first way.
Although the collision simulation is more realistic, an disadvantage is that it will rely on steady framerate to successfully detect hit objects along the weapon animation path.

04 - Combo Input Detection

For attack animations that can follow another combo attack, there are two "Should Combo" anim notifies to check the last valid input.

                "X": stop current montage and play to next Normal Attack montage
                "Y": stop current montage and play to next Charge Attack montage
                "none": keep playing backswing and blend out to idle

Combo Input Detection Timing
Backswing Start Point
Backswing End Point
From 0 to the first "Should Combo" point, it's the early input reading period.
From the first "Should Combo" point to the second one, it's the late input reading period.
Normally speaking, the early period lasts around 0.4 to 0.5 seconds; the late period of attack animation lasts around 0.1 to 0.15 seconds. The consistency of combo attack timing will make it fluent.
Combo with all Early Checkpoints (Faster)
Combo with all Late Checkpoints (Slower)
You can distinguish the difference in attack speed between early and late checks.
Originally, the late input checkpoint is designed to make it easier for the player to trigger combos.
However, these two periods of input reading can also be used to introduce additional extensions, such as "light attacks" and "heavy attacks", or different weapon weights.


05 - Secondary Actions

Attack Rotation
During the attack animation gaps, the character is going to lerp rotation to the joystick input vector.
Attack Rotation < 90°
Attack Rotation 180°
Evade
Evading can be used as a fast movement when running without any speed lag.
It can also interrupt an attack animation by quickly switching to another direction and canceling the attack's backswing abruptly.
Evade during Idle and Run
Evade during Attack
Multiple Jump
The character can jump multiple times in the air. The number of jumps will be reset when the character lands.
Multiple Jump
During an air combo, jumping will cancel it, allowing the player to quickly take control of the air movement.
Jump Cancel Air Combo
Guard
A blend space 2D has been created for 8-way guard movement.
Blend Space 2D for Guard Movement
In the guard state, the character will have a slower movement speed.
Guard Movement (front view)
Guard Movement (back view)
After the blend space has been set up, then it can be blend with the "Guard" pose by using Layered Blend Per Bone.
To simulate a natural guarding pose, the blend bones are set to "clavicle_l" and "clavicle_r", which is more realistic than setting to spine bones.
Layered Blend Per Bone with Guard Pose
Layered Blend Settings
When the 'Mesh Space Rotation Blend' option is enabled, the rotation of the blending "Guard" pose will be applied to the final blend effect, ensuring that both swords are positioned directly in front of the character's head.
Guard Blend Bone with Mesh Space Rotation
Guard Blend Bone without Mesh Space Rotation
Another use of the guard state is to reset the camera to face forward.
Guard Reset Camera
Accelerate
In the walk-run blend space, four animation sequences are set: "Walk," "Walk Faster," "Run," and "Run Faster".
Accelerate Run
In the accelerating state, the character can move 1.5x faster.
Accelerate Run
Faster move speed leads to longer jump distance, approximately equivalent to the distance of a double jump.
Jump vs Accelerate Jump
Accelerate Jump Usage