NPBehave – Event Driven Code Based Behaviour Trees


If you’re a programmer, this behavior tree library is for you: it is lightweight & simple,


by Nilspferd


★★★★★ star rating
Price History +

If you're a programmer, this behavior tree library is for you: it is lightweight & simple, fast & eventdriven and flexible & easily extendable.

lightweight & simple: Instead of heavy visual editing, in NPBehave you define the behavior tree exactly where you put the rest of your AI logic: in the code! Checkout the Hello World Example
fast & event driven: Instead of traversing the tree every frame, NPBehave builds on a event driven approach. This means that traversal of your behavior tree will only continue when there is actually need to. You do this by a combination of using service decorators and blackboard conditions. Checkout the Hello Blackboard Example
flexible & easily extendable: Depending on the complexity of your AI, you may decide for up to medium sized AI to just use the provided nodes which embrace using lambdas or delegates. For more complex AI you may decide to extend your Tasks or Decorators including Services from the base classes to keep the structure uncluttered from the actual task logic. Checkout the Swarm AI Example with Lambdas and Delegates

In NPBehave you will find most node types from traditional behavior trees, but also some similar very specific ones for dealing with the event driven behavior. It's highly recommended that you read through the README before diving in.

NPBehave is open source and published under MIT License. If you want to participate, the source code can be found ojn GitHub.