Some scalability settings not working in packaged game

Hello!

In 4.5 and previous versions I’ve been able to set the scalabity settings at run time. In 4.6 I can no longer change the resolution quality using the "sg.ResolutionQuality " command. This is true both in my apply settings function in my user settings code and from the console. In code I use:

void SetQualityLevels(const FQualityLevels& QualityLevels) //Scalability.h

I also can’t seem to enable vsync using

void UGameUserSettings::SetVSyncEnabled( bool bEnable ) //GameUserSettings.cpp

However, both "r.ScreenPercentage " and “r.vsync <0-1>” work fine.

Using PIE everything works fine, the only problems I’m having are in packaged games. I’ve tested this in a fresh Shootergame project as well.

Specifics:

  1. Occurs in both 4.6 and 4.6.1
    (problem didn’t occur in 4.5.x)
  2. I’mbuilding from source using the
    release branch in GitHub.
  3. The other sg commands seem to work fine.

Cheers and thanks.

May be related to this question?

Update:

I’ve just notced that if I change my scalability settings in editor this shows up in the output log.

LogConsoleManager:Warning: Console variable 'sg.ResolutionQuality' wasn't set (Priority Console < Scalability)
LogConsoleManager:Warning: Console variable 'r.MSAA.CompositingSampleCount' wasn't set (Priority ProjectSetting < Scalability)
LogConsoleManager:Warning: Console variable 'r.Streaming.PoolSize' wasn't set (Priority Code < Scalability)
LogConsoleManager:Warning: Console variable 'r.MaterialQualityLevel' wasn't set (Priority Console < Scalability)
LogRenderer:Warning: Reallocating scene render targets to support 3840x2352.
LogRenderTargetPool:Warning: r.RenderTargetPoolMin exceeded 822/400 MB (ok in editor, bad on fixed memory platform)

That would be wrong - we will investigate it. As a workaround you can change this function to always return true:

bool CanChange(EConsoleVariableFlags SetBy) const

The feature (cvar priorty) was recently introduced and some usage still need to be adjusted for it.

I tried modifying the function as follows:

bool CanChange(EConsoleVariableFlags SetBy) const
	{
		uint32 OldPri =	(uint32)Flags & ECVF_SetByMask;
		uint32 NewPri =	(uint32)SetBy & ECVF_SetByMask;

		bool bRet = true;//NewPri >= OldPri;

		if(!bRet)
		{
			FConsoleManager& ConsoleManager = (FConsoleManager&)IConsoleManager::Get();
			FString CVarName = ConsoleManager.FindConsoleObjectName(this);
			UE_LOG(LogConsoleManager, Warning,
				TEXT("Console variable '%s' wasn't set (Priority %s < %s)"),
				CVarName.IsEmpty() ? TEXT("unknown?") : *CVarName,
				GetSetByTCHAR((EConsoleVariableFlags)OldPri),
				GetSetByTCHAR((EConsoleVariableFlags)NewPri)
				);
		}

		return bRet;
	}

Compilation is successful but when I try to open the project I get the following error:

http://puu.sh/eei87/5883dde953.png

Hey -

The if statement you have isn’t actually running. I know Martin mentioned setting the function to always return true, however your code sets the bool to true then checks if it is not true which will always return false and skip the if code block. Instead you could use:

if(NewPri >= OldPri)
{
//code block
}

return true;

Hi ,

Well I’ve just discovered the source of another problem. I thought I’d screwed up my dev environment (too many bleary eyed nights messing with things I guess) so I’d done a system restore. Now I know what did it :slight_smile:

When I modify the function as you suggested I get an error code during compilation. Here’s the output from VS2013 (truncated due to space):

19>  Building UnrealHeaderTool...
19>  Performing 2 actions (4 in parallel)
19>  Module.Core.1_of_6.cpp
19>  [2/2] Link UnrealHeaderTool-Core.dll
19>     Creating library D:\Unreal\UnrealEngineSource\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\UnrealHeaderTool-Core.lib and object D:\Unreal\UnrealEngineSource\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\UnrealHeaderTool-Core.exp
19>  -------- End Detailed Actions Stats -----------------------------------------------------------
19>  Cumulative action seconds (8 processors): 0.00 building projects, 9.59 compiling, 0.00 creating app bundles, 0.00 generating debug info, 2.43 linking, 0.00 other
19>  UBT execution time: 14.71 seconds
19>  Parsing headers for UE4Editor
19>Error : Failed to generate code for UE4Editor - error code: -1073741502 (-1073741502)
19>  UnrealHeaderTool failed for target 'UE4Editor' (platform: Win64, module info: D:\Unreal\UnrealEngineSource\Engine\Intermediate\Build\Win64\UE4Editor\Development\UnrealHeaderTool.manifest).
19>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development" exited with code -1.
========== Build: 0 succeeded, 1 failed, 13 up-to-date, 24 skipped ==========

Cheers

Hey -

Going back to the original question, I made a report about the sg.ResolutionQuality command not having any affect in 4.6 (UE-7351) for further investigation. For the time being are you able to use the r.ScreenPercentage command or the sg.AntiAliasingQuality command as mentioned by noms in the other post you linked previously?

If the code modification doesn’t work then you may want to revert to what you had previously that was working. If the code change is necessary and still not working then it would be best if you created a new post so that we can focus on that issue specifically.

Cheers

Hi ,

The other commands work fine, it’s just the code workaround that is problematic. For now i’ll stick to using r.ScreenPercentage and r.vsync. I haven’t run into any problems with sg.AntiAliasingQuality as yet.

Cheers

Upvoted because I also need SetVSyncEnabled and it doesn’t seem to work. Going to use the console command for now…