Download

[4.15] Simple analyzer & save/load settings

When you start a game project on PC you might want to create a blueprint to analyze the user PC specs and automatically adjust graphics settings. And you also want user to have possibility to change the settings and save them.
I am writing this because I saw a lot of outdated or incorrect methods of achieving this functionality.

After going through following steps, you will create functionality to:

  • when user first starts your game, it will analyze the PC specs and automatically adjust graphics quality level
  • a menu for user to change resolution, full screen mode and quality level settings
  • settings will be automatically saved

1. Create a new MainMenu level
click on File -> New Level -> Empty Level and open it
we will put the main menu HUD here

2. Create a Player Controller blueprint
we need this blueprint to always show our mouse cursor
right click on Content Browser -> Blueprints -> Blueprint Class -> Player Controller and name it PlayerCtrl_Menu
double click the new created blueprint to open it
set Auto Manage Active Camera Target: false
set Show Mouse Cursor: true
set Enable Click Events: true
set Enable Mouse Other Events: true

3. Create Game Mode blueprint
we need this to change the predefined game mode and enable mouse cursor on main menu level
right click on Content Browser -> Blueprints -> Blueprint Class -> Game Mode Base and name it Mode_Menu
set Player Controller Class: PlayerCtrl_Menu we created earlier
set HUD Class: none
set Default Pawn Class: none
set Pauseable: false
7c871796cab4f257c9fb425825fef5247176737a.png

4. Change Game Mode from World Settings
go to Window and make sure World Settings is checked
go to World Settings and set GameMode Override: Mode_Menu created earlier
this will change the settings for the current map

5. Create a Save Game blueprint
this should be the structure (collection) of variables that will be saved after game started for the first time
right click on Content Browser -> Blueprints -> search for SaveGame and select it; name it SaveGame_Benchmark and open it
on the left side click on + next to Variables to create a new variable named BenchmarkRan of type Boolean

6. Create Main Menu HUD
right click on Content Browser -> User Interface -> Widget Blueprint and name it MainMenu; open it
create a ComboBox named ComboResolution - we will display all avaiable resoultions here
create a Check Box named ChkFullscreen - checked if full screen or unchecked otherwise
create a ComboBox named ComboQuality and add default 4 options: Low, Medium, High, Ultra

8f5f4a9d8d9dc63a154cd04eac78b37afe771468.png

create a Canvas Panel, set Visibility: Hidden and put the earlier created items inside

4839ee5932c3e632a498678aee549cd4de8cbea6.png

create a Button named BtnOptions and, on the Details tab, click on + under Events on OnClicked event
follow the attached images for: Populate resolution combobox -> Set fullscreen value -> Populate quality combobox -> Show options panel

bf76f971a2a12b4b4400b5ac5bd0e37168ec88d7.png6768a3abc0a86341bf730f7c73177199b9f53c81.png15c464073c7b09146a40244ed089f94e58668aa3.png

create a Button named BtnSaveOptions and, on the Details tab, click on + under Events on OnClicked event
follow the attached images for: Set screen resolution -> Set fullscreen mode -> Set quality -> Apply and save settings

627f66859a9a1b5c12411a6bac8f557ff2b3a0d8.pngba7b8659b5fcb3888d8feb90237741fd85bf1bf0.png

7. Analyze PC specs on first run
this will detect if there is any save game file with specific name. if not, it will analyze the PC specs and save the file
click on toolbar -> Blueprints -> Open Level Blueprint
click on + next to Variables to add new variable named SaveBenchmark of type Save Game Benchmark we created at step 5
follow the attached images
e5b21bd6f17d4d81f97f73f61040c7427d42e983.png64622d4f1390e519f4d77708bf6ab867f0154001.png10a5e76690152180c9253fbd91b4cf0967cb3a3e.png

Feel free to ask if you have any question. If you find any issues please tell me to correct them.

Looks very handy. Thanks for your contribution to community with this free tutorial. :slight_smile: I’ll keep this thread on my notes.

Hello! I have followed the tutorial and fleshed out the menu, but im having issues. After the expansion of settings my texture quality stopped saving and working, and as far as i know the other settings dont work either, havent designed a world to test everything out yet. Any ideas on why stuff isnt working as its supposed to, and tips on what i can do to remedy this?