Thank you this was very helpful!
So I recently switched from UE4 7.6 to 16.1, and I’m happy with the new version for the most part, but there’s something that was changed that I don’t know how to change back. A packaged product from 7.6 would start in Windowed mode (Which I want), but in 16.1, the packaged game starts in Full-screen mode. I don’t know where or if there is an option for this. How do I get it back to Windowed mode?
you can use the command “fullscreen” to switch between fullscreen and window mode.
a quick example:
in your level blueprint:
- from input>keyboard Events add “F12” key
- Add an “Execute Console Command” node
- in command section write “fullscreen”
- connect F12 to Execute console command
now if you run the game you can switch between fullscreen and window by pressing f12
if you connect the console command to “BeginPlay” Event the switch will happen right after you run the game, which i guess is what you want.
In your Config folder under the root of your project, you can create a DefaultGameUserSettings.ini file; this file is used to tell your game its startup graphics settings. (Once packaged, it will appear to the game as GameUserSettings.ini). To do this, create the above file in the specified location, then put the following text in it (ensure you delete any leading whitespace when copying and pasting):
[/Script/Engine.GameUserSettings] FullscreenMode=2 Version=5
This will tell your game to by default startup in windowed mode (according to the documentation, 0 is FS, 1 is windowed FS).
NB. Note that the version field is important; it must be 5 for 4.15 (I presume the same in 4.16; it must match the version specified UE_GAMEUSERSETTINGS_VERSION defined in Runtime/Engine/PrivateGameUserSettings.cpp.)
NB. Also note not to put DefaultGameUserSettings.ini in your Saved/Config folder. It must be in Config. It’s a really common mistake!
Should not need to bind a key, for me F11 does this by default.
Does this make it the default for every game owner ?
Would it not be better to have either command line parameters or an ini file somewhere that i could create to get the screen/window behavior i want ?
Fantastic advice, and thanks. I was already trying to do this in my project, but i’d overriden the GameUserSettings class with my own to add extra configuration values, this meant that it wasnt picking it up when i used [/Script/Engine.GameUserSettings] section. If you’ve overriden your GameUserSettings class in your game, use the absolute path to that class instead, e.g. [/Script/ProjectName.MyGameUserSettingsClassName]
Note: UE_GAMEUSERSETTINGS_VERSION is currently inside Runtime/Engine/GameUserSettings.cpp instead Runtime/Engine/PrivateGameUserSettings.cpp
With UE 4.25, the UE_GAMEUSERSETTINGS_VERSION value is here: \Engine\Source\Runtime\Engine\Private\GameUserSettings.cpp
Unfortunately, this doesn’t seem to be working properly for me. It works if I ‘Launch’ the game from within the Editor. However, for packaged games, the values seem to be ignored. I would appreciate any suggestions!
EDIT: Turns out this was user error, but in case it helps somebody else: make sure you delete your GameUserSettings.ini file from the application data directory if you want any changes you make to DefaultGameUserSettings.ini to show up. Once you run your application with a DefaultGameUserSettings.ini, those values will be copied to GameUserSettings.ini and override any updated or new ‘defaults’. I believe the typical directory would be
I was just testing this and came upon the very useful post by DerPurpelHelmut.
After some trial and error in 4.25 I did get it working in a packaged game.
The important resolution lines for the ini file appear to be:
If you’d like to change the fullscreen modes then:
The fullscreen modes available are: 0 = Exclusive Fullscreen, 1 = Borderless Fullscreen and 2 = Windowed mode.
I’m not entirely sure why it wouldn’t work for me without the LastConfirmed entries also being set since they should be automatically generated after the first launch I would have thought, but hopefully the above may help people on 4.25 should they run into problems.
There are also command line options, documented here.
MyGame.exe -windowed resx=800 resy=400
Doesn’t work. FullScreenMode, LastConfirmedFullscreenMode, PreferredFullscreenMode set to 2. Game starts in Fullscreen for a second. And only then runs the command I give it in game, to move to Windowed.
Also, DefaultGameUserSettings.ini IS by default in Saved/Config folder… it’s not there by ‘mistake’, but by design. I tried copying it to Config, makes no difference. Also, messing with the 3 values above by hand will create issues in game. Like when I move to fullscreen… the rez is all messed up. I have to apply windowed and fullscreen again to fix it. O o
fullscreen as a command by itself doesn’t seem to do anything. ‘r.setRes 1000x1000 f’ or ‘r.setRes 1000x1000 w’ with whatever rez you want… that does work.