Syncing Boss Attack Animations With Attacks


By Will Fox

4/21/2023

Hey everyone! I didn't do too much this week as there was an event at my school that I had to attend. So, this week, I will be talking broadly about how I have been developing the bosses of the game and how I am syncing their attacks as well as cycling their phases.

Like I mentioned last week, the latest boss I have been working on uses a random number generator to decide which attack it will use. When it decides its attack, it will call a setup function that will set up different enumerators which will then allow certain animations to play within the animation blueprint. Although this is a relatively simple concept, the code can be bogged down and become complicated when certain animations only play based on movement speed. The Sevarog boss does this. A good work around for this, though is creating an "and" statement that checks two things. First, it should check Sevarogs movement speed. If the movement speed is between 0-500 - or another number that you want - it will return true. Then, it will check a movement enumerator. Here's what I mean. If Sevarog is using an attack that requires him to charge at the player, I use an enumerator that keeps track of Sevarogs movement and set it to a "charging." So, if the movement speed is between 0-500, and the enumerator == charging, the animation for charging should play. This can be a little finicky, but that's what debugging is for.


Once the attack executes, it will return to a function that decides another random attack. To ensure that Sevarog doesn't have any undefined behavior, I set the movement enumerator to "idle" to ensure that he stands there idly and waits for the enumerator to change to something else. To be honest, that's about it! The process is super simple, and it works very well. The biggest thing that you need to remember when developing a boss that cycles through attacks is to always return to a function that chooses the next attack. 

Again, sorry for the short post this week. I should have more to share next time. Thanks for reading.

Leave a comment

Log in with itch.io to leave a comment.