bSmoothFrameRate

bSmoothFrameRate

#Overview

name: bSmoothFrameRate

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bSmoothFrameRate is to control frame rate smoothing in Unreal Engine. This setting variable is primarily used in the engine’s rendering and timing systems to manage the game’s frame rate and performance.

This setting variable is mainly relied upon by the Engine module, specifically within the UEngine class. It’s also referenced in the UnrealEd module, indicating its importance in both runtime and editor contexts.

The value of this variable is typically set in the engine configuration files (e.g., Engine.ini). It can be overridden through command-line arguments, as seen in the ConfigCacheIni.cpp file.

bSmoothFrameRate interacts with other variables such as:

  1. bUseFixedFrameRate
  2. SmoothedFrameRateRange
  3. bForceDisableFrameRateSmoothing

Developers must be aware of the following when using this variable:

  1. It’s a boolean value (uint32 bSmoothFrameRate:1), where 1 enables frame rate smoothing and 0 disables it.
  2. It’s only effective when FPlatformProperties::AllowsFramerateSmoothing() returns true and the engine is not running as a dedicated server.
  3. It can be overridden by bForceDisableFrameRateSmoothing.
  4. In the editor, it affects the frame rate even when smoothing is disabled, as seen in the EditorEngine.cpp file.

Best practices when using this variable include:

  1. Consider the target platform’s capabilities and whether it supports frame rate smoothing.
  2. Use in conjunction with SmoothedFrameRateRange to set appropriate upper and lower bounds for the frame rate.
  3. Be cautious when overriding this setting via command-line arguments, as it may affect performance across different hardware configurations.
  4. When using a fixed frame rate (bUseFixedFrameRate is true), ensure that bSmoothFrameRate is set to false for consistency.
  5. Monitor performance impacts when enabling or disabling this feature, especially on lower-end hardware.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:313, section: [/Script/Engine.Engine]

Location: <Workspace>/Engine/Config/BaseEngine.ini:1832, section: [/Script/UnrealEd.EditorEngine]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:2375

Scope (from outer to inner):

file
function     float UEditorEngine::GetMaxTickRate

Source code excerpt:


		// Clamp editor frame rate, even if smoothing is disabled
		if( !bSmoothFrameRate && GIsEditor && !GIsPlayInEditorWorld )
		{
			MaxTickRate = 1.0f / DeltaTime;
			if (SmoothedFrameRateRange.HasLowerBound())
			{
				MaxTickRate = FMath::Max(MaxTickRate, SmoothedFrameRateRange.GetLowerBoundValue());
			}

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/ConfigCacheIni.cpp:1368

Scope (from outer to inner):

file
function     void FConfigFile::OverrideFromCommandline

Source code excerpt:

	//		-ini:IniName:[Section1]:Key1=Value1,[Section2]:Key2=Value2
	// for example:
	//		-ini:Engine:[/Script/Engine.Engine]:bSmoothFrameRate=False,[TextureStreaming]:PoolSize=100
	//			(will update the cache after the final combined engine.ini)
	const TCHAR* CommandlineStream = FCommandLine::Get();
	while(FParse::Value(CommandlineStream, *FString::Printf(TEXT("%s%s"), CommandlineOverrideSpecifiers::IniSwitchIdentifier, *FPaths::GetBaseFilename(Filename)), Settings, false))
	{
		// break apart on the commas
		TArray<FString> SettingPairs;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1473

Scope (from outer to inner):

file
class        class UEngine : public UObject , public FExec

Source code excerpt:

	/** Whether to enable framerate smoothing. */
	UPROPERTY(config, EditAnywhere, Category=Framerate, meta=(EditCondition="!bUseFixedFrameRate"))
	uint32 bSmoothFrameRate:1;

	/** Whether to use a fixed framerate. */
	UPROPERTY(config, EditAnywhere, Category=Framerate)
	uint32 bUseFixedFrameRate : 1;
	
	/** The fixed framerate to use. */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:11211

Scope (from outer to inner):

file
function     bool UEngine::IsAllowedFramerateSmoothing

Source code excerpt:

bool UEngine::IsAllowedFramerateSmoothing() const
{
	return FPlatformProperties::AllowsFramerateSmoothing() && bSmoothFrameRate && !bForceDisableFrameRateSmoothing && !IsRunningDedicatedServer();
}

/** Compute tick rate limitor. */
void UEngine::UpdateRunningAverageDeltaTime(float DeltaTime, bool bAllowFrameRateSmoothing)
{
	if (bAllowFrameRateSmoothing && IsAllowedFramerateSmoothing())