AI Debug Viewer

Overview

The AI Debug Viewer is the viewing utility of the AI Debug Recorder and is responsible for loading and parsing a recording file and presenting the information to the debugger in a human-like way.

Loading a Recording in the Debug Viewer

To open the AI Debugger, go to "Tools" -> "Debug" -> "AI Debugger".

The contents of the Window will either be empty or contain the recording of the last game session recorded in the Editor.
NOTE: This is only true if the CVar "ai_Recorder_Auto" is enabled.

The File menu can be used to either "Load" the recording of the last game session recorded in the Editor or "Load As" a pre-existing recording file.

In any case, upon a successful load of a recording, the contents of the recording will be loaded and displayed within the viewer, and will resemble something close to the following screenshot:

Data Displayed in the Debug Viewer

The contents of each stream are presented on a timeline. Not all streams are initially visible, but instead must be toggled on/off via the context menu (described further below).

First, we will break down the viewer into different categories and explain the purpose of each one.

  1. This is the StreamWindow. It displays the contents of all active streams for all of the AI agents who were recorded, along the timeline.
  2. This is the AgentWindow. It displays the name of the agent who owns the contents of the stream displayed to the right.
  3. This is the InfoWindow. It displays the last value of the stream based on the cursor position for the stream to the left.
  4. This is the RulerWindow. It displays the current time and can be used to select time ranges or manipulate the cursor.
  5. This is the MenuWindow. It contains configuration and command settings for the view pane.

Stream Window

The Stream Window displays the contents of all active streams for all of the AI agents who were recorded, along the timeline. The name of the stream is displayed on the far right of the Agent Window, on the same line as the stream.

The context menu contains the following options:

Copy LabelCopies the current label of the stream to the clipboard. See the "Info" window for more details.
Find...Finds the next occurrence of the label you specify along the timeline and sets the cursor to that point.
Goto StartSets the cursor to the starting time of the recording.
Goto EndSets the cursor to the ending time of the recording.
Goto Agent LocationSets the position of the camera in the Editor to the location of the agent who owns the stream.
Copy Agent LocationCopies the location of the agent who owns the stream to the clipboard.
Following ContentContains all of the available streams for viewing. The checkbox next to the name of the stream means it is enabled. Enabling a stream causes its contents to be displayed in the Stream Window.

Agent Window

The Agent Window displays the name of the agent who owns the contents of the stream displayed to the right. The names of each stream owned by each agent is also displayed along the right-hand side of the window opposite of the stream.

The context menu contains the following options:

  • "Enable Debug Drawing" - Select to active 3D World debugging for this agent.
  • "Set Editor View" - Select to focus the Editor camera on this agent. See below for more information.
  • "Set Color" - Allows you to change the debug color used for representing this agent's information in the 3D World Debugging view.

Info Window

The Info Window just simply displays the last value of the stream based on the cursor position for the stream to the left. The references to "label" in various places throughout the debug viewer refer to the text you see in this pane.

Ruler Window

The Ruler Window displays the current time and can be used to select time ranges or manipulate the cursor.

The cursor is represented by a solid red line. Through CRYENGINE:3D World Debugging any information that occurred at the moment of time depicted by the cursor is drawn in the world.

The time range is represented by a blue box. Click and hold anywhere in the ruler window to drag the time range box. Releasing the mouse button sets the time range box. Through CRYENGINE:3D World Debugging all information that occurred during the highlighted time is drawn in the world.

The Menu Window contains configuration and command settings for the view pane.

  • File Menu
    • "Load" - Loads the last recording made in the Editor.
    • Save - Saves the current recording as the Editor's last recording.
    • "Load As" - Allows you to load a recording from a file.
    • "Save As" - Allows you to save the current recording to a new file.
  • Debug Options
    • "Enable All" - Actives 3D World Debugging for all agents in the recording.
    • "Disable All" - Deactivates 3D World Debugging for all agents in the recording.

Data Displayed in the 3D World

The power of the Recorder comes from its ability to display the information recorded within the 3D World. There are several advanced features which will be described here.

However, to experience any of them, you must ensure you enable AI debugging via the cvar "ai_DebugDraw 1".

Activating an Agent

Only agents who are set to be debugged will have their information displayed in the 3D World. To activate an agent, select the option in the context menu for the AgentWindow.

Cursor Information

All information that occurred at the point in time represented by the cursor is displayed in the Editor for that agent via a tag point. This information is displayed per stream.

Time Range Information

All information that occurred during the time represented by the time range box is displayed in the Editor for that agent via two tag points (representing the start and end points) and the agent's recorded path in-between.

Arrows are drawn along the path taken to represent the agent's facing direction.

Editor View

If the agent has Editor View enabled for him (via the AgentWindow context menu) then the Editor's camera will automatically be centered to both the position and facing direction of the AI agent based on where the cursor is currently set.

This allows you to see what that AI agent was seeing at any moment in time. By moving the cursor either by the mouse or using the left/right / A/D keys, you can replay the agent's movements and see what it was seeing.