csv.RecordActorCounts
csv.RecordActorCounts
#Overview
name: csv.RecordActorCounts
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Record actor counts by class when performing CSV capture
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of csv.RecordActorCounts is to control the recording of actor counts by class during CSV (Comma-Separated Values) capture in Unreal Engine 5. This setting is primarily used for profiling and performance analysis of the game world.
This setting variable is used in the Engine module, specifically within the level ticking system. It’s referenced in the LevelTick.cpp file, which is responsible for managing the ticking of actors and other objects in the game world.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, meaning it’s enabled by default. Developers can change this value at runtime using console commands or through configuration files.
The associated variable CVarRecordActorCountsToCSV directly interacts with csv.RecordActorCounts. They share the same value and purpose. Additionally, there’s another related variable called CVarRecordActorCountsToCSVThreshold, which sets a threshold for the minimum number of actors of a class to be recorded.
Developers should be aware that enabling this setting may have a performance impact, especially in scenes with many actors. It’s primarily intended for debugging and profiling purposes, not for use in shipping builds.
Best practices when using this variable include:
- Only enable it when needed for performance analysis or debugging.
- Be mindful of the performance overhead, especially in complex scenes.
- Use in conjunction with other profiling tools for a comprehensive analysis.
- Adjust the CVarRecordActorCountsToCSVThreshold to filter out classes with few instances if needed.
Regarding the associated variable CVarRecordActorCountsToCSV:
- Its purpose is identical to csv.RecordActorCounts, serving as the actual C++ variable that controls the functionality.
- It’s used in the same Engine module and LevelTick.cpp file.
- Its value is set through the CVar system and can be modified at runtime.
- It directly controls whether the actor counts are recorded to CSV.
- Developers should treat it the same as csv.RecordActorCounts in terms of usage and best practices.
When working with either of these variables, developers should remember that they are primarily debugging tools and should be used judiciously to avoid unnecessary performance overhead in production builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelTick.cpp:1194
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRecordActorCountsToCSV(
TEXT("csv.RecordActorCounts"),
1,
TEXT("Record actor counts by class when performing CSV capture"));
static TAutoConsoleVariable<int32> CVarRecordActorCountsToCSVThreshold(
TEXT("csv.RecordActorCountsThreshold"),
5,
#Associated Variable and Callsites
This variable is associated with another variable named CVarRecordActorCountsToCSV
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelTick.cpp:1193
Scope: file
Source code excerpt:
TEXT("Gives more detailed info for Tick counts in CSV"));
static TAutoConsoleVariable<int32> CVarRecordActorCountsToCSV(
TEXT("csv.RecordActorCounts"),
1,
TEXT("Record actor counts by class when performing CSV capture"));
static TAutoConsoleVariable<int32> CVarRecordActorCountsToCSVThreshold(
TEXT("csv.RecordActorCountsThreshold"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelTick.cpp:1228
Scope (from outer to inner):
file
function static void RecordWorldCountsToCSV
Source code excerpt:
}
if (CVarRecordActorCountsToCSV.GetValueOnAnyThread())
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_RecordActorCountsToCSV);
CSV_SCOPED_TIMING_STAT_EXCLUSIVE(RecordActorCountsToCSV);
const int32 Threshold = CVarRecordActorCountsToCSVThreshold.GetValueOnAnyThread();