public static class BehaviorTreeCompilerTurns an authored tree into the flat, immutable thing a thousand agents share.
Remarks
The whole of the layout decision lives here: nodes are written out depth-first in pre-order, so an index is a priority; each one records its LastDescendant, so a subtree is a contiguous range and the abort test is two comparisons; and every node, decorator and service is assigned a byte range in one block whose total size is known before a single agent exists.
⚠ A static subtree is spliced, not referenced. Splicing is what keeps pre-order equal to priority across the boundary, so a decorator in the parent tree can abort a branch inside the child and the range test still means something. The cost is that a subtree used in four places is compiled four times, which is bytes rather than behaviour, and a cycle is refused by name rather than by stack overflow.
Methods (2)
public static bool TryCompile(BehaviorTreeAsset asset, AgentActionRegistry actions, BlackboardLayout layout, out IReadOnlyList<BehaviorTreeDiagnostic> diagnostics, out BehaviorTreeTemplate? template)Compiles a tree.
public static BehaviorTreeTemplate Compile(BehaviorTreeAsset asset, AgentActionRegistry actions, BlackboardLayout layout)Compiles a tree, and refuses to carry on if it will not.
Used by (15)
- AiSnapshotTestsVixen.Ai.Tests
- AiSystemTreeTestsVixen.Ai.Tests
- BehaviorTreeCompilerTestsVixen.Ai.Tests
- BehaviorTreeContentCompilerVixen.Ai
- BehaviorTreeCostTestsVixen.Ai.Tests
- BehaviorTreeDeterminismTestsVixen.Ai.Tests
- BehaviorTreeServiceTestsVixen.Ai.Tests
- BehaviorTreeTaskTestsVixen.Ai.Tests
- FleetVixen.Ai.Tests
- RunQueryNodeTestsVixen.Ai.Nodes.Tests
- TreeHarnessVixen.Ai.Tests
- VillageVixen.Ai.Nodes.Tests
- AgentFixtureVixen.Editor.AssetEditors.Tests
- BehaviorTreeDocumentVixen.Editor.AssetEditors
- BehaviorTreeImporterVixen.Editor.Assets