Settings

How to declare player settings as data, read and write them from your game, and offer quality presets.

Settings are the options a player changes — volume, graphics quality, resolution, accessibility choices. GS_Play lets you declare them as data and handles the rest: applying each one to the engine, saving them, and restoring them next launch.

You do not write loading code, saving code, or apply code. You author what the options are and what each one drives.

For architecture details and the full API, see the Framework API reference.

 

Contents


Declaring Settings

Settings are authored as data, not code. Create an Options Profile asset and add an option for each thing your game exposes.

Every option carries:

FieldWhat it is
KeyThe name your code and presets use, e.g. audio.master.
Display NameWhat the player sees.
CategoryWhich page it belongs on — Graphics, Audio, Display, Gameplay, Accessibility, Controls.
DescriptionTooltip text.
Apply targetWhat it actually does when changed.

Pick the option kind for the widget you want — a toggle, a slider with min/max/step, a dropdown with labelled entries, or a colour picker.

The apply target is the part worth pausing on. It is what connects the option to the engine: a console variable, the window mode, the resolution, an audio channel’s volume — or nothing at all, if the value is just something your own game code reads.

You can assign more than one profile. They merge by key, so a project can layer its own options over a supplied set.


Reading and Writing Settings

Setting a value applies it, saves it and notifies listeners in one call. You never have to apply or save separately.

NeedMethod
Read a valueGetOptionBool / GetOptionFloat / GetOptionInt / GetOptionString
Change a valueSetOptionBool / SetOptionFloat / SetOptionInt / SetOptionString
Restore one optionResetToDefault
Restore everythingResetAllToDefault
Get every option in a categoryGetOptionsByCategory
React to any changeOnOptionChanged on the notification bus

GetOptionsByCategory is how you build a settings screen without hard-coding it — ask for the Graphics options and build a row per key.

A tip worth taking: the ImGui debug menu renders your entire option catalog live, with the right widget for each option. Author an option, press play, and drive it before you build any UI for it.


Presets

A preset is a named set of values — Low, Medium, High. Create a preset asset, list the keys it sets and the values it sets them to, and assign it to the Options Manager.

Applying a preset overwrites those options, applies and saves in one action.

Presets have no state of their own. A preset counts as active only while every value it names still matches, so the moment a player nudges one slider, the active preset becomes Custom. That is the familiar behaviour, and it happens for free.


Quick Reference

NeedBusMethod / Event
Read a settingOptionsManagerRequestBusGetOptionFloat / Bool / Int / String
Change a settingOptionsManagerRequestBusSetOptionFloat / Bool / Int / String
Restore one settingOptionsManagerRequestBusResetToDefault
Restore everythingOptionsManagerRequestBusResetAllToDefault
List a category’s optionsOptionsManagerRequestBusGetOptionsByCategory
Apply a presetOptionsManagerRequestBusApplyPreset
Know which preset is activeOptionsManagerRequestBusGetActivePresetName
React to a setting changeOptionsManagerNotificationBusOnOptionChanged

Glossary

TermMeaning
Options ProfileAn asset declaring the settings a game exposes
Apply TargetWhat an option does to the engine when its value changes
KeyThe stable name a setting is stored and referred to by
PresetA named set of values, e.g. Low / Medium / High
CustomThe active preset name when values no longer match any preset

See Also

For the full API:

For related systems:


Get GS_Core

GS_Core - Explore this gem on the product page and add it to your project.