Skip to content
Bit Quirky Behavior Trees and
State Machines

Search documentation

All topics and APIs

Close returns focus to Search.

What are you looking for?

Try a common topic or enter a complete API identifier.

Browse the reference instead

Esc closes · Tab reaches results · Enter opens the focused link

v0.6.0
Menu

BitQuirky.Behavior.Nodes.Composite

Public behavior trees and state machines: runtime symbols in BitQuirky.Behavior.Nodes.Composite.

Source snapshot ad0983d00d77.

Assembly: BitQuirky.Behavior.Runtime

Category: Node contracts

C#
class BitQuirky.Behavior.Nodes.Composite.Parallel

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:63-164

Behavior-tree Parallel composite. Ticks every child once per tick (subject to the policy short-circuit). Returns Runningwhile any child is still running; returnsSuccess/ Failureper the configured ParallelPolicy.

Responsibilities:

  • Encode the parallel aggregation rule for the runtime tick job and bake-time validation.
  • Provide the baked / token identity for cross-layer correspondence.

Does NOT:

  • Manage child threading: children tick on the same job thread the composite ticks on; “parallel” is logical (BT semantics), not OS-level concurrency.

C#
public const BitQuirky.Behavior.Baked.BakedNodeKind Kind = Parallel

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:70

Baked node kind a parallel bakes to.

C#
public const string NodeKindToken = "parallel"

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:66-67

Kind token a parallel carries in authored graph source.

Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)

Section titled “Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)”
C#
public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(BitQuirky.Behavior.Nodes.BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:127-163

Folds one child’s status into the composite’s status for hosts that walk children one at a time instead of collecting a whole tick’s counts. A succeeding child advances to the next sibling and reports Running until the last child succeeds; a running child is re-ticked; any terminal status ends the composite and is passed through unchanged, and an unrecognized status ends it as Failure.nextChildIndexis the child index to tick next, or -1 when the composite finished this tick.

Aggregate(int successCount, int failureCount, int runningCount, int totalChildren, ParallelPolicy policy)

Section titled “Aggregate(int successCount, int failureCount, int runningCount, int totalChildren, ParallelPolicy policy)”
C#
public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(int successCount, int failureCount, int runningCount, int totalChildren, BitQuirky.Behavior.Nodes.Composite.ParallelPolicy policy)

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:80-117

Aggregate the per-tick child status set into a composite status.

Parameters

  • successCount: Children that returned Success this tick.
  • failureCount: Children that returned Failure / Blocked this tick.
  • runningCount: Children that returned Running this tick.
  • totalChildren: Total number of children.
  • policy: Termination policy.

Category: Node contracts

C#
enum BitQuirky.Behavior.Nodes.Composite.ParallelPolicy

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:29-42

Underlying type: byte

Parallel termination policies. The behavior source declares the policy as a per-node layout entry (not yet wired into the .bqbehavior metadata block; defaults toRequireAllfor now).

C#
RequireAll = 0

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:35

Composite succeeds only when every child succeeds; fails as soon as any child fails. Default.

C#
RequireOne = 1

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:41

Composite succeeds as soon as any child succeeds; fails only when every child has failed.

Category: Node contracts

C#
class BitQuirky.Behavior.Nodes.Composite.Selector

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:42-107

Behavior-tree Selector (“priority OR”). Ticks children left-to-right; short-circuits on the first child to return Success; falls through to Failureonly when every child has failed.

Responsibilities:

  • Encode the canonical Selector aggregation rule for the runtime tick job and bake-time validation.
  • Provide the baked / token identity for cross-layer correspondence.

Does NOT:

  • Hold per-instance state: runtime cursor lives on the per-follower BehaviorRuntimeInstance.
  • Allocate managed memory (Burst-callable).

C#
public const BitQuirky.Behavior.Baked.BakedNodeKind Kind = Selector

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:52

Baked node kind a selector bakes to.

C#
public const string NodeKindToken = "selector"

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:48-49

Mermaid:::<token>suffix identifying this node type. Mirrored byMermaidBehaviorSourceReader.

Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)

Section titled “Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)”
C#
public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(BitQuirky.Behavior.Nodes.BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:67-106

Aggregation rule. Given the latest child’s status and the composite’s child cursor, decide whether to short-circuit (the selector itself is done) and which child the next tick should run.

ReturnsRunningwhen more children remain to try; setsnextChildIndex to the next child slot. Returns Successon the first child success orFailurewhen the cursor walked off the end.

Category: Node contracts

C#
class BitQuirky.Behavior.Nodes.Composite.Sequence

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:41-98

Behavior-tree Sequence (“priority AND”). Ticks children left-to-right; short-circuits on the first child to return Failure; falls through to Successonly when every child has succeeded.

Responsibilities:

  • Encode the canonical Sequence aggregation rule for the runtime tick job and bake-time validation.
  • Provide the baked / token identity for cross-layer correspondence.

Does NOT:

  • Hold per-instance state.
  • Allocate managed memory (Burst-callable).

C#
public const BitQuirky.Behavior.Baked.BakedNodeKind Kind = Sequence

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:48

Baked node kind a sequence bakes to.

C#
public const string NodeKindToken = "sequence"

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:44-45

Kind token a sequence carries in authored graph source.

Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)

Section titled “Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)”
C#
public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(BitQuirky.Behavior.Nodes.BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)

Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:58-97

Folds the status one child just returned into the composite’s status and names the child to tick next. A succeeding child advances to the next sibling and reports Running until the last child succeeds; a running child is re-ticked; any other status ends the composite and is passed through unchanged, and an unrecognized status ends it as Failure.nextChildIndexis the child index to tick next, or -1 when the composite finished this tick.

Source fingerprint: sha256:ad0983d00d773d882bc61865e18d8c5559e009d181e5891575cd7f262515b23e

Full-size image