Overview

CryENGINE has various built-in debugging and profiling tools that help to locate and fix problems as well as performance issues. This article outlines some of the most widely used tools.

Basic Logging Functionality

Basic Asset Information

Error Report Window

The Error Report window displays error messages created by missing objects and broken assets. The console can also be accessed under Tools > Check Level for Errors.

SaveLevelStats

Stats for your level are saved within the level folder, with further information saved in the GameSDK/TestResults folder.

System

MemInfo

Displays current memory info. Useful for finding memory leaks.

 MemStats

Displays detailed information of each function currently being called, sorted by size. This view contains a lot of detailed information, although on some occasions the data may be slightly distorted.

 Profile

The profile console command contains various ways to access debugging and memory consumption information within CRYENGINE. To access a list of profile command lines, please use the profile command line.

Profile 1

This option displays the names of the functions that are currently being called by the game engine.

The more time a process takes up, the more expensive it is. Obviously, when debugging, it's a good idea to address these processes first. However, it is also a good idea to take note of processes with a relatively low time, but a high count number, as this can also cause issues.


Profile 2

This option displays the profiling information in a hierarchical format. Pressing Scroll Lock will cause you to enter an interactive mode, where the up and down arrows allow you to move up and down in the menu, and the left and right arrows allow you to navigate up and down the hierarchy.


Profile 3

This is a graphical representation of memory consumption.

Profile 4

This is also a graphical representation of memory consumption, but with a hierarchical setup.

Profile 5

This is a graphical representation of the profiling information shown in Profile 1.

Profile 6

This is a per module view of the available profiling information, showing memory consumption as a percentage.

Profile 7

This sorts profiling information by count, allowing functions with high numbers of calls to be easily located.

Profile 8

This is the standard deviation of the CPU time of a function, from its normal.

Profile_smooth

This adjusts the "smoothing" of the numbers shown in the profile displays. Increasing this value will result in less erratic movement in the values shown.

Profile_peak

This sets the lower limit for values shown in the latest peaks column. The lower the value is, the more the peaks are shown.

sys_enable_budgetmonitoring

Displays memory budgeting information for your level, for video, frametime, sound channels, sound memory and draw calls. Individual budgets can be set up externally, using console commands beginning with sys_budget_ (type it in to the console and press tab for a list). When a bar reaches the far right, the associated text will flash as a warning that you are over budget. As the text shown states, please test this in pure game mode, as the editor version of the game can give false results.

profile_allthreads

3D Engine

e_DebugLights

Debug draw mode visualizing the number of dynamic lights affecting a piece of static geometry. This is important as the more lights affect an object, the more often it needs to be rendered, e.g. to generate shadow maps, perform lighting (when using non-deferred lights), etc. Using this information, you would ideally place your lights in a way to get the biggest bang for the buck. That means, use only as few lights as possible to realize a certain lighting condition or mood. This debug draw mode can help to detect surfaces which are affected by more lights. It also enables designers to easily check why some of the lights may flicker on certain surfaces.

It uses different colors for objects affected by different numbers of lights.

e_Lods

e_Lods controls the use of LOD, or Level Of Detail objects in your level. If you suspect geometry might be causing issues, simply turn off the use of LOD objects (the low detail versions of objects, which have less polygons) by typing in e_lods 0.

All objects will now use their highest detail LOD version.

In the picture below with e_lods turned off, the high detail object shows. With e_lods turned on, the appropriately calculated lower detail LOD shows:

e_LodMin

e_LodMax

sys_ProfileLevelLoading

Renderer

r_DisplayInfo

Displays various important information for debugging, such as camera position and angle, build number and name of level loaded.

r_MeasureOverdraw

This option activates a special rendering mode that visualizes the rendering cost per pixel, by color. As you may notice, this command shows the accumulated instruction count per pixel, not just the overdraw.

r_DebugLights

r_ShowMT

r_DebugRefraction

r_PostProcessEffects

This CVar makes it possible to completely disable post-processing effects to find out if they cause a specific problem. It is also possible to display the currently active post-processing effects.

r_TexelsPerMeter

r_ProfileShaders

This option displays the profiling information for the currently rendered shaders.

r_TexLog

This option dumps texture information to a text file in the root of the game folder.

Physics

p_draw_helpers

P_draw_helpers is a command which allows access to various view mode for the physics of the objects in your level.

p_debug_joints

When p_draw_helpers is enabled, this CVar will show any tension on physicalized joints within a breakable object.

p_profile_entities

p_profile_functions

AI

ai_DebugDraw

When set, shows any AI debugging information currently active in your level.

Supported CVar Values

ai_DebugDraw

Description

-1

Only warnings/errors and Interest System debug draw

0

No AI debug draw

1

Basic AI debug draw

71

Draw all forbidden areas (including auto-generated ones)

72

Draw graph errors (problematic areas are highlighted with circles)

74

Draw the whole navigation graph (can be very slow)

79

Draw the navigation graph close to the player (within 15 m from the camera; quicker than 74)

80

Draw tagged nodes (during A*)

81

Calculate (if necessary) then draw 3D (volume) hidespots

82

Draw 3D (volume) hidespots

85

Draw steep slopes (determined by ai_steep_slope_up_value and ai_steep_slope_across_value)

90

Draw flight navigation within 200-m range of the player

179

Same as 79 but also showing triangulation edges' centers

279

Same as 179 but also showing water depth information

1017

Visualize navigation links of node which encloses entity "test"

Setting ai_DebugDraw to one will enable the visualization of following variables:

ai_DrawStats

ai_StatsTarget

ai_DebugTacticalPoints

Logs tactical point activity from the statsTarget and displays associated debug drawing.

ai_AllTime

ai_DrawBadAnchors

ai_DrawFormations

ai_DrawModifiers

ai_DrawNode

ai_DrawNodeLinkType

ai_DrawNodeLinkCutoff

ai_DrawOffset

ai_DrawPath

ai_DrawRefPoints

ai_DrawTargets

ai_DrawType

ai_Locate

ai_ProfileGoals

ai_SteepSlopeAcrossValue

ai_SteepSlopeUpValue

ai_DrawRadar

Draws a radar overlay at the center of the view. 'ai_DrawRadar 0' disabled the radar and any other number is interpreted as the size of the radar in pixels. That is 'ai_drawradar 500' draws 500px high radar in the middle of the screen. The circles in the radar are drawn in 5m intervals.

Distance of the radar can be set using ai_DrawRadarDist console variable. The distance is specified in meters. A good combination to start with is 500px high radar with view distance of 50m. The radar displays each unit, including the name of the unit, the alertness state and the current path and readability.

ai_DrawRadarDist

ai_DrawTrajectory

ai_StatsDisplayMode

Gives information on the number of active AIs, full updates and TPS queries that happen every frame.

Entity System

es_ProfileEntities

es_DebugTimers

 

 

A longer list of important console variables and profiles.