Behavior Tree Experiments
As I dig back into my main project one of the upcoming things on my to do list that has been bugging me has been getting the enemies working in a fun and compelling way. Something where they feel smart enough to be challenging to take on.
Usually the way I've always done enemies is through finite state machines which is a pretty fancy term that you shouldn't look up on Wikipedia unless you're going to become incredibly confused. Basically a finite state machine can be used to separate an enemy's behaviors into a bunch of different distinct states. A state can then link itself to other states. So an enemy might have attack, confused, hurt, or defeated states, and depending on what's happening in the game it will switch between them to act on things.
A behavior tree is way more fancy than that and apparently is more powerful in a lot of ways. Ways that I'm not sure that I understand yet, and ways that I've been trying to figure out over the past however long I've actually been working on this game.
I've started putting together a quick behavior tree library that covers the basics that I learned from this article here. For now I'm calling it Kodo and you can check out the full source on BitBucket. I'm not sure how well it works at all, so be warned. Currently I'm using it for some tests using Otter, and so far it seems like things are working but I haven't stepped into the realm of incredibly complicated trees yet.
One of the toughest things for me right now is understand how exactly I'm supposed to be building behavior trees. Finite state machines have always been easier for me to implement, and understand, and going from that to behavior trees has left me completely clueless for the most part, but everywhere I go on the internet assures me that behavior trees are ultimately worth it in the end!
Usually the way I've always done enemies is through finite state machines which is a pretty fancy term that you shouldn't look up on Wikipedia unless you're going to become incredibly confused. Basically a finite state machine can be used to separate an enemy's behaviors into a bunch of different distinct states. A state can then link itself to other states. So an enemy might have attack, confused, hurt, or defeated states, and depending on what's happening in the game it will switch between them to act on things.
A behavior tree is way more fancy than that and apparently is more powerful in a lot of ways. Ways that I'm not sure that I understand yet, and ways that I've been trying to figure out over the past however long I've actually been working on this game.
I've started putting together a quick behavior tree library that covers the basics that I learned from this article here. For now I'm calling it Kodo and you can check out the full source on BitBucket. I'm not sure how well it works at all, so be warned. Currently I'm using it for some tests using Otter, and so far it seems like things are working but I haven't stepped into the realm of incredibly complicated trees yet.
One of the toughest things for me right now is understand how exactly I'm supposed to be building behavior trees. Finite state machines have always been easier for me to implement, and understand, and going from that to behavior trees has left me completely clueless for the most part, but everywhere I go on the internet assures me that behavior trees are ultimately worth it in the end!
Comments
Post your comment!