Vixen
c7401864
csharp
public sealed class Blackboard

One agent's data: a byte range over a compiled BlackboardLayout, a bit per key saying whether it has been set, a version per key, and the observers watching each one.

Read the guide page for this →

Remarks

A read is a span slice and a write is a store. There is no hashing, no boxing and no allocation once the instance exists — a thousand agents on one layout is a thousand small arrays, sized at load and never resized.

⚠ A key is set or unset independently of its value. "Is Set" is the single commonest decorator in every behaviour-tree implementation there is, and Null, 0 and Zero are all legal values somebody means. So the set-ness is a bit in a mask beside the values, and Clear is a write like any other — it bumps the version and notifies.

Both a version and an observer list, because they answer different questions. Observers drive aborts: a decorator that must interrupt a running branch cannot poll. Versions drive everything that only wants to recompute when something moved — a service on an interval, a cached path, a scorer — and they let it answer "has this changed since I last looked" without keeping a copy of the value.

⚠ A version bumps only when the value actually changes. Writing the same number is not a change, and treating it as one would make every service that writes its result every tick abort every decorator observing it, for ever. That is the difference between an event-driven tree and a tree that ticks itself to death.

One agent owns one blackboard. That is what makes a tree step parallelisable over chunks — a step touches this agent's memory and this agent's board and nothing else. Data two agents share is a SharedBlackboard, which is a distinct type precisely so that sharing is a decision somebody made rather than something that happened.

Fields and properties (2)

  • public BlackboardLayout Layout

    The shape this is an instance of.

  • public uint Version

    How many times anything on this board has changed.

Methods (21)

Used by (69, showing 40)

  • AgentContextVixen.Ai
  • AgentTargetVixen.Ai.Nodes
  • AiSnapshotTestsVixen.Ai.Tests
  • AiSnapshotsVixen.Ai
  • AiSystemVixen.Ai
  • AiSystemTestsVixen.Ai.Tests
  • BehaviorContextVixen.Ai
  • BehaviorTreeAbortOrderingTestsVixen.Ai.Tests
  • BehaviorTreeAbortTestsVixen.Ai.Tests
  • BehaviorTreeCompositeTestsVixen.Ai.Tests
  • BehaviorTreeCostTestsVixen.Ai.Tests
  • BehaviorTreeDecoratorTestsVixen.Ai.Tests
  • BehaviorTreeDeterminismTestsVixen.Ai.Tests
  • BehaviorTreeInstanceVixen.Ai
  • BehaviorTreeServiceTestsVixen.Ai.Tests
  • BehaviorTreeTaskTestsVixen.Ai.Tests
  • BindingTestsVixen.Ai.Perception.Tests
  • BlackboardDecoratorVixen.Ai
  • BlackboardLayoutTestsVixen.Ai.Tests
  • BlackboardTestsVixen.Ai.Tests
  • BlackboardUtilityInputVixen.Ai
  • BlackboardWorldSourceVixen.Ai
  • BoardVixen.Ai.Nodes.Tests
  • ClearBlackboardValueTaskVixen.Ai
  • CompareEntriesDecoratorVixen.Ai
  • ConeDecoratorVixen.Ai
  • ConstantWorldSensorVixen.Ai
  • CountingObserverVixen.Ai.Tests
  • CountingSensorVixen.Ai.Tests
  • DelegateObserverVixen.Ai.Tests
  • DelegateWorldSensorVixen.Ai
  • DistanceSensorVixen.Ai.Nodes
  • DistanceUtilityInputVixen.Ai
  • FocusTestsVixen.Ai.Nodes.Tests
  • GoapDomainTestsVixen.Ai.Tests
  • GoapHarnessVixen.Ai.Tests
  • HarnessVixen.Ai.Tests
  • IBlackboardBindingVixen.Ai.Perception
  • IBlackboardObserverVixen.Ai
  • IWorldSensorVixen.Ai