ts.MaxAsyncTickTime
ts.MaxAsyncTickTime
#Overview
name: ts.MaxAsyncTickTime
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sets the total number of seconds we will allow to process the async targeting request queue.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ts.MaxAsyncTickTime is to control the maximum time allowed for processing asynchronous targeting requests in the Gameplay Targeting System plugin for Unreal Engine 5.
This setting variable is primarily used by the Gameplay Targeting System plugin, which is an experimental plugin in Unreal Engine 5. Specifically, it’s used within the TargetingSubsystem module of this plugin.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through the console. It’s initialized with a default value of 0.01 seconds (10 milliseconds).
The associated variable MaxAsyncTickTime directly interacts with ts.MaxAsyncTickTime. They share the same value, with MaxAsyncTickTime being the actual variable used in the code, while ts.MaxAsyncTickTime is the console command to modify it.
Developers must be aware that this variable affects the performance and responsiveness of the targeting system. Setting it too high might cause frame rate drops, while setting it too low might result in incomplete processing of targeting requests.
Best practices when using this variable include:
- Monitor its impact on performance and adjust accordingly.
- Use it in conjunction with profiling tools to find the optimal balance between targeting system responsiveness and overall game performance.
- Consider exposing it as a configurable option for end-users if targeting system performance is critical to gameplay.
Regarding the associated variable MaxAsyncTickTime:
- It’s a static float variable within the TargetingSystemCVars namespace.
- It’s used directly in the UTargetingSubsystem::Tick function to limit the time spent processing async targeting requests.
- Developers should be cautious about modifying this variable directly in code, as changes made through the console variable (ts.MaxAsyncTickTime) would override it.
- When debugging or optimizing the targeting system, developers can monitor this variable to understand how much time is being allocated to async targeting requests per tick.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:31
Scope (from outer to inner):
file
namespace TargetingSystemCVars
Source code excerpt:
static float MaxAsyncTickTime = .01f;
FAutoConsoleVariableRef CvarMaxAsyncTickTime(
TEXT("ts.MaxAsyncTickTime"),
MaxAsyncTickTime,
TEXT("Sets the total number of seconds we will allow to process the async targeting request queue.")
);
#if ENABLE_DRAW_DEBUG
#Associated Variable and Callsites
This variable is associated with another variable named MaxAsyncTickTime
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:29
Scope (from outer to inner):
file
namespace TargetingSystemCVars
Source code excerpt:
);
static float MaxAsyncTickTime = .01f;
FAutoConsoleVariableRef CvarMaxAsyncTickTime(
TEXT("ts.MaxAsyncTickTime"),
MaxAsyncTickTime,
TEXT("Sets the total number of seconds we will allow to process the async targeting request queue.")
);
#if ENABLE_DRAW_DEBUG
static bool bEnableTargetingDebugging = false;
#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:197
Scope (from outer to inner):
file
function void UTargetingSubsystem::Tick
Source code excerpt:
TARGETING_LOG(Verbose, TEXT("UTargetingSubsystem::Tick - Starting to Process %d requests"), NumRequests);
float TimeLeft = TargetingSystemCVars::MaxAsyncTickTime;
for (int32 RequestIterator = 0; RequestIterator < NumRequests; ++RequestIterator)
{
const double StepStartTime = FPlatformTime::Seconds();
FTargetingRequestHandle& TargetingHandle = AsyncTargetingRequests[RequestIterator];
TARGETING_LOG(Verbose, TEXT("UTargetingSubsystem::Tick - Started Processing Async Request [%d] with Handle [%d]"), RequestIterator, TargetingHandle.Handle);