Revamping and Reimagining Our Combat


The Problem: It Sucks

This week I spent a lot of time thinking about our combat and ways to improve it and I also had a few things to add to it. We wanted to add secondary/heavy attacks and we needed a particle effect when the player's weapon hits an enemy. I also ended up replacing the jump with a dodge because we deemed the jump useless. There are no situations in the game where the player needs a jump, so I replaced it with a dodge because that is significantly more useful to the player, especially with the current state of the enemies.

For secondary/heavy attacks I wanted the player to be able to chain into a heavy attack from a light attack and after that heavy attack is executed, the combo would be reset. When it came to implementing the particle effect when an enemy is hit, I needed to get the location of the hit, but because we were using overlap events to deal damage the location that the colliders collide isn't recorded. So I need to figure out a way to get the hit location without having a blocking collision between the weapon and enemy hitboxes.


The Solution: It Still Sucks, but Less

My initial approach for implementing secondary attacks was just to replicate the system that I used for the primary attack: when the right mouse button is pressed call a "HeavyAttack" function that uses the combo attack counter to switch to the respective case that plays a heavy attack animation. The problem with this system is that if we wanted to increase or decrease the number of possible attacks we would have to go into the header file, add another property for another animation montage and add another case for that attack in the switch statement. So, I instead made two arrays of animation montages, one for light attacks and another for heavy attacks. I could then use the attack counter to index into the array and play that animation and then increment the counter. This way I could add (or remove) 'n' number of attack animations and not have to go in and change the code every time. I also plan on moving this functionality to the weapons because we want each weapon to have its own combos and abilities so this makes that easier rather than having the functionality of every weapon tied to the player character.

To solve my problem with the hit particle effect, I utilized the sphere trace animation notify-state that I developed earlier in the development of the project. Using the sphere trace allowed me to get the hit location and pass that to the weapon. The weapon would then use that location to spawn a particle system that is the hit effect.

Adding the base functionality for the dodge was fairly simple, press a button and play the animation. However, there were some problems with it. The animation itself was a dodge roll and the amount of distance the animation translated the player wasn't what we were looking for so I had to bring it into Maya and do my best to increase the distance while keeping the animation looking and feeling as natural as possible. Currently dodging performs the dodge action in the direction the player character is facing at the time the button is pressed. I plan on using this next coming week to add more control to the dodge as well as a few other things.

Get Lucifer's Hordes

Leave a comment

Log in with itch.io to leave a comment.