Neon Trigger Devlog #3 - Player and AI Controllers


Hey everyone, welcome to our third Devlog for 'Neon Trigger'. My name is Thomas, and I am the lead Gameplay Programmer in our team. Today, I will go through how I implemented some more human like behavior into our AI through a Fear Controller and Cover Controller. While this makes the AI decision making quite a bit more complex, making it work adds a ton of variability and more enjoyable gameplay. 

While both the Fear Controller and the Cover Controller are managed through the AI Controller, each holds a unique value in producing enemy behavior. First let's run through the Fear Controller. 

Each enemy is assigned a baseline fear level, ranging from 0 to 100. This fear level will directly influence how the AI reacts in combat making enemies more prone to either charge or retreat when fighting. Fear is also dynamic and changes in response to certain combat events. Taking damage will increase fear, based on the amount of damage received, while dealing damage decreases fear based on damage done. This system leads to one of three potential behaviors, the general attacking behavior when fear is closer to 50, retreating, and charging.

When an enemy takes a hit, this increases their fear then runs a probability check based on their new fear level to determine if they should retreat to cover.

 

On the other side, if the enemy hits their target, fear drops, then runs a probability check to determine if they should charge their target. 


When either of these has not been called but the target is in sight, the general attack state will remain on as the middle ground between charging and retreating for cover. 

Now that the Fear Controller has been covered, we can move on to the Cover Controller. The Cover Controller operates using a series of strategically placed cover transforms. These transforms represent potential cover spots behind walls or other environmental objects. When an enemy decides to retreat (as triggered by the Fear Controller through the AI Controller), the Cover Controller is then called upon. It scans all available cover points within range of the enemy's current position. To ensure this spot is useful, a raycast is fired from the cover point toward the enemy's current target. This check determines whether the spot provides effective cover, meaning it must block line of sight from the attackers prospective. 

Only spots that pass this visibility test are considered valid. Once a spot is considered valid, the path length to the cover transform must be calculated. 


These functions will then determine the best cover transform for the enemy to retreat to. 

Allowing for the enemy to move to actual retreat points will lengthen time to kill and make it more rewarding to kill enemies. This will also cause more movement throughout the scene tying into our more chaotic environment we are trying to create with an arena shooter. 

So far I love the direction that this project is heading as the gameplay seems unique and fun while also being attainable in the short time span we have to create this project and I'm super excited to see how this game turns out. Thanks for reading our third Devlog update!

Leave a comment

Log in with itch.io to leave a comment.