Vixen
caa30e12
csharp
public sealed class AgentDebugModel

What the editor's agent debugger shows: one agent's state, its recent decisions, and what is visibly wrong with it.

Read the guide page for this →

Remarks

Doc 37 § P7's "editor panels over the same records", and the same records is the whole of it. This holds an AiAgentSnapshot and a list of AgentDebugRecords, which are the two things the runtime overlay draws — so the panel is a richer view over one implementation rather than a second one that will disagree with it in six months.

⚠ Two ways in and one way out. Refresh photographs an AiSystem in this process; Show takes a snapshot that arrived over a wire. After that the panel cannot tell, which is what makes debugging a dedicated server the same tool as debugging play mode rather than a second one written later and worse.

⚠ No Control anywhere in here. It is the model, so the interesting behaviour — which agent is selected, what the log says, whether a breakpoint is set — is asserted by tests that stand up no window, the same bargain BehaviorTreeModel makes.

Fields and properties (13)

  • public AiAgentSnapshot Snapshot

    The agent being shown.

  • public AgentDebugOrigin Origin

    Where that picture came from.

  • public IReadOnlyList<Entity> Agents

    Every agent the last Refresh found, in schedule order.

  • public Entity Selected

    Which one is selected.

  • public IReadOnlyList<AgentDebugRecord> Log

    What the selected agent has decided lately, oldest first.

  • public IReadOnlyList<AiFinding> Findings

    What AiDiagnosis makes of the whole log.

  • public AiBreakpoints Breakpoints

    The node breakpoints, shared with whatever is running the agents.

  • public AiDiagnosisSettings Thresholds

    What counts as bad enough to report.

  • public bool Halted

    Whether the selected agent is stopped at a breakpoint.

  • public BehaviorTreeInstance? Instance

    The selected agent's running tree, when it is running one.

  • public IReadOnlyList<int> ActivePath

    The path from the root to the active node, root first, by execution index.

  • public GoapPlan? Plan

    The selected agent's plan, when it is planning over a domain.

  • public ReadOnlySpan<int> WorldKeys

    The selected agent's world keys, projected as the search would read them.

Methods (6)

  • public bool Refresh(AiSystem system, World world, GameTime time = default(GameTime))

    Re-reads a running system.

  • public void Show(AiAgentSnapshot snapshot)

    Shows a picture that arrived from somewhere else.

  • public IEnumerable<AiDebugRow> Section(AiDebugSection section)

    The rows of one section, which is what one table in the panel draws.

  • public IEnumerable<AiFinding> SelectedFindings()

    What the panel says is wrong with the agent it is showing.

  • public bool ToggleBreakpoint(Symbol tree, int node)

    Sets or clears a breakpoint on a node of a tree.

  • public bool Resume(AiSystem system, World world)

    Lets the selected agent go, if a breakpoint stopped it.

Used by (9)

  • AgentDebugModelTestsVixen.Editor.AssetEditors.Tests
  • AgentDebuggerViewVixen.Editor.AssetEditors
  • AgentDebuggerViewTestsVixen.Editor.AssetEditors.Tests
  • BehaviorTreeViewVixen.Editor.AssetEditors
  • GoapDomainViewVixen.Editor.AssetEditors
  • LiveTreeCanvasTestsVixen.Editor.AssetEditors.Tests
  • LiveUtilityTestsVixen.Editor.AssetEditors.Tests
  • OpenAssetTestsVixen.Editor.AssetEditors.Tests
  • UtilitySetViewVixen.Editor.AssetEditors