def-behavior-tree - a library for creating behavioral trees that allow you to easily manage advanced NPC behaviors in your game.
It’s functional and event-driven, which means that the next nodes are activated only when the previous one returns success or false.
It also have ability to run any node from any moment, so you can easily save active node ID and run it when game load for example.
Library Github → s-kania/def-behavior-tree: Behavior tree library for Defold engine (github.com)
More about BT trees → Behavior trees for AI: How they work (gamedeveloper.com)
Implemented nodes
- Composite
- Sequence
- Selector
- Random
- RandomWithChances
- Decorator
- AlwaysFailDecorator
- AlwaysSucceedDecorator
- ChanceDecorator
- InvertDecorator
- RepeatUntilFailDecorator
- Task (basic node)
Video
It shows Roids example, but with AI steering instead of player input:
Let me know what you think, especially if you start using this library