Cannot save Resolution settings to config

I am trying to let the user select a resolution setting and apply it.

I have been able to change the games resolution, but the issue is that it is not actually saving to the config and when the user quits and reloads their game the resolution is set back to the default resolution settings.

I am currently able to set and save all the graphical settings property(AA, Texture Quality) properly.

Here is the code for setting resolution:

int32 Width = 1920, Height = 1080;
		if (Settings != nullptr)
			Settings->RequestResolutionChange(Width, Height, EWindowMode::Windowed, false);

		Settings->ConfirmVideoMode();
		Settings->SetScreenResolution(Settings->GetLastConfirmedScreenResolution());
		Settings->SetFullscreenMode(Settings->GetLastConfirmedFullscreenMode());
		Settings->SaveSettings();

I’m having the same issue, I found this post that may be related to this issue but it doesn’t contain a solution to the problem.

After much testing I noticed that it works properly when I package the game. But it doesn’t work when the editor is involved.

I will try that and see if I have any luck.

My scalability settings are saved when I package up the game but my resolution settings do not save even when packaged.

Using UE4.8.3 I experience exactly the same issue with packaged games. Have you guys had any luck in the meantime?

I have gotten it to work now. Give this a shot and if it works for you I will mark it as the answer.

int32 Width = 1680, Height = 1050;

Settings->SetFullscreenMode(EWindowMode::Windowed);
Settings->SetScreenResolution(FIntPoint(Width, Height));
GEngine->GameUserSettings->ApplyResolutionSettings(true);

Thanks for your reply. You’re right, that solution works, thanks. The issue seems to be that RequestResolutionChange() only changes the resolution, but does not set it internally. So one does need to explicitly call SetScreenResolution() as well before calling SaveSettings() …