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.
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:
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.
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 Label | Copies 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 Start | Sets the cursor to the starting time of the recording. |
Goto End | Sets the cursor to the ending time of the recording. |
Goto Agent Location | Sets the position of the camera in the Editor to the location of the agent who owns the stream. |
Copy Agent Location | Copies the location of the agent who owns the stream to the clipboard. |
Following Content | Contains 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. |
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:
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.
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.
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".
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.
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.
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.
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.