Vixen
c7401864
csharp
public static class BehaviorTreeCompiler

Turns an authored tree into the flat, immutable thing a thousand agents share.

Read the guide page for this →

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)

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