Check out the
About
I recently found the opportunity to use and improve the behaviour tree system I made for the SFAS contest.
I identified some pain points when using it initially, but with the time restrictions of the competition, I didn’t really have the time to solve them.
Improvements
Here are some of the improvements I made:
- Decoupling
- Behaviour trees previously made using my framework had nodes that were heavily coupled to the entity they were controlling.
- I wanted to alleviate that using a better blackboarding system, and stripping out the node class from the behaviour tree class.
- This would help me make more modular nodes, which could be re-used across different game entities.
- Smart Pointers
- Nodes now use shared pointers so the tree will naturally de-allocate the nodes sequentially upon delete.
- I re-use some nodes in my example behaviour tree, but as long as I don’t create cycles, it should de-allocate just fine.
- Vectors instead of lists
- Initial implementation used lists instead of vectors. For composite nodes with only leaf nodes, there would be a performance benefit to traversing vectors instead. So I swapped out lists for vectors.
How To Use
This was used in a different project, so it has references to a GameEntity
which is not in the folder. Please swap these references out with your own AI/actor base class if you intend to use it.
For examples on it is used, see:
/ExampleBTs/
for example behaviour trees./TaskNodes/
for example node services and actions.