Designing AI State Switching | Tech Discussion


When trying to implement strafing for the AI I was having great difficulty with making the enemy change behavior. The enemy character would not switch from his pursue state to his strafe state. After debugging I even concluded the blackboard variables in charge of the switch were changing it was just not registering in the tree. 

After doing some more research and debugging I came to a new solution for the issue. I decided instead of branching in the behavior tree, I would branch under the find player location task. In this task I would branch based on the distance between the enemy and player compared to its range to switch behavior. This switch worked great and I was able to create proper swapping between enemy strafe and pursuit movement and it could switch between the two. This also allowed for easy implementation of an attack from the enemy by branching when the enemy is strafing.

Author: Dominic Taylor-Axtell

Get Mythicism

Leave a comment

Log in with itch.io to leave a comment.