Wave Based Spawning and Spawner Management


by Jordan Rarrat

Part 1: The Problem

This week, one of my main tasks was refining enemy AI behavior. I decided on using Set Focus from AIController so that the enemy can consistently stay locked onto the closest player however my enemies could not focus and stayed idle.

Part 2: The Solution

I fixed that issue by writing a service node in the behavior tree that runs every tick. this service iterates through all player actors in the world, calculates the distance to each from the enemy and sets the blackboard key to the nearest target. Once the blackboard had the right player assigned, I updated the AI Controller to use SetFocus() on that blackboard value. With this in place enemies now correctly identify and pursue the closest player in real time.

Leave a comment

Log in with itch.io to leave a comment.