How to Auto Detect a PC's Graphics Settings?
On startup of a UE4 game, how does UE4 automatically recognize hardware and set the correct Graphics Settings, specifically Resolution and maybe Fullscreen?
I'd like to be able to save that and set it automatically and save it to preference.
asked Jul 12 '17 at 09:13 PM in Blueprint Scripting
There are blueprints to get all of that information. Here's just a few to get you started:
Get Supported Fullscreen Resolutions
Get Viewport Size
Get Default Resolution
Get Convenient Windowed Resolutions
Get Fullscreen Mode
Set Fullscreen Mode | Mode Options (Fullscreen, Windowed Full Screen, Windowed)
and so forth...
Create two ints, X and Y and write them to a file, either using a save method or your own file io function. Sorry to be a little vague on this part, but it should be pretty straight forward once you know how to get the resolution variables. Also, remember that any return structs can be split into individual values in blueprints. So Get Resolution will return a struct that can be split so that you can grab individual values such as size X and size Y.
Where to add the "Auto Logic"
I recommend adding any logic in the level blueprint in which you will be representing the "Main Menu" for your project. What I have done in past projects is create a level in which only has a single role, to spawn a main menu user widget and add it to the viewport. Use the widget to allow the user to customize resolutions and graphic behavior, and let the level blueprint read from some file, the last set values for resolution and fullscreen settings. Just a thought, sorry to rush the answer, just hate to see you stuck.
You won't be able to personally mess around much with the engine itself without the source. (Which is C++)
Follow this question
Once you sign in you will be able to subscribe for any updates here