Vixen
caa30e12
csharp
public readonly record struct AgentDebugRecord

What an agent decided, and why, in the one shape all three planners fill.

Read the guide page for this →

Remarks

One record for three planners, because doc 37 § D2 made the agent one shape. The debug overlay, the editor's panels and a headless test's log are three views over this and not three implementations — which is what makes "an agent misbehaving in a headless test is diagnosed from the recorded log alone" a criterion rather than an aspiration.

Deliberately flat and value-typed: it goes in a ring buffer, it is compared in tests, and it must be cheap enough that recording is a decision about noise rather than about cost.

Fields and properties (9)

  • public Entity Entity

    The agent.

  • public long Tick

    When.

  • public AiPlanner Planner

    Which planner decided.

  • public Symbol Action

    What it is doing — the task, the utility action, the plan's current step.

  • public ActionStatus Status

    How that action is getting on.

  • public int Index

    Where the decision sits: a tree node's execution index, the chosen action's index in a utility set, or the step's position in a plan.

  • public int Count

    What it was chosen from: the composite's child count, the number of candidates scored, or the plan's length.

  • public Symbol Reason

    Why, named: the decorator that decided, the consideration that dominated, or the condition still unmet.

  • public float Score

    The number behind the reason: one or zero for a decorator, the utility score, the plan's cost.

Methods (2)

  • public AgentDebugRecord(Entity Entity, long Tick, AiPlanner Planner, Symbol Action, ActionStatus Status, int Index, int Count, Symbol Reason, float Score)

    What an agent decided, and why, in the one shape all three planners fill.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (11)

  • AgentDebugRecorderVixen.Ai
  • AgentDebugRecorderTestsVixen.Ai.Tests
  • AiDiagnosisVixen.Ai
  • AiSystemTreeTestsVixen.Ai.Tests
  • BehaviorTreeCompositeTestsVixen.Ai.Tests
  • BehaviorTreeTaskTestsVixen.Ai.Tests
  • GoapAgentTestsVixen.Ai.Tests
  • VillageSampleTestsVixen.Ai.Nodes.Tests
  • AgentDebugModelVixen.Editor.Ai
  • AgentDebugModelTestsVixen.Editor.AssetEditors.Tests
  • AgentDebuggerViewVixen.Editor.AssetEditors