Basic Melee Combat System - Documentation
Basic Melee Combat System - Documentation
2 – Documentation
Thank you for the interest in project. As a single component, this project was developed as a simple
way to implement a basic melee combat system into your game. Since most events are exposed as
event dispatchers, this component can be used for any kind of game that need attack sequences and
combo finishers, and not exclusively for fast paced action games.
Updates and Change Log are in the Discord Server, feel free to join, the link is
on the product’s description on the marketplace.
Character Implementation
Path: /Blueprints/Components/SimpleCombatSystem/Main/C_BasicMeleeCombatSystem
Path: /Blueprints/Components/SimpleCombatSystem/Interfaces/I_Components
3. Use the “Attack Main Event” function to call attack combos (check the section “Adding
Attack Combos” for more informations). Other functions that can be called (Dodge, Block, Update
Lock On, Run. Check the Example Character for reference).
4. Add the reference of the component to the “Get Combat System Comp” function.
5. Place a “BP_AIDirector” actor in your level. (Very importat step, this blueprint is
responsible for storing all available targets for the component, for both Player and AIs)
Path: Blueprints/AI/Level/BP_AIDirector
Important: The animation blueprint implementation steps are valid just for the
UE4 version of the project. If you are using UE5, all these steps are already
implemented in a Linked Anim Graph.
(These steps are only necessary if you already have an animation blueprint for your character,
otherwise it is only necessary to retarget the “MeleeCombat_AnimBP” to your character’s
skeleton)
Path: /Blueprints/Animation/MeleeCombat_AnimBP
4. In the Anim Graph, if your Animation BP doesn’t have a blend pose per bone setup, copy and
paste the indicated notes to your output pose.
5. In your State Machine, create the states “Combat Mode” and “Blocking”. Setup the
transition rules as it is on the example animation blueprint. (Unfortunately, there is no way to easily
copy and paste it.). (Only necessary if these actions will be used, otherwise this step can be
ignored)
6. Inside the Combat Mode and Blocking state, replace the default walking Blendspace and
blocking loop by yours.
7. If a new style was added, right click on the blend poses node, add the pin for it, and add the
blend space.
Animation Setup - Animation Notifies
Damage and i-frames are handled by animation notifies. For damage, add the “HitScan” notify
state to your animation, and on the configuration panel, select the bone in which the trace will start,
among other options like damage and FX.
Another Included Notifies:
Component Use
With the update 1.5, animations are changed with a Data Table. This adds the possibility of
changing the entire animation set in run time, and to add any number of combos.
Blueprints/Components/SimpleCombatSystem/DataTables DT_AnimationSet
The Animation set data table contains all animation montages that are used by the system, with the
exception of the attack combos, which are stored in a separated data table.
The default animation set is “FightingStyle1”. If the animation set will not be changed in your
project, only this row will be used.
This data table stores all combos for all animation sets. To change, or add, animations to the per-
exiting combos, open the data table, and expand the drop down menu of the wanted combo.
(v1.5) Adding Attack Combos
To add a new type of combo, add an entry to the “Enum_Combos” enumerator. Then add the
animations to the Data Table (instructions on the previous section).
With the update 1.3, some settings are now also found on data table. This settings change when a
new animation set is loaded.
/Blueprints/Components/SimpleCombatSystem/DataTables/DT_AnimationSet_Settings
This way each fighting style or weapon can have it’s own settings, like walking speed, for example.
To change these settings, open the data table, and click on the desired row.
These settings will override some component options, and are loaded when a new animation
set is loaded
These steps are only necessary if your project is going to use more than one animation set,
otherwise this can be ignored.
To add more fighting styles, some few steps are necessary, nothing advanced, but require some
basic knowledge of the engine.
Assign it to the new created enum, with the “AnimSetType” option, and also set the name of the
animation set on the “AnimSetName”.
(The “AnimSetType” will be used in the animation blueprint, to change idle states, for example,
and the “AnimSetName” will be used by the settings data table).
(Default:/Blueprints/Components/SimpleCombatSystem/DataTables/DT_AnimationSet_Settings)
Add a new row with the same name as in “AnimSetName”, and change the wanted settings.
Events
Each main action call a correspondent event, which can be used to make the component more
adaptable to your game.
For example, Here I’m using the “On Attack Hit” Event to play a force feedback.
(v1.3) Add / Remove Animations from Sets
Load Animation Set Data Table – Use when the entire animation set will be changed, this will
replace the current set based on the “For Weapon” parameter. (If true, the current weapon animation set will
be changed, otherwise the melee will).
Add / Remove Single Attack – Unlockables animations are stored in three separated data tables.
For Attacks, Finishers and Specials.
Path:
(/Blueprints/Components/SimpleCombatSystem/DataTables/Unlockables/DT_Unlockables_Attacks
/Blueprints/Components/SimpleCombatSystem/DataTables/Unlockables/DT_Unlockables_Finishers
/Blueprints/Components/SimpleCombatSystem/DataTables/Unlockables/DT_UnlockablesSpecials)
Open the wanted data table, add a new entry, and name it. Also add the attack montage, and
settings.
Call “Add or Remove Single Attack”, and type the name on the “Name” parameter, and choose if it
will be a new attack, finisher or special.
If the Example Weapon Blueprint will not be used, some steps are required to setup your weapon to
work with the component:
2. Copy and paste these nodes from the Example Weapon Blueprint to attach / detach the
weapon from the bone. Create the necessary variables.
3. Add a reference to the created variables, and the weapons mesh, to the correspondent get
function of the interface.
AI Implementation
2. On the Combat component, under the “Options – General” Tab, check the option “For AI”
Command Recognition
Check the documentation for the Command Recognition Here. Only a few steps are necessary for
implementation.
Special Attacks
Special attacks work just as other attacks, but it has a dedicated event, to add one follow the steps:
Here I’m using the “Execute Command” event of the Command Recognition component to call it,
but it can be a Key press, custom event or anything else.
After you implemented the main component, follow these implementation steps:
All Combat Finishers are stored in the “DT_AnimationFinishers”. Simply add entries to this data
table, and add the Attacker and Victim montages, along with other settings.
Then open the “DT_AnimationsSet” and add the name of the finishers (must be exact the same as in
the “DT_AnimationFinishers” data table) for each direction. A finisher will be chosen randomly
and played automatically when the enemies’ health is low enough.
Counters
Counters are also store in the “DT_AnimationFinishers” by default (but you can create a separated
data table to store the counters, if you want) and are configured in each attack, in the
“DT_AttackCombos” data table.
Note that, for each attack that will have counter, place a “BP_N_NotifyWindow” notify on the
animation.
(v2.1) Dynamic Dodges, Blocks and Hit Reactions
The first step is to create a new row on the “DT_Blocks” or “DT_HitReactions, add your
animations in the array, and a unique name for each.
The next step is to assign the Block and Hit Reaction to your animation set, in the
“DT_AnimationSet”
Both hit reactions and blocks are stored in each hit scan notify, of each attack animation, using the
unique name of that dodge:
Dynamic Dodges
The first step is to create a new row on the “DT_Dodges” data table, add your dodges and a unique
name. Next, assign it to your animation set, in the “DT_AnimationSets” data table.
Dynamic Dodges are stored in the “Possible Dynamic Dodges” array, in each attack on the
“DT_Combos” data table, make sure the name is the same as in the dodges data table.
Support
Please report any bug report or issues encountered directly via my support Discord Server or email
(Available in the my marketplace page), if possible. This is the faster way to get in contact with me,
and I’ll will fix and release an update as soon as possible.
The most important options of the component are commented, but feel free to contact me for
support.
Although it is a simple system, for those who bought the project for blueprint leaning, or to know
how a specific feature works, I can gladly provide more details on this if necessary.
Quick Tips:
1. Most Mixamo animations do not have an “In Place” Option, which limit number of the attack
animations that can be downloaded from there.
2. Check in which axis the movement is happening in the animation. (In most cases is Y).
3. Seach for “root”, Select the “Location(root)” of the Axis, and press “Shift+H” to isolate only
the keyframes of this bone.
4. In the keyframes area, press “A” to select all, right click and choose “Snap => Selection to
Cursor Value”.
This will remove the movement of the animation. After this is just export.
2. With Mixamo animations, I’ve found that they don’t work well in their default speed. With most
of them I’ve set the montage to play 1.75x or 2x speed. I recommend experimenting with the play
rate if the combat is slow with your animations.
Update Implementation
If you already implemented the component in your project, and cannot simply migrate the updated
version to it, you can get the update by following these steps:
(Keep in mind that this will reset all your settings within the component.)
IMPORTANT: Consider doing a Backup of your entire project before
anything else. This require some work and intermediate knowledge of the
engine.
1. Consider a full backup of your project before doing any of this, since this not a fail safe
method
2. If the project was already updated in the marketplace, download create a new project for it.
3. This is the hard part, select the Combat Component and choose to migrate it, but you have to
make sure to select off the “Asset Report” pop up, all assets that you have changed or made
progress with, (your animation blueprint, your character, etc).
4. If you didn’t migrate the animation blueprint, follow the “Animation Blueprint
Implementation” steps from above.
5. That’s it, check if everything is working. The created project can be deleted, if you want.
Disclaimer - Since the UE5 release, It was necessary for me to split the project in two
versions, to be able to change the character’s mesh. So, for each future update, it would be
required for me to do the same work twice, for both versions. Because of this, version 1.3 will
be the last update for the UE4 version of the project. But the UE4 version will continue
receiving support for bug fixes. Sorry for this, but it would not be possible for me to maintain
both versions.