Combat System

The Enemy AI - Tookit includes a modular combat system implemented as an actor component. This section gives you a general overview of the system and how the included assets fit together.


Included Assets

The combat system comprises a variety of components and blueprints that work together to achieve the desired outcome. All classes included in the combat system can be found below:

Combat Component

Hitbox Actor

Animation Notifier

Attack Behaviour Task

Attack Config


Overview

A modular, blueprint-based combat system as actor definition: Attacks are selected randomly from the enemy config based on their weight, with cooldowns preventing spam. A notify state switches hitboxes on/off during the hit window, and the montage lifecycle runs smoothly via delegates (start/end). The system is interface-driven and BT-ready (task included) and can be integrated into any AI with a central enemy configuration.

Key Features

The combat system comes with many features. See below for a quick overview of the most important features:

  • Weighted selection & Cooldowns: Each attack is assigned a custom weight and cooldown. The weight determines how frequently the attack is performed, while the cooldown period defines how long the attack is blocked for after being executed.

  • Clean animation handling: The lifecycle of attack animations is observed by the system allowing for perfectly timed execution.

  • Hitbox control: The system uses animation notify states to controll the active states of hitboxes. Allows to controll damage between animation keyframes.

  • Interface driven: Due to the use of interfaces, the system is easy to implement into custom characters.

  • BT-ready: The system includes a task node, that can be directly implmented with behaviour trees.


Quick Start

Here you will find the shortest route to the first executable enemy attack. In a few clear steps – from the config to the hit window in the montage to the BT task – you will have a functional setup without any additional scripting. If you use the Enemy Character Base, most of it is already wired up.

This setup assumes that your character has assigned hitboxes. Otherwise, they will perform the attack, but will not be able to detect hits or apply damage. If this is not the case: Go to your character's blueprint, add a child actor component to its mesh, set the Child Actor Class to BP_Hitbox, then attack the child actor on any bone on your character (e.g. hands). Done.

1. Create Attack Config

First you need to create an Attack Config for each attack (Content Browser → Add → Data Asset → Attack Config) and select the attack's montage. Fill in , , , and (0–1): Cooldowns prevent spamming, while Weight controls how often the move is used relative to others (e.g., 0.6 frequent, 0.2 rare). Make sure that the animation belongs to the correct slot and uses the same skeleton as your character – otherwise it won't play. You can then duplicate the asset and only adjust the values/animation to quickly create additional attacks.

2. Add Attacks to Enemy Config

Now, after you created your attacks, open your Enemy Config asset and add your previously created Attack Configs under Combat Settings → Attacks. The order doesn't matter; the system reads the list and selects at runtime based on weighting + cooldowns. Save – now the enemy knows your complete attack set.

3. Add Animation Notify State

Lastly, open the respective attack montage and place the Combat Toggle Notifier (State) over the actual . The hitbox turns on at the beginning and off at the end – you don't need to script anything, just cover the area neatly. Multiple windows are possible; save the montage and you're ready to go.

Of course if you purchase the pack, all of this is already setup. The only thing you would need to do is create your attack configurations and apply them to your wanted enemy configurations.

Last updated