[5SD037] Behaviour Trees

So in this blog post I will write about my latest work. Lately I have mostly been working on artificial intelligence. For this project I chose BTs (Short for Behaviour Trees), because they are popular and I think it something every programmer should know. Whether you are a gameplay or artificial intelligence programmer. I first spent a lot of time researching and trying to find a good and cheap library/framework implementation of BTs by someone else. However I came to the conclusion it is better I do by myself. So I spent about one week doing a simple behaviour tree library. But I ended up with problems using it together or pathfinding system and looping through the tree properly. And a few other weird edge cases. So I ended up writting a simpler ai using FSM (Short for Finite State Machine). And I would recommend this article if you would like to implement your own version, it helped me a lot!

This is the Process method from my behaviour tree root node.

 

About Alexander Pihl

2015 Programming