public struct BehaviorNodeOne node of a compiled tree: where it sits, what it is, and where its state lives.
Remarks
Its index is its priority. Nodes are laid out depth-first in pre-order, so node 4 outranks node 9 because it is earlier in the walk — which is exactly what "left to right, top to bottom" means to the person who drew the tree. There is no priority field, and therefore no way for the two to disagree.
And a subtree is a contiguous range. LastDescendant makes "is X inside Y's subtree" two comparisons rather than a walk, which is what makes the abort test in doc 37 § D6 affordable at a thousand agents.
Fields and properties (17)
public Symbol NameWhat it is called. For diagnostics and the editor; nothing in a step reads it.
public BehaviorNodeKind KindComposite or task.
public BehaviorCompositeKind CompositeHow it walks its children, when it is a composite.
public ushort ActionWhat it runs, when it is a task. An index into the agent's action registry.
public ParallelFinishMode FinishModeWhat a Parallel does when its main task ends.
public int ParentIts parent's index, or -1 for the root.
public int FirstChildIts first child's index, or -1.
public int ChildCountHow many children it has.
public int LastDescendantThe highest index in its subtree — itself, when it is a leaf.
public int DecoratorStartWhere its decorators start in the template's decorator table.
public int DecoratorCountHow many decorators are attached to it.
public int ServiceStartWhere its services start in the template's service table.
public int ServiceCountHow many services are attached to it.
public int MemoryOffsetWhere its state starts in an agent's memory block.
public int MemorySizeHow many bytes of that block are its own.
public float WeightIts share of a RandomSelector's draw.
public int NestedSlotWhich nested-instance slot it owns, when it runs a tree named by a key.
Used by (11)
- AiBreakpointsVixen.Ai
- AiSnapshotsVixen.Ai
- AiSystemTreeTestsVixen.Ai.Tests
- AuthorableNodeTestsVixen.Ai.Tests
- BehaviorTreeAbortOrderingTestsVixen.Ai.Tests
- BehaviorTreeCompilerTestsVixen.Ai.Tests
- BehaviorTreeDeterminismTestsVixen.Ai.Tests
- BehaviorTreeInstanceVixen.Ai
- BehaviorTreeTemplateVixen.Ai
- CompileStateVixen.Ai
- TreeHarnessVixen.Ai.Tests