New Enemy and Small Adjustments


Jamari Williams - March 17th, 2023

This week,  I adjusted how the skeleton shoots arrows and I created a new enemy, the Missile Turtle.     

The first thing I did was rework how the skeleton shoots arrows when he is possessed. Last week, I made it so that whenever you hold left click, a reticle appears automatically. I changed it so that only when you hold left click will the reticle appear. Since both mouse buttons are in use, I made Q responsible for switching between normal arrows and fire arrows. I think this way makes sense because it more closely resembles first-person shooters, which lots of people already have experience with. 

After that, I started working on a new enemy, the Missile Turtle. This was my first experience with using AI and Behavior Trees in Unreal Engine 4. I couldn’t find an appropriate asset with animations yet, so I just used one from a pack we already have in the project. 

The premise of this enemy is that he shoots missiles at the player and tries to keep its distance. It shoots five homing missiles, then runs in the opposite direction of the player. It will be vulnerable whenever it’s shooting, but then become invincible when it’s running away. The idea is that it will hide in its shell while running away. 

I did face a few issues while making the Missile Turtle. The first challenge I faced was where to put everything. With AI in Unreal Engine, you need a Behavior Tree, a Character to run it, multiple different tasks to run, and an AI controller. With so many different files, I was trying to keep things properly encapsulated so that some variables wouldn’t affect the possession. It took some planning, but I did figure it out. 

I also had a bit of a challenge with the missile’s initial locations. I wanted all of the missiles to spawn from the same location but sit in an evenly spaced arc above the turtle before chasing the player. I ultimately created a function in the Missile Turtle called MissileFirstLocation. While keeping track of which missile is about to spawn, I divide that index over the max missiles spawned to get an alpha value. I then lerp between -45 and 45 to get the appropriate angle, rotate and scale the missile’s up vector, then add it to the spawn location to get my final result. The missiles are set to move forward

Along with the new enemy, I made minor adjustments, such as fixing a bug where the Ghoul doesn't damage the player sometimes and the boss health bar not updating. I also created a controls menu, and lowered the Slime's walk speed when attacking, because it was easy to just swing your sword and walk backward without ever getting hit. With the turtle itself, I had an issue where if you keep running away from the missiles, the turtle will keep going through its behavior tree and spawning missiles. Next week, I plan to make a ProjectileManager component to limit how many projectiles an enemy can have out at a time. There are still issues with it, but I’m happy with the base functionality I have with the missile turtle. 

Leave a comment

Log in with itch.io to leave a comment.