Full options settings for a game

Hello,

I am looking for a tutorial / example for the complete setting of options for a video game. I can only find basic examples which show just 2 options but nothing for all the full options on the possible parameter sets of a game.
So I would like to be able to make a script that allows to modify all the options of a video game.

Thanks.

Steps to success:

  • make a list of those options you consider “all the options”

  • decide on a UI presentation for each type

  • add them all into your UI one at a time.

Remember: you are NOT going to work on them “all at the same time.” That’s not a thing. Solve each part of the overall problem one step at a time.

1 Like

It’s not a ui problem but a code problem.
I’m looking for a tutorial that shows how to make the full options of a game.

Options / settings / configuration stuff has the following parts:

  • a variable to store the state or value

  • a place to save it when the app isn’t running (PlayerPrefs?)

  • a UI to adjust it through its normal range of values

  • code that looks at this value and changes behaviour accordingly.

Which part are you stuck on?

PlayerPrefs is the best to save it ?

What are all the options available ? all is here https://docs.unity3d.com/ScriptReference/QualitySettings.html ?

This is engineering. We make tradeoffs. Everything is “the best” in some context or other. If you’re making a game jam with 1 setting, yeah, PlayerPrefs is absolutely best. If you are making something with 500 different options, perhaps some other type of persistence would be “the best.”

No, not everything is there and a lot of stuff there is not relevant unless you have actually spent the effort to use those features in your game. There is no such thing as “all the options”. Every time you use any Unity API or feature it could potentially be customized using an option, every time you add a new feature to your game it could potentially be controlled by option. A lot of stuff will vary between games because: not all the games use all the features of engine, implementing certain functionality is up to the game developer, certain features can be used in different ways and combinations, certain features can be implemented using different approaches, some features require extra packages and manual work to implement. Changing Unity QualitySettings will have no effect if you have your own custom implementation for corresponding graphics effect. Exposing settings for Unity features which you don’t use will only make the players frustrated due to the options not doing the thing they claim and having to waste time searching for settings which actually work.

If you have to ask question like this then most likely it will be a lot more valuable for the players if you implemented good: resolution and scaling settings, volume controls, input rebinding, accessibility, UI and gameplay settings. All of those are more or less dependent on the game with no single best or correct solution. Resolution and scaling behavior will depend on how flexible you made your UI (flexible UI is up to you), and the art style (nicely scaling pixel art is not the same as resizing window with 3d graphics), your chose of Camere components and how you use them, any nontrivial graphic pipeline and rendering passes for implementing special effects. Volume controls will depend on how complex sound system you setup and how finely you group your sound effects. Input rebinding will depend on how you read it (old input, new input, rewired, your own abstraction layer on top of any of the previous) does your game have local multiplayer modes, what kind of input devices does your game support? Stuff like hiding extra UI elements or finetuning UI size and positioning is up to you.

Even if you consider only graphic quality settings a lot of stuff is up to developer. Unity can’t know which parts which parts need higher resolutions textures more and which parts are less critical. It is up to you to create lower level 3d meshes and deciding which ones are fine to hide at distance. If you are writing fancy shaders it is up to you to write simplified versions of them and decide and when to use them.

2 Likes

You know what I would put in my options

windowed mode.

maybe you’re thinking post processing effect control. As all of the options. Gamma. Contrast. Brightness, Volume, frame rate, wire frame. Motion blur, run in background. Time scale. Inverted mouse. Language. Colour blind, subtitles, antibaliassing, sound test

I saw that it was wrong to use PlayerPrefabs, it writes to the windows registry, will never delete it and weigh it down.

Do you mean PlayerPrefs?

If you want to use PlayerPrefs to save your game, it’s always better to use a JSON-based wrapper such as this one I forked from a fellow named Brett M Johnson on github:

https://gist.github.com/kurtdekker/7db0500da01c3eb2a7ac8040198ce7f6

Then you can write that file wherever you like. Be sure you understand things like Application.persistentDataPath.

1 Like

Yes PlayerPrefs

I might suggest you prototype with PlayerPrefs since it’s so easy to use. Wrap it in your own method. Once you have the logic working, then add your custom save logic if you need.

2 Likes

No. Creating a graphical settings system in Unity is a real pain as quality settings doesn’t expose much of anything important. You have to do almost all of the work yourself by creating multiple render pipeline profiles, multiple post processing profiles, multiple LOD groups, etc and then write code that switches between them.

You speak about URP?

Built-in, URP, and HDRP. What I mentioned above is applicable for all three minus render pipeline profiles which are URP and HDRP only. There is simply no easy way to build a graphical settings menu.

Why you suggest to use JSON-based wrapper?

It was a direct response to your random musings here:

Do you remember writing the above?

Yes i know

thank you for your answer . you answered one of them. if you could link a documentation page that has these unity APIs listed . it would help out a lot. thanks

I wish it were as simple as linking a page to people because then these threads would be easily solved but instead it’s many pages covering many systems. I’m not a graphics programmer either so I don’t know where most of them are.

1 Like