Skip to main content
edited title
Link
Kromster
  • 10.7k
  • 4
  • 55
  • 67

Scheduler for EvnentEvent Driven Behaviour Tree

Source Link
Ralph
  • 23
  • 3

Scheduler for Evnent Driven Behaviour Tree

The Behaviour Tree Starter Kit (BTSK) on GameAI Pro suggests using a scheduler for an event driven behaviour tree.

To recap: A behaviour tree (BT) is traversed fully every time the root node is ticked which could be as often as every frame, whereas an event-driven BT (EDBT) is only traversed when an event happens, such as finishing a task or a change on the blackboard.

Specifically the BTSK mentions

simply to find previously active behaviors, why not maintain them in a list (of size one or more) for fast access? You can think of this list as a scheduler that keeps active behaviors and ticks the ones that need updating.

I am not sure what such a scheduler would look like and which nodes we would actually queue

Assume a tree like this one, where single letters just denote some tasks that may return "running" states and numbers represent conditionals that just return success or failure.

selector (root)
├── sequence
│   ├── 1
│   └── B
├── sequence
│   ├── 2
│   └── D
└── F

Before the first frame the scheduler is empty, what does it look like after the first traversal?