QueryCountWarningInterval

QueryCountWarningInterval

#Overview

name: QueryCountWarningInterval

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of QueryCountWarningInterval is to control how often warnings are issued about the number of environment queries being executed in the Unreal Engine’s AI system. This setting is part of the Environment Query System (EQS) within the AI Module.

This setting variable is primarily used by the AI Module, specifically within the Environment Query System. It is referenced in the UEnvQueryManager class, which is responsible for managing and executing environment queries.

The value of this variable is set in several ways:

  1. It has a default value of 60.0 seconds in the class declaration.
  2. It can be configured through the engine’s configuration system, as indicated by the UPROPERTY(config) attribute.
  3. It is set to 30.0 seconds in the UEnvQueryManager constructor.
  4. It can be modified at runtime through the Configure function of UEnvQueryManager.

QueryCountWarningInterval interacts with other variables such as QueryCountWarningThreshold and LastQueryCountWarningThresholdTime. These variables work together to control when and how often warnings about query count are issued.

Developers should be aware that this variable affects the frequency of warnings about the number of queries being executed. Setting it too low might result in excessive warnings, while setting it too high might cause important information to be missed.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of the project. For games with complex AI systems that frequently use EQS, a higher interval might be appropriate.
  2. Using it in conjunction with QueryCountWarningThreshold to fine-tune the warning system.
  3. Monitoring logs and adjusting the value if too many or too few warnings are being generated.
  4. Considering performance implications when setting this value, as frequent checks and warnings could potentially impact performance in debug builds.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:215, section: [/Script/AIModule.EnvQueryManager]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Classes/EnvironmentQuery/EnvQueryManager.h:47

Scope: file

Source code excerpt:

	/** how often (in seconds) we will warn about the number of queries (allows us to catch multiple occurrences in a session) */
	UPROPERTY(config)
	double QueryCountWarningInterval = 60.0f;

	/** Maximum EQS execution duration (in seconds) before a warning is reported. */
	UPROPERTY(config)
	double ExecutionTimeWarningSeconds = 0.025f;

	/** Maximum EQS Query FinishDelegate duration (in seconds) before a warning is reported. */

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Classes/EnvironmentQuery/EnvQueryManager.h:351

Scope (from outer to inner):

file
class        class UEnvQueryManager : public UAISubsystem, public FSelfRegisteringExec

Source code excerpt:

	/** how often (in seconds) we will warn about the number of queries (allows us to catch multiple occurrences in a session) */
	UPROPERTY(config)
	double QueryCountWarningInterval;

	/** Maximum EQS execution duration (in seconds) before a warning is reported. */
	UPROPERTY(config)
	double ExecutionTimeWarningSeconds = 0.025f;

	/** Maximum EQS Query FinishDelegate duration (in seconds) before a warning is reported. */

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EnvQueryManager.cpp:183

Scope (from outer to inner):

file
function     UEnvQueryManager::UEnvQueryManager

Source code excerpt:


	QueryCountWarningThreshold = 0;
	QueryCountWarningInterval = 30.0;
#if !(UE_BUILD_SHIPPING)
	LastQueryCountWarningThresholdTime = -FLT_MAX;
#endif

#if USE_EQS_DEBUGGER
	if (!HasAnyFlags(RF_ClassDefaultObject))

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EnvQueryManager.cpp:637

Scope (from outer to inner):

file
function     void UEnvQueryManager::CheckQueryCount

Source code excerpt:

		const double CurrentTime = FPlatformTime::Seconds();

		if ((LastQueryCountWarningThresholdTime < 0.0) || ((LastQueryCountWarningThresholdTime + QueryCountWarningInterval) < CurrentTime))
		{
			LogQueryInfo(true /* bDisplayThresholdWarning */);

			LastQueryCountWarningThresholdTime = CurrentTime;
		}
	}

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EnvQueryManager.cpp:1141

Scope (from outer to inner):

file
function     void UEnvQueryManager::Configure

Source code excerpt:

	bTestQueriesUsingBreadth = NewConfig.bTestQueriesUsingBreadth;
	QueryCountWarningThreshold = NewConfig.QueryCountWarningThreshold;
	QueryCountWarningInterval = NewConfig.QueryCountWarningInterval;
	ExecutionTimeWarningSeconds = NewConfig.ExecutionTimeWarningSeconds;
	HandlingResultTimeWarningSeconds = NewConfig.HandlingResultTimeWarningSeconds;
	GenerationTimeWarningSeconds = NewConfig.GenerationTimeWarningSeconds;	
}

//----------------------------------------------------------------------//

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EnvQueryManager.cpp:1321

Scope (from outer to inner):

file
function     FString FEnvQueryManagerConfig::ToString

Source code excerpt:

FString FEnvQueryManagerConfig::ToString() const
{
	return FString::Printf(TEXT("MaxAllowedTestingTime=%f bTestQueriesUsingBreadth=%d QueryCountWarningThreshold=%d QueryCountWarningInterval=%f ExecutionTimeWarningSeconds=%f HandlingResultTimeWarningSeconds=%f GenerationTimeWarningSeconds=%f"), MaxAllowedTestingTime, bTestQueriesUsingBreadth, QueryCountWarningThreshold, QueryCountWarningInterval, ExecutionTimeWarningSeconds, HandlingResultTimeWarningSeconds, GenerationTimeWarningSeconds);
}