0% found this document useful (0 votes)
17 views

Basic Melee Combat System - Documentation

The Basic Melee Combat System v2.2 is a versatile component designed for integrating melee combat into various game types, featuring attack sequences, combo finishers, and support for AI characters. It includes detailed implementation steps for character setup, animation blueprint integration, and dynamic features like dodges and counters, along with data tables for managing animations and combos. Users are encouraged to join the Discord server for updates and support, as well as to follow specific guidelines for animation adjustments and project updates.

Uploaded by

uqomgpool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Basic Melee Combat System - Documentation

The Basic Melee Combat System v2.2 is a versatile component designed for integrating melee combat into various game types, featuring attack sequences, combo finishers, and support for AI characters. It includes detailed implementation steps for character setup, animation blueprint integration, and dynamic features like dodges and counters, along with data tables for managing animations and combos. Users are encouraged to join the Discord server for updates and support, as well as to follow specific guidelines for animation adjustments and project updates.

Uploaded by

uqomgpool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Basic Melee Combat System v2.

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.

Do not Include Animations, but was developed using Mixamo Animations,


which can be downloaded for free.

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

1. Add the Basic Melee Combat System component to your character

Path: /Blueprints/Components/SimpleCombatSystem/Main/C_BasicMeleeCombatSystem

2. Add the interface “I_Components” to your character

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

Animation Blueprint Implementation (UE4 Only)

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)

1. Open the example Animation Blueprint

Path: /Blueprints/Animation/MeleeCombat_AnimBP

2. Add the Interface “I_Animation BP”


3. In the Event Graph, copy and paste all nodes indicated. And create all necessary variables

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:

“BP_N_iFrames” – Optional – iFrames (Avoid Damage in the Notify Window)


“BP_N_AttackEnd” – Optional – Jump to the end of the attack, for faster combos
“BP_N_Attack_MoveTo” – Required – only for “Move To Attacks” animations, Starts the
movement.
“BP_N_Attack_Pause” – Optional - for “Move To Attacks” animations, Pause the Animation until
the chracter reach the target.
“BP_N_CounterWindow” – Required – only in Counter animations. Place on the attacker, in the
interval where the counter is possible.

Component Use

To add your animations:

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.

The data table can be found at:

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.

(v1.5) Attack Combos

The combos data table is called DT_AttackCombos

Path: Blueprints/Components/SimpleCombatSystem/DataTables/ DT_AttackCombos

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).

Path: Blueprints/Components/SimpleCombatSystem/Enums/ Enum_Combos


(v1.3) Animation Set Settings

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

To Add New Styles and Weapons

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.

1. Open the Enum “Enum_AnimationSets”


(Path:/Game/BasicMeleeCombatSystem/Blueprints/Components/SimpleCombatSystem/Enums/Enum_AnimationSets )
Add a new entry, with the name of the new style

2. Open the data table (Default: Blueprints/Components/SimpleCombatSystem/DataTables DT_AnimationSet_Melee)


press the “Add” button, name the row, and add the wanted animations.

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).

3. (Optional) Open the Animation Set 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

New events were added with the 1.3 update:

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.

(v1.3) Weapons Setup


If you are going to use the default weapon blueprint, the only step necessary is to set the name of
the weapon. (Must be the same as in the data table row).

If the Example Weapon Blueprint will not be used, some steps are required to setup your weapon to
work with the component:

1. Add The Interface “I_CombatSystem_Weapons” to your weapon

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

For AI characters, there is two more steps that need to be done:

1. Add the “AI_Communication” interface to your character.

2. On the Combat component, under the “Options – General” Tab, check the option “For AI”

Command Recognition

This a bonus feature, that includes my other marketplace component.

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:

1. Add the wanted to attacks to the data table:


2. Call the “Special Attack” event of the component

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.

(v2.0) Counters and Finishers

Version 2.0 add support for Counters and Combat Finishers.


Both Requires the new “BPC_AnimationSync” component on your character.

After you implemented the main component, follow these implementation steps:

1. Add the BPC_AnimationSync” to your character.

2. Add a reference for it on the “Get” Function


Combat Finishers

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

Dynamic Hit Reactions and Blocks

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.

The movement of these animations must be manually removed.

To do this, Using Blender:

1. Import the FBX and go to the Graph Editor.

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.

You might also like