Devlog #2: Picking Up the Pace


Introduction

Welcome to another devlog entry. This one will cover my progress on the game between weeks 5-8 of the term. All in all, it was a productive period. I did lose about a week due to an unfortunate wedding I had to attend. Family weddings. What are you going to do? 

Progress Update

I found a nifty asset for a raptor on Sketchfab that came with plenty of nice animations. I decided to apply it to the base enemy blueprint for testing purposes. I created the blendspace for its idle, walking, and running animations and created the corresponding animation blueprint for it. Within the animation blueprint, I created a state machine, in case I wanted different states further down the line. 

Next up, was to implement a patrol state for the enemy AI. I initially was going to give it a patrol path, but since I wanted to give the game a little bit more of an open-world feeling, I ultimately decided to use a function that would allow a random patrol. 

Essentially, the AI moves to a random reachable point in a given radius, moves there, and waits a period, then moves to another random reachable point. The delay time is also pseudo-random. I used a ‘random float in range’ node and promoted the min and max range to variables, to make it modular and change it later on depending on the enemy type. 

Next, I implemented a simplistic attack state for the AI. I created a custom event that plays an attack montage, then I made a task in the behavior tree that plays the montage. I also created a ‘Focus Target’ task, so that the enemy looked at the target. This improved immersion. 

I then created the idle (wandering) and attacking states within the AI controller, with no way of switching states. So I just used a simple keyboard event to test the state switching. It worked.

I found a good amount of free animal assets on the Epic store, all of which came with animations. Score. I decided these would be the other enemy types within the game. 

I incorporated the health system that another team member had created into my base enemy along with a text renderer that displayed health above the enemy’s head. 

It did in fact work, and the enemy took damage from the dagger that we had created. The only issue after that was that the health amount would drop below 0 and keep going down whenever the enemy was hit.

I then gave the enemy perception. Specifically sight, hearing, and damage. So I could finally have it switch states by itself. If the AI can sense the actor on perception update, it will switch state to attack. 

Challenges

In terms of AI, there weren’t all too many challenges during this period. I had previously done most of this stuff with AI in the last term so, implementing this into the game wasn’t too difficult.

I did however abandon modeling the sugar glider. My plate was rather full with the enemy AI, and I didn’t think it was feasible to learn to texture, as I hadn’t done it before as well as rigging and animating. So, I decided to use a crow asset that I found in the Epic store.

Furthermore, I realized the limitations of using random patrol. While it does provide an open-world aspect. They may just wander to some random location on the map and once the game is built the player might not even encounter the AI that I am working so hard on. But alas, the damage is done. I’m committing to the random patrol. Maybe I’ll set up some boundaries to keep the AI in a particular location. 

Upcoming Goals

  • Finish up the AI
  • Complete the health system
  • Make a boss AI
  • Make the HUD

Leave a comment

Log in with itch.io to leave a comment.