top of page

Developing on: Unreal Engine

This is example of an animation based combat system. The goal was to create a Souls like combat that allows for combo of attack animations based on input precision. When creating this I wanted to be able to record inputs from the player and setup the next montage before interrupting a current one being played. 

Update - March 21 2023

- Added prototype inventory component and menu. Player can pick up items and sort and drop items back through Unreal Engines drag and drop operations.

I decided to add the combat system as a component that could be attached to any of the Character class. The component allows for two inputs, one for the light attack and one for a heavy. The  FCharacterCombo struct is where we hold the information for the input attack, specifically an input trigger and an array of FCharacterAttack instances that holds a single montage and an int variable.

With the configurations of our input are filled You can press begin play and this is where the component will add our new inputs  to our local player and bind them to the light/heavy attack functions for this character instance.

The Light/Heavy Attack functions are used to track if the incoming input can lead to a valid beginning or continuing of a combo. If the pointer CurrentComboConfig is currently null then that is assumed that there is not a current combo in process and same for the IsComboInterrupted function, which does an equality check between our CurrentComboConfig and the FCharacterCombo  variable that correlates with this function.

If the combo hasn't started or hasn't  been interrupted, then the attack function does the heavy loading of input. It essentially will check our current combo and play the montage in the current sequence as long as one is not playing. If there is a current montage still being played, then a timer will be set that is bound to an function to play the next montage. After that another timer event is created to reset the combo if this montage is the last in the array. Otherwise we will only disable input for a small time to allow for varying windows that the player can progress the combo, which avoids spamming of the input key to finish the combo.

bottom of page