ts.debug.ForceRequeueAsyncRequests

ts.debug.ForceRequeueAsyncRequests

#Overview

name: ts.debug.ForceRequeueAsyncRequests

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ts.debug.ForceRequeueAsyncRequests is to control the behavior of async requests in the Targeting System within Unreal Engine 5. Specifically, it toggles whether the targeting system will force requeue async requests.

This setting variable is primarily used by the Gameplay Targeting System plugin, which is an experimental feature in Unreal Engine 5. It’s part of the targeting subsystem, which is responsible for handling targeting operations in the game.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as a boolean value, initially set to false, and can be toggled during runtime using the console command “ts.debug.ForceRequeueAsyncRequests”.

This variable interacts closely with another boolean variable named bForceRequeueAsyncRequests. They share the same value, with the console variable acting as an interface to modify the internal boolean.

Developers should be aware that this is a debug feature, as indicated by the “debug” in its name. It’s not intended for use in production builds but rather for testing and debugging purposes. When enabled, it will cause all async targeting requests to be requeued upon completion, which could impact performance and gameplay behavior.

Best practices when using this variable include:

  1. Only enable it during development and debugging sessions.
  2. Be aware of potential performance implications when enabled.
  3. Use it in conjunction with other debugging tools to diagnose issues with the targeting system.
  4. Remember to disable it before creating production builds.

Regarding the associated variable bForceRequeueAsyncRequests:

The purpose of bForceRequeueAsyncRequests is to serve as the internal representation of the console variable within the Targeting System CVars namespace.

This variable is used directly in the UTargetingSubsystem::Tick function to determine whether to force requeue async targeting requests. It’s checked in conjunction with other debug conditions to decide if a completed async request should be requeued.

The value of this variable is set by the console variable system when ts.debug.ForceRequeueAsyncRequests is modified.

Developers should be aware that modifying this variable directly in code won’t affect the console variable. Always use the console variable to ensure consistency between the two.

Best practices for this variable are similar to those for the console variable, with the addition that developers should avoid modifying it directly in code, instead relying on the console variable system for changes.

#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:47

Scope (from outer to inner):

file
namespace    TargetingSystemCVars

Source code excerpt:

	static bool bForceRequeueAsyncRequests = false;
	FAutoConsoleVariableRef CvarForceRequeueAsyncRequests(
		TEXT("ts.debug.ForceRequeueAsyncRequests"),
		bForceRequeueAsyncRequests,
		TEXT("Toggles whether the targeting system will force requeue async requests. (Enabled: true, Disabled: false)")
	);

	static bool bPrintTargetingDebugToLog = false;
	FAutoConsoleVariableRef CvarPrintTargetingDebugToLog(

#Associated Variable and Callsites

This variable is associated with another variable named bForceRequeueAsyncRequests. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:45

Scope (from outer to inner):

file
namespace    TargetingSystemCVars

Source code excerpt:

	);

	static bool bForceRequeueAsyncRequests = false;
	FAutoConsoleVariableRef CvarForceRequeueAsyncRequests(
		TEXT("ts.debug.ForceRequeueAsyncRequests"),
		bForceRequeueAsyncRequests,
		TEXT("Toggles whether the targeting system will force requeue async requests. (Enabled: true, Disabled: false)")
	);

	static bool bPrintTargetingDebugToLog = false;
	FAutoConsoleVariableRef CvarPrintTargetingDebugToLog(
		TEXT("ts.debug.PrintTargetingDebugToLog"),

#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:239

Scope (from outer to inner):

file
function     void UTargetingSubsystem::Tick

Source code excerpt:

					bool bForceRequeueOnCompletion = false;
#if ENABLE_DRAW_DEBUG
					bForceRequeueOnCompletion = IsTargetingDebugEnabled() && TargetingSystemCVars::bForceRequeueAsyncRequests && DebugTrackedAsyncTargetRequests.Contains(TargetingHandle);
#endif // ENABLE_DRAW_DEBUG

					if (FTargetingAsyncTaskData* AsyncTaskData = FTargetingAsyncTaskData::Find(TargetingHandle))
					{
						// re-queue if setup to do so
						if (AsyncTaskData->bRequeueOnCompletion || bForceRequeueOnCompletion)