PoBDSDocs
简体中文v1.0.0
POBDS / 03

Why BDS: layered decision-making

Compare flow graphs and behavior trees, and see how focused decision layers decompose complexity under one parent objective.

Split a complex problem into focused decision layers

BDS is more than assigning scores to conditions. The top layer decides the current objective, intermediate layers choose tactics, and leaf flow graphs perform concrete operations. Each layer owns a smaller question while the parent remains in control of the overall behavior.

Acquire delegates to Combat; Combat delegates to Defense; Defense chooses a concrete response. · Click to view full image

These are not unrelated brains writing movement commands concurrently. Execution follows a parent-authorized branch. Active ancestor BDS instances continue evaluating while the leaf Actions run, so a higher-level decision can replace the appropriate descendant branch.

Compare the authoring models

ConcernPlain flow / FSMTypical behavior treeLayered BDS + flow
OrganizationSequences, branches and event transitions.Composites, conditions and subtrees.BDS decomposes decisions; flow graphs describe execution.
SelectionExplicit conditions on branches and transitions.Selectors usually try ordered alternatives; score-based extensions are possible.Gates establish eligibility; scores express local preference.
Changing complex rulesMaintain growing transition and branch relationships.Manage traversal, running status and abort policies across subtrees.Add candidates within the relevant layer without pairwise transitions between every behavior.
Long-running behaviorAdd polling, events or supervisory logic.Reactive trees and observer aborts can respond continuously.Separate decision and execution updates; active decision layers keep scoring.
SwitchingHandle transitions and cleanup explicitly.Follow composite/decorator/abort semantics.Distinguish leader from executor; wait for completion or preempt and exit descendants.
Action detailStrong at explicit procedures and calls.Leaf tasks implement operations.Keep procedural flow, concurrent Actions, lifecycle, arguments and return values.

Decompose one shooting problem

  1. Objective: should we engage?

    Acquire asks whether a living target is within 15m. It delegates combat or selects patrol without caring about firing cadence.

  2. Tactic: attack or survive?

    Combat chooses approach-and-fire or delegates to Defense according to health and context.

  3. Response: how should we survive now?

    Defense compares incoming threats, available packs and retreat alternatives.

  4. Operation: perform the behavior

    Flow graphs execute movement, concurrent firing, waits, member access and child calls through persistent Actions.

If the target leaves search range during healing, Acquire can replace Combat → Defense → Heal with Patrol. A local bullet threat can instead replace Heal with Evade within Defense, preserving the parent objective.

Practical advantages

  • Keep changes local to perception, tactics or action layers instead of growing cross-layer wires.
  • Continue thinking without constantly restarting Actions: normal candidates wait; critical eligible candidates preempt.
  • Reuse Actions, complex flow procedures, Abilities and whole child decision strategies at different scales.
  • Explain gate failure, losing scores, a waiting leader and actual execution separately.
  • Let programmers expose capabilities while designers compose behavior instead of hiding everything in one large custom Action.

When it fits, and what it costs

A small fixed procedure is often simpler as a plain flow. Ordered hierarchical tasks can fit a behavior tree well. BDS is useful when many alternatives compete under changing context and long-running behaviors need supervision.

Scores, eligibility and interruption policy still require design. Continuous evaluation has a cost: throttle or cache expensive sensing, and avoid score oscillation that causes constant interruption. Layered brains do not imply unlimited parallel work, automatic multithreading or complete network lockstep.

References

PlayMaker: States · Unity Behavior: Behavior graphs. PoBDS-specific behavior follows this repository’s implementation.

Combine keywords with / · Enter opens first result · Esc closes