public sealed class AiGameplayDebuggerOne overlay over all three planners and the perception model, drawn through DebugDraw.
Remarks
Doc 37 § D20's one debug surface. Unreal's answer to "why did my AI do that" is one key, one overlay and numbered categories, and it is the most-used AI feature in that engine because it works in a packaged build rather than only in the editor. This is that, and it is one class rather than three because AiSnapshots has already made the three planners agree on a shape.
⚠ It draws lines and text and it is therefore testable with no window at all — ConstraintGizmos's precedent, and doc 37 § P7's second exit criterion. Everything lands in a DebugDraw's three lists, which a test reads directly; there is no device, no font atlas and no render pass between the assertion and the geometry.
⚠ It reads and never simulates. A capture re-scores a utility set without advancing its clock and reads a plan without re-resolving it, so turning the overlay on cannot change what an agent does. A debugger that perturbed the thing it watched would be worse than none, because the bug would move.
The cost is a capture per drawn agent per frame, which is why AiOverlayStyle has a range and a count and why both of them bite before anything is formatted.
Fields and properties (8)
public bool EnabledWhether anything is drawn. Off is one branch.
public AiOverlayStyle StyleWhat is drawn, how far and in what colours.
public Vector3 ViewpointWhere the camera is. Agents are drawn nearest first from here.
public Entity SelectedOne agent to draw whatever the range says, and to draw in the attention colour.
public PerceptionSystem? PerceptionThe perception system, when the game has one.
public int DrawnAgentsHow many agents the last Draw put on the screen.
public int DrawnRowsHow many rows it drew, across every agent.
public IReadOnlyList<AiFinding> FindingsWhat AiDiagnosis made of the log the last time it was asked.
Methods (1)
Used by (3)
- AiOverlayExitCriteriaTestsVixen.Ai.Diagnostics.Tests
- AiOverlaySystemVixen.Ai.Diagnostics
- SeamTestsVixen.Ai.Nodes.Tests