Window Resolution for Packaged Game (Windows) Not Working


OK. I have a C++ Project using 4.6 source from GitHub. We are able to build it and run it on iOS and Android (Portrait). For internal testing I’m also packaging it as Windows 32/64 bit. The problem is I cannot set the resolution to 640x960 other than to force a command line r.SetRes which I don’t want to do for UI reasons.


Researching this item I’ve come across 2 posts with the same issue:


The first post insists to make sure you have the following settings in DefaultGameUserSettings.ini file that comes from your project/config (NOT Saved/…) directory. My project did not have the file so I created it and added it to the solution.

[/Script/Engine.GameUserSettings]
bUseVSync=False
ResolutionSizeX=640
ResolutionSizeY=960
FullscreenMode=2
WindowPosX=-1
WindowPosY=-1

I can verify when I package the game my settings are written out to the following directory:

Packages/[project]/Saved/Config/CleanSourceConfigs/GameUserSettings.ini

However, the problem seems to be whenever the EXE is ran it uses (what I assume) are ini files found from the following directory:

Packages/[project]/Saved/Config/WindowsNoEditor/GameUserSettings.ini

What is even more interesting is that ALL of the ini files in that directory have NOTHING in them. They are all 1k (blank). The 2nd post says to just manually edit the GameUserSettings.ini file in that directory but the problem is that whenever I run the EXE it clears them all out. I assume it is supposed to copy all .ini files from the CleanSourceConfigs to the WindowsNoEditor but it looks to be creating them every time with NOTHING in them. So I can’t even do what was suggested on the 2nd post.


Please help me figure out what the problem is.

Thanks,

Hi ,

I apologize for not getting to this post sooner. It appears that there may actually be two issues here:

  1. The .ini files are being wiped clean every time the packaged game is run.
  2. The default settings are not being applied.

I have been able to reproduce the first issue, and it certainly does not seem like this should be happening. I have entered a report to have this looked into (UE-8172). Depending on when the .ini files are being wiped clean, correcting this may also correct the 2nd issue. We may have to wait for a resolution to the first issue.

Hi ,

This was a bug in the game user settings. You can remedy this by adding:

Version=5

to your gameusersettings section.
Let me know if this doesn’t fix your issue.

/

Just a comment on the saved ini’s

Saved/.ini files should only contain options which differ from the config hierarchy, which is those in Default.ini, Base*.ini and .ini files

If you haven’t made any changes at runtime, these should usually be empty.

/

I launch my game using a .bat file like this:

MyGame.exe -VSync -ResX=1920 -ResY=1080 -FULLSCREEN

It works fine.

Sure it works fine but is not a real fix when there is still a bug in the settings being wiped out. I’ll try the other suggestion and get back to you.

How is this still an unfixed issue, honestly.

I read the developers note on this issue (UE-8172) but didn’t understand it.

Developer Notes:

This is by design. The
coalescedSourceConfig contains what is
gathered from that inis base, default
and platform ini files. Options from
the coalesced config will be used at
runtime unless the user has changes in
the Saved/*.ini which then ultimately
overrides this. Note, The
coalescedsourceconfig is generated on
each run.

Can someone explain this to me please? If these ini files are wiped clean after every run by design then where should they be set to control things like window size and resolution when package is run in standalone mode?

thanks,

1 Like

Hi simayi,

If you have settings that can be changed in a project during runtime, and want to store those values for the next time the project is run, you will want to save those values in the corresponding Saved/.ini files. Any values stored in the Saved/.ini files will take precedence over anything in the coalesced source config files that are generated each time the project runs.

Hi ,

Thank you for your reply. I don’t need resolution to change during runtime. I just would like to set it before runtime and not be wiped clean.

Sorry, I’m new to unreal and I didn’t quite understand exactly which Saved/.ini files you are talking about.

I created standalone projects from unreal and modified the following ini files

MyProject\WindowsNoEditor\MyProject\Saved\Config\WindowsNoEditor\GameUserSettings.ini

but when I run the project in standalone mode, all these files seem to be wiped clean.

When you said the values should be stored in corresponding Saved/.ini files, would you be more specific on exactly what the paths are so that the values are not wiped clean every time the project runs please?

thank you again,

Sorry for the delay. It’s been a while since I worked with config files, so I wanted to make sure I familiarized myself with it again. Setting the resolution in a config file needs to be done before the project is packaged, then the setting will be included and used in the packaged project. What you would want to do is create an .ini file in < Project >\Config\Windows (you may need to create the windows folder) and name it WindowsGameUserSettings.ini. The settings that you specify in this file will be the ones used when you run the packaged .exe.

Alternatively, if you need to be able to quickly adjust the config settings in the packaged project for testing, you can turn off the setting to create a PAK file when packaging. This results in all of the project files being available in the packaged project, including the config file that I mentioned above.

Al fin!, esta es la solucion para UE5.2 :ok_hand: muchas gracias ! Thanks for the solution :slight_smile: