---
mvp: no
subsystem: save-load
---

# Save / Load (client-side)

The client persists very little to disk. Almost all game state lives on the server (player position, inventory, chat history, request queue). The client's local storage is restricted to user preferences:

- `BNO Data\Settings.bno` — the per-installation settings file written by **Script 0316 `save_settings`** and read by **Script 0318 `load_settings`**.

The settings.bno file is a plain-text file written via `file_text_open_write` / `file_text_write_string` / `file_text_write_real` / `file_text_writeln`. Despite the `.bno` extension (which evokes the binary format used elsewhere — see [decomp/wiki/16-bno-bnb-notes.md](../../decomp/wiki/16-bno-bnb-notes.md)), this particular file is text-mode. From `extracted/client-5-8/scripts/0316-save_settings.gml`:

```gml
sfile = file_text_open_write("BNO Data\Settings.bno");
```

And from `0318-load_settings.gml`:

```gml
sfile = file_text_open_read("BNO Data\Settings.bno");
```

The full file shape stores:

- Last server IP / port the user connected to
- Player's preferred display name
- Window mode (windowed vs full-screen)
- Sound toggles (despite the engine having no embedded audio — see [audio.md](audio.md))
- Navi colour preferences (the `set_navi_colors` / `set_user_colors` script outputs)

Beyond Settings.bno, the client does NOT read or write `.bno` / `.bnu` / `.bnb` binary save files. Those are SERVER-SIDE artifacts:

- `MSettings.bno` — server settings
- `MB_Log.bnb` — server-side message-board log
- Player accounts in `localList.txt` / `remoteList.txt` (the plaintext-credential files; SECURITY ISSUE — see CLAUDE.md hard rule #2)

Server-side persistence is **Phase 3 SDOC-03** scope. The client must not be allowed to write account state directly; that channel is closed.

## Key idioms

- **Text-mode `file_text_*`** is preferred over binary `file_bin_*` for human-debuggable settings.
- **Single canonical settings file.** All client preferences in one `Settings.bno`; no rolling/timestamped variants.
- **No autosave.** Settings are written only when the user opens Settings_Menu and clicks Save. There is no "save on exit" hook.
- **No client-side game-state persistence.** Player position, inventory, etc. are server-authoritative; the client retrieves on (re)connect.

## Scripts referenced in this subsystem

<!-- AUTOGEN:scripts:start -->
| Script ID | Name | Lines | Used in objects |
|-----------|------|-------|------------------|
| 0316 | save_settings | 32 | — |
| 0318 | load_settings | 37 | — |
<!-- AUTOGEN:scripts:end -->

## Objects referenced in this subsystem

<!-- AUTOGEN:objects:start -->
| Object ID | Name | Sprite | Mask | Events |
|-----------|------|--------|------|--------|
<!-- AUTOGEN:objects:end -->

## Engine functions used

<!-- AUTOGEN:gml-functions:start -->
| GML function | Call sites | Sample script | Wiki link |
|--------------|------------|---------------|-----------|
| `file_text_open_read` | 1 | 0318-load_settings | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `file_text_open_write` | 1 | 0316-save_settings | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `file_text_close` | 2 | 0316-save_settings | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `ini_open` | 0 | — | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `ini_read_string` | 0 | — | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `ini_close` | 0 | — | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `file_bin_open` | 0 | — | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
| `file_bin_close` | 0 | — | [wiki/07-gml-core-functions](../../decomp/wiki/07-gml-core-functions.md) |
<!-- AUTOGEN:gml-functions:end -->

## Rebuild guidance

For the Phase 6 client:

- **localStorage replaces Settings.bno.** Browser users have no filesystem; use `localStorage.setItem('rebno.settings', JSON.stringify(...))`.
- **Migrate at first run.** If a user has the original BNO installed, the rebuild client cannot read `C:\Program Files\BNO\BNO Data\Settings.bno` (no filesystem access from browser). Settings start fresh on rebuild; document this as expected behaviour.
- **Account state is server-only.** The client never holds a password (argon2id at the server only — CLAUDE.md hard rule #2). The auth token (a server-issued session JWT or similar) lives in `localStorage` or `sessionStorage` per Phase 4 design.

## See also

- [decomp/wiki/16-bno-bnb-notes.md](../../decomp/wiki/16-bno-bnb-notes.md) — server-side `.bno` / `.bnb` / `.bnu` notes
- [client-networking.md](client-networking.md) — the channel through which game state arrives (and is never persisted client-side)
- Phase 3 plan SDOC-03 — server save format reverse engineering
