Crate beet_flow

Source
Expand description

§beet_flow

Beet Flow is an ECS control flow library, built with Bevy Observers. Being ECS first gives Beet a high level of flexibility and modularity.

Currently implemented paradigms:

§Hello World

A demonstration of a Sequence control flow common in behavior trees

Using BeetDebugPlugin will log the name of each action as it is triggered.

use bevy::prelude::*;
use beet_flow::prelude::*;

let mut app = App::new();
app
	.add_plugins((
		BeetFlowPlugin::default(),
		BeetDebugPlugin::default()
	))
	.world_mut()
  .spawn((
		Name::new("My Behavior"), 
		Sequence
	))
		.with_child((
			Name::new("Hello"),
			ReturnWith(RunResult::Success),
		))
		.with_child((
			Name::new("World"),
			ReturnWith(RunResult::Success),
		))
		.trigger(OnRun::local());
app.world_mut().flush();

§TODO

  • When we get OnMutate observers, they should probably replace most OnInsert observers we’re using

Modules§

continue_run
A module for long running actions. The core of long running actions in Beet is systems that filter by the Running component.
control_flow
The core functionality of beet_flow, this module primarily handles routing OnRun and OnResult between each ActionEntity and any corresponding ActionObserver.
control_flow_actions
A collection of built-in actions for controlling the flow of a tree. If you think that a missing action should be built-in, please open an issue.
prelude
Include the kitchen sink for beet_flow.
tree
Some generic tree structures and common operations, currently only used for testing the shape of entity trees.

Structs§

BeetFlowPlugin
All plugins required for a beet_flow application. The primary role that this plugin plays is as a kind of observer router, ensuring the OnRun and OnResult events are propagated correctly.

Enums§

ActionTag
Actions can take many forms, these tags help categorize them. The convention is to add these in a list just after the description of the action, and before the example: