# Game Settings

The GameSettings plugin provides a complete settings system for your game, covering audio, video, and keybind configuration with a pre-built UI.

## Audio Settings

The **AudioSettingsData** manages:

* Master volume
* Music volume
* Sound effects volume
* Voice volume
* Mute toggles per channel

Players adjust these through sliders in the settings UI. Changes take effect immediately.

## Video Settings

The **VideoSettingsData** manages:

* Resolution
* Fullscreen mode (fullscreen, windowed, borderless)
* Quality preset
* V-Sync
* Frame rate limit

Video settings use Unity's built-in quality settings system.

## Keybind Settings

The **KeybindSettingsData** manages customizable key bindings. The system integrates with Unity's Input System.

**Keybind Category Entries** group related keybinds together (Movement, Combat, UI, etc.). Create these in the Spark Editor under the **Keybind Categories** tab.

The keybind UI shows all bindings organized by category. Players can click a binding and press a new key to remap it. The system handles:

* Conflict detection (warning when two actions use the same key)
* Reset to defaults
* Per-category organization

## Settings UI

The GameSettings plugin includes a complete settings UI:

* **GameSettingsUI**: The main settings window with tabs for each category.
* **AudioSettingsUI**: Audio settings panel with volume sliders.
* **VideoSettingsUI**: Video settings panel with resolution dropdowns and quality options.
* **KeybindSettingsUI**: Keybind settings panel with a list of remappable bindings.
* **KeybindRowUI**: Individual keybind row showing action name and current key.

## Custom Settings Panels

The settings UI uses a registry system (**GameSettingsUIRegistry**) that allows additional settings panels to be added. If you have a plugin that needs its own settings section, it can register a panel with the settings UI.

## Settings Events

* **GameSettingsLoadedEvent**: Settings were loaded from disk.
* **GameSettingsUIOpenedEvent**: The settings UI was opened.
* **GameSettingsUIClosedEvent**: The settings UI was closed.
* **KeybindChangedEvent**: A keybind was remapped.

## Persistence

Game settings save independently from gameplay saves. They persist globally, not per save slot. This means changing your volume in one save file changes it for all save files, which is the expected behavior for settings.

Settings are saved through **GameSettingsSaveProvider**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sparkframework.dev/documentation/user-guide/core-systems/game-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
