mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 16:36:57 +08:00
``` Package Name Current Version Updated Version Update Reason flame 1.30.0 1.30.1 manual versioning flame_lint 1.4.0 1.4.1 manual versioning jenny 1.4.0 1.5.0 manual versioning flame_behavior_tree 0.1.3+13 0.1.3+14 dependency was updated flame_test 2.0.0 2.0.1 dependency was updated flame_tiled 3.0.4 3.0.5 dependency was updated flame_oxygen 0.2.3+13 0.2.3+14 dependency was updated flame_isolate 0.6.2+13 0.6.2+14 dependency was updated flame_texturepacker 4.4.0 4.4.1 dependency was updated flame_sprite_fusion 0.2.0 0.2.0+1 dependency was updated flame_fire_atlas 1.8.8 1.8.9 dependency was updated flame_audio 2.11.7 2.11.8 dependency was updated flame_spine 0.2.2+13 0.2.2+14 dependency was updated flame_bloc 1.12.14 1.12.15 dependency was updated flame_kenney_xml 0.1.1+13 0.1.1+14 dependency was updated flame_lottie 0.4.2+13 0.4.2+14 dependency was updated flame_markdown 0.2.4+6 0.2.4+7 dependency was updated flame_console 0.1.2+9 0.1.2+10 dependency was updated flame_rive 1.10.16 1.10.17 dependency was updated flame_forge2d 0.19.0+3 0.19.0+4 dependency was updated flame_noise 0.3.2+13 0.3.2+14 dependency was updated flame_riverpod 5.4.16 5.4.17 dependency was updated flame_svg 1.11.13 1.11.14 dependency was updated flame_network_assets 0.3.3+13 0.3.3+14 dependency was updated flame_3d 0.1.0-dev.13 0.1.0-dev.14 dependency was updated ```
This package provides a simple and easy to use behavior tree API in pure dart.
Behavior tree is a very common way of implementing AI behavior in game and robotics. Using this, you can break-down a complex behavior of an in game AI, into multiple smaller nodes.
Features
- Nodes
- Composite
- Sequence: Continues execution until one of the children fails.
- Selector: Continues execution until one of the children succeeds.
- Decorator
- Inverter: Flips the status of the child node.
- Limiter: Limits the number of ticks for child node.
- Task
- Task: Executes a given callback when ticked.
- AsyncTask: Executes an async callback when ticked.
- Condition: Checks a condition when ticked.
- Composite
Getting started
Add this package to your dart project using,
dart pub add behavior_tree
Usage
- Create a behavior tree.
final treeRoot = Sequence(
children: [
Condition(() => isHungry),
Task(() => goToShop()),
Task(() => buyFood()),
Task(() => goToHome()),
Task(() => eatFood()),
]
);
- Tick the root node to update the tree.
final treeRoot = ...;
treeRoot.tick();