Configuration
Loads and merges JSON into the shared state tree at startup; owns save slot helpers and run override blobs. Policy: Internal — no Unity adapter; not meant for arbitrary inbound calls from other services (still exposes a small function surface for tooling/overrides).
Code: Runtime/GnosisEngine/Source/Services/Persistent/Configuration/GnosisConfigurationService.cs (large; use outline search). User paths and bundled JSON go through IGnosisHostFileAccess (Unity: UnityGnosisHostFileAccess): CombineUserDataPath, TryReadUserDataText / TryWriteUserDataText, UserDataFileExists, and bundled loaders. Shared with mod discovery and other host features.
State (typical)
| Area | Branch | Purpose |
|---|---|---|
configuration.* | Persistent | Merged JSON roots (rules, themes, items, i18n, …) |
overrides / lastOverrides | Persistent | Pending / last-applied run override patches |
currentSlotId / lastSlotId | Persistent | Save-slot tracking (exact key names in source) |
Default + user persistent.json | — | Seeded by service on init |
How it looks in persistent.json
configuration (rules, themes, items, i18n, inputs, …) is merged at load from your data packs — far larger than a doc excerpt. Slot ids and override blobs are ordinary Persistent keys:
{
"Persistent": {
"currentSlotId": "slot1",
"lastSlotId": "slot1",
"overrides": {},
"lastOverrides": {}
}
}Use GetOverrides / SetOverrides (see Functions) to inspect or patch overrides at runtime.
Configuration manifest (Resources/Data/configuration.json)
Ship-only JSON (loaded from Resources, not the user save). Declares which data packs become configuration.* roots via the configs array (see source: LoadConfiguredJsonRoots).
shipPersistentPaths
Optional string array of dot paths from the root of persistent.json (for example Persistent.settings.version and Persistent.settings.logLevel). After the service deep-merges the user persistent.json over the Resources default, it copies each listed path again from the Resources default so shipped values win for those keys only. Use this so an update can refresh display metadata, default logging, or similar even when the player already has an older save on disk.
If the key is missing, not an array, or empty, no paths are re-applied that way.
In the real file, configs and shipPersistentPaths are siblings at the top level. The snippets below show each key in isolation so the shape is obvious; combine them into one configuration.json.
Example — configs
Each object needs id (becomes configuration.<id>), path (Resources path to the pack, no .json suffix), and kind (indexed | object | domains — see LoadConfiguredJsonRoots).
{
"configs": [
{
"id": "themes",
"path": "Data/Themes/index",
"kind": "indexed"
},
{
"id": "filters",
"path": "Data/Filters/index",
"kind": "object"
}
]
}Example — shipPersistentPaths
{
"shipPersistentPaths": [
"Persistent.settings.version",
"Persistent.settings.logLevel"
]
}Events
None.
Functions (InvokeFunction)
| Function | Parameters | Behavior |
|---|---|---|
GetOverrides | — | Returns Persistent.overrides node |
GetLastOverrides | — | Returns Persistent.lastOverrides node |
SetOverrides | overrides object (or object patch) | Merges into pending overrides |
SetOverride | key, value | Sets one top-level override key |
ClearOverrides | — | Clears pending overrides |
ClearLastOverrides | — | Clears last-applied overrides |
SetCurrentSlotId | slotId | Updates current/previous slot ids |
GetCurrentSlotId | — | { value: string } |
GetLastSlotId | — | { value: string } |
IsSlotFilled | slotId | { value: bool } if save file exists |
MarkSlotFilled | slotId | Writes slot marker file |
Usage example — GetOverrides (tooling / host)
private GnosisNode ReadPendingOverrides()
{
if (Context?.Store == null || Context.CallService == null)
return default;
var empty = GnosisNode.CreateObject(Context.Store);
var result = CallService("Configuration", "GetOverrides", empty);
return result.Success && result.Data.IsValid ? result.Data : default;
}When to open the source
New JSON pack types, merge order, Resources paths, localization load, and shipPersistentPaths — all live here. Prefer searching for Load, Merge, Resources, persistent.json, and shipPersistentPaths.