# Persistent configuration (`questshock.config.json`) QuestShock can load a persistent, human-editable configuration file at startup, in addition to (and independent of) the engine's own `prefs.txt`. - **Location**: `/sdcard/questshock/questshock.config.json` - the same folder you already copy `res/data`/`res/sound` into (see README.md section 5.1). - **Format**: plain JSON, grouped by concern. Each top-level key is a *group*; each key inside a group is one *option*. - **Loading**: read automatically at app startup, before the splash screen, if the file exists. If it doesn't exist, nothing changes - the engine behaves exactly as it did before this file existed (driven by `prefs.txt` as usual). - **Saving**: never automatic. In-headset, open the menu (controller menu button) and press **Save Configuration** to write the file from your current live settings, overwriting it if present. Press **Load Configuration** to re-read the file and apply it without restarting the app. - **Live vs. restart-required**: every option below is tagged as either *live-appliable* (applying it while already playing takes effect immediately) or *restart-required*. Pressing **Load Configuration** applies every live-appliable change straight away; if the file also changes something restart-required, a dialog lists exactly which option(s) need it and offers: - **Dismiss** - keep playing with the live-appliable changes already applied; the restart-required option(s) stay as they were. - **Restart Now** - relaunches the app, which re-runs this same startup load and so applies every group in the file, including the restart-required ones. (Every option currently documented below is live-appliable, so this dialog won't actually appear yet - it's built in for options added in a future version that do need a restart.) - Unrecognized groups/keys are ignored (harmless if you're editing the file in advance for a future version). An invalid value for a *specific* option (see each option's possible values below) is logged and that one option is skipped - every other valid option in the file still applies. A file that isn't valid JSON at all is ignored entirely, with nothing applied. - `questshock.config.json` and `prefs.txt` are fully independent - loading or saving one never reads or writes the other. ## Example ```json { "video_options": { "renderer": "opengl", "resolution": "1024x768" }, "general": { "language": "english" }, "player_position": { "x": 0.0, "z": 0.0, "yaw_degrees": 0.0 } } ``` ## Video Options (`video_options`) ### `renderer` Which renderer the game uses to draw the 3D view. - **Type**: enum - **Possible values**: `"software"`, `"opengl"` - **Restart required?**: No (live-appliable) ### `resolution` The game's internal rendering resolution. - **Type**: enum - **Possible values**: `"320x200"`, `"320x400"`, `"640x400"`, `"640x480"`, `"1024x768"` - **Restart required?**: No (live-appliable) ## General (`general`) ### `language` The game's UI/text language - both the game's own resource strings and this project's own menu/keyboard chrome text (title bar, buttons, etc.). - **Type**: enum - **Possible values**: `"english"`, `"french"`, `"german"` - **Restart required?**: No (live-appliable) - applies the same way the game's own in-game options menu applies a language change (reloads the language-specific resource files and refreshes the inventory/MFD/side-icon UI immediately). - **Note**: French and German both need their own full resource pack (`frnstrng.res`/`mfdfrn.res`, `gerstrng.res`/`mfdger.res` under `res/data/`) - if any of those files aren't present, the switch is refused (logged, `questshock.config.json` and the current language are left unchanged) rather than leaving the game with no valid resource file open. See README.md section 3 ("Game assets") for where `mfdfrn.res`/ `mfdger.res` come from - the GOG Enhanced Edition installer alone doesn't include them. ## Player Position (`player_position`) Where the player is virtually standing/facing, independent of - and not reset by - starting a new game or loading a save (same independence from `prefs.txt`/savegames as every other group here). Set by moving around in-headset (menu open, left thumbstick snap-turns, right thumbstick smooth- moves) to line yourself up with the game quad ("virtual screen"). Height is never included here - it always comes from your real tracked headset height, not this file. **Startup fallback**: only applied at startup if all three fields (`x`, `z`, `yaw_degrees`) are present - a config file with none of them (or none at all), or a partial/hand-edited one missing any of the three, falls back to an automatic recenter instead (see **Reset Position** below), using your real head pose at that moment. A complete saved position is applied as-is, with no such recenter. **Reset Position** (Main Menu tab) is a separate, live-only action, not a config value: it recenters using your *current* real head pose, so the game quad ends up directly ahead of wherever you're actually standing/ facing right now - not a plain "go back to `(0, 0, 0)`" (which would only undo thumbstick movement, not any physical drift/rotation since the session started). It's unrelated to `questshock.config.json` - it never reads or writes this file. ### `x`, `z` Horizontal position, in meters, on the play space's floor plane. - **Type**: number - **Restart required?**: No (live-appliable) ### `yaw_degrees` Which way the player is virtually facing, in degrees. - **Type**: number - **Restart required?**: No (live-appliable)