Player Movement
The player can freely move in all directions. The character is oriented towards the camera's forward vector. For animations, I used an 8D animation set allowing the player to walk and strafe in all directions. As it is a crucial part of games in this genre the player is able to dodge roll in every direction allowing him to dodge all the damage from incoming attacks.


Player Attacks
For attacking the player and the enemy are using a certain set of animations. The player can attack once but he can also chain the attacks together creating an attack combination. While slashing the weapon, the attached trace component checks for collision on enemies. The player is able to hit multiple enemies at once and apply damage to all of them.
Blocking
The player can dodge incoming damage by rolling away. However, the character is also equipped with a shield. With this shield, the player can block all damage coming from the direction the character is facing. When the character is facing the enemy and the player is blocking the damage is getting neglected and stamina is consumed. When the character is facing the other direction while blocking the damage is still going through. To implement this mechanic I used the Dot Product in order to calculate the angle between the player and an enemy.

Lock On
Locking on enemies is a common mechanic in this genre. It takes the camera controls away from the player focusing the camera on to the enemy. I developed this mechanic by casting a sphere around the player checking for all actors hit on the enemy layer. To indicate on which enemy the player is currently locked-on the enemy character is displaying an indicator. When being locked onto an enemy the player character's forward vector is always facing the enemy character. While being locked on the player animations change to strafing animations.
Enemy AI
I developed the Enemy AI with behavior trees for which I wrote my own Tasks, Decorator, and Services. The AI has five different states: Idle, Range Attack, Charge Attack, Melee Attack, and dead. While being in the range state the enemy is launching projectiles towards the player. There is a chance that while being in the range state that the enemy is entering into the charge attack, the probability of this happening is increasing with each projectile launched. The transition between the melee and ranged state is based on the distance between the enemy and the player.

Code Structure
I created other projects in Unreal Engine, Unreal Engine Cpp, and Unity before and usually, I like to use inheritance for my projects. However, for this project, I decided to try a different approach. All the gameplay logic is written in components that can be attached to Actors making this approach very flexible. For communication between components, I utilized interfaces a lot.