Working Arena Mode

This week have been good. I got plenty of work on the second enemy and it is all but implemented now. I also implemented a system for spawning enemies in a wave form with the order and types of enemies dictated by a pre-determined list of variables. Sadly a somewhat crude way.

The second enemy works similarly to the first which finds a player and runs towards it to attack. If no player can be spotted, it instead finds an instance of a custom blueprint named AINode to run towards. The difference between the first enemy and the new one is that the new enemy will use a ranged attack rather than only hitting the player. If this was the only thing about the enemy it could have used a almost identical BehaviourTree with a bigger distance to the player which it began attacking from. However the AI is also meant to run away from the player if they get too close, and unlike running towards a target, there is no predefined Task for an AI to run Away from a target. Instead i had to make a function for setting a target point in a direction away from the player. This in turn required a Decorator for checking if there was a point, and then a Task for moving to that point.

All this ended up being roughly twice the amount of work i had put into making the ghoul because of the different cases and the need to abort certain functions to make sure the AI worked in all situations. While having to spent that much time on making it work, i feel like i developed a deeper understanding of how Behaviour Trees work in Unreal Engine.

BT Simm

The Behaviour Tree of the new enemy. The enemy will be a snake-like thing called Simm which spits poison at the player.