Devlog 3: Sandy Boyett: Boss Attacks, Ranged and Negate


Problem:

This week, I focused on bringing our first boss up to speed with the other enemies. I set up a ranged and melee attack for the boss, similar to the cactus enemy from our first level. However, the boss also required a third attack, which the cactus didn’t have. This needed to be addressed to avoid future issues as we introduce more enemy variants.

Calculating the distance between the enemy and the player, then executing the attack depending on the distance.

To manage this, I had a little bit of trial and error, but ultimately decided to categorize enemies into groups: those with a single attack (either melee or ranged), those with both, and bosses with up to three attacks. This would help set things up for future enemy implementation and placement into the game.

Original attack tree that all enemies relied on which only had the single attack task that housed the melee and ranged attack as seen in the above blueprint. This was causing issue as the cactus had a two-attack limit, but the turtle has three attacks total.

The third attack for the boss was intended as a negate damage defensive move. The goal was for the shield to deflect projectiles back at the player. However, I struggled to implement this and faced challenges with collisions, leading to the player and enemy getting stuck. I decided to pause this feature and instead focused on syncing the animation with the shield's appearance and disappearance. Unfortunately, the animation was executing too quickly, causing the shield to appear when it was no longer needed or the turtle to be able to walk outside of it after the animation played.

Solution:

To address the challenges I faced, I created a new AI controller for each enemy group and developed additional behavior trees to manage the varied attack types. This required more trees and tasks than I initially anticipated.

New AI Controllers to control the individual groups of enemies, again for now just the turtle boss and the dual - which houses both melee and ranged attacks. The AI_EnemyController is the original controller, but for now it's houses only the melee attack, and the ranged controller contains only the ranged attack.

These are all of the new behavior trees for each enemy group dependent on if they have two attacks, a single attack - melee or ranged, and our turtle boss. Of course, there's others like the wander for them to be able to wander around.

All of the new tasks to accommodate these groups as well as focusing on the target before attacking, finding the location of the target and some extras for now.

For the Turtle Boss, I needed him to face the player during ranged attacks and shoot projectiles in their direction. Initially, I used a simple sphere projectile, but we ultimately wanted spikes. I experimented with rotating them and forming a circular pattern, but it didn't meet our expectations.

This was the first real progress that I made for the projectiles, however this isn't what I wanted. Whenever the player shifts from directly in front, the projectiles didn't account for this new position and rotate accordingly.

For now, we decided to implement a few spikes or a single spike that would shoot towards the player at increased speed, making the encounter more challenging. This proved to be quite a challenge as I couldn't quite get the projectiles to move to the players location and rotate accordingly as the player moves. Below is the furthest that I've gotten as of yet. Which, right now, the projectile indeed goes to the players location and rotates accordingly. The size and speed have also both been increased to add to the challenge. We're planning on refining this as time passes to better improve the overall look and number of projectiles that spawn.

Projectile moves to the player's location upon spawn. These only spawn upon the trigger of the ranged attack.


Regarding the negate damage attack, I initially tried slowing down the animation to sync it with the shield, but it didn’t help. I sought assistance from teammates, and we moved nodes to simplify the setup, adding an Anim Notify to the montage. This was something I hadn’t realized was possible before. We customized the Anim Notify in the Turtle Boss’s Animation Blueprint to spawn the shield at the start of the animation. To manage the despawning, we added another Anim Notify at the end of the montage to ensure proper timing. After slowing the animation a bit more, we successfully got it working.

This is the shield whenever it's spawned. The animation is played and that's when it's triggered. This attack, negate damage, only triggers once the enemy's health is low enough and the player is a certain distance to the enemy. The shield cannot be shot through, and the enemy cannot take damage inside of this shield.  

This is the anim notify to activate the turtle shield, spawning it around the turtle boss, sized up to accommodate the size of the turtle boss.


This is the anim notify to despawn the shield from the turtle boss.

Whenever the anim notify for the despawn/deactivate shield is called, it destroys the actor thus looking like this once the animation is completed.


Get SpellStorm

Leave a comment

Log in with itch.io to leave a comment.