Behavior Trees


Behavior trees:

This time around, we have AI trying to patrol paths, attack the player, and investigate sounds!

In this video, we can see the AI doing just that. When the player places down a carrot, the enemies are drawn to the sound, allowing a clean escape to the goal: another carrot.

At the end, we have the player being chased by the enemies.

These are all from behavior tree branches, one for each type of behavior - patrolling, investigating, and attacking the player. 

Some issues included:

AI not moving when the player was spotted or heard.

The solution to this was, of course, a disconnected node. The behavior was being set to Waiting, rather than the behavior needed for the branches.

AI not patrolling the set route.

This one I couldn't find the solution for! I originally made a more complicated map with a third enemy, but they all wanted to walk into the wall for some reason. I expanded the map back to where it was, and lo and behold, they were trying to go to one specific area of the map light-years away from their supposed patrol points. 

I ended up just moving the map to them. You win, enemy behavior tree. You win.

I had several issues with this project, but I'm glad it was able to work!

Get Game Design 3 Project

Leave a comment

Log in with itch.io to leave a comment.