# 16 — Project-Specific Formats: `.bno` / `.bnb` / `.bnu`

> **ERRATA 2026-05-03 (Phase 3 SDOC-03 / D-08):** Earlier revisions of this
> document asserted `.bno`/`.bnb`/`.bnu` use `file_bin_*` GML primitives.
> Verified ground truth in `extracted/server-5-4/scripts/0365-mb_backup.gml`
> and `0367-users_restore.gml` — these formats use `file_text_*` (line-based,
> with `@TOPIC`/`@REPLY` section markers in `.bnb`). The 39dll `file_bin_*`
> paradigm does not match shipped behavior.

The target project uses proprietary file extensions `.bno`, `.bnb`, and `.bnu` for save states / custom data.

## Key insight: do not research them externally

These formats are **not** documented anywhere outside the project's own GML. There is no public spec, no community tool, no third-party library. External research will yield nothing.

The parsing/serialization logic for `.bno`, `.bnb`, and `.bnu` lives **inside the project's own GameMaker scripts**. Once `.gmd` extraction succeeds (per [15-extraction-pipeline](15-extraction-pipeline.md)), the code that reads/writes them becomes directly readable.

## Where to look in extracted GML

After extracting and parsing the `.gmd`, search the Scripts block for:

- File I/O primitives: `file_text_open_read`, `file_text_open_write`, `file_text_read_string`, `file_text_read_real`, `file_text_readln`, `file_text_write_string`, `file_text_write_real`, `file_text_writeln`, `file_text_eof`, `file_text_close`. Save formats use the `file_text_*` GML primitives (line-based, NOT byte-based). Note: `file_bin_*` byte-oriented primitives exist in GML but BNO did not use them for `.bno`/`.bnb`/`.bnu` save formats — confirmed via grep across `extracted/server-5-4/scripts/` (see `0365-mb_backup.gml`, `0367-users_restore.gml`).
- Calls to 39dll buffer functions ([08-39dll-networking](08-39dll-networking.md)) — the network protocol uses a separate byte-stream paradigm and does NOT share its serialization with these save formats.
- String literals containing `".bno"`, `".bnb"`, or `".bnu"`.
- `external_call` / `external_define` ([07-gml-core-functions](07-gml-core-functions.md)) — possible third-party DLL serialization (not used by the verified backup/restore scripts).

The reading sequence in the GML **is** the format. Same principle as 39dll packets: **structure = call order**. The difference is that save formats serialize as ASCII lines (one value per `file_text_writeln`), with optional ASCII section markers (e.g. `@TOPIC` and `@REPLY` in `.bnb`) delimiting record groups.

## Strategy

1. Extract `.gmd` (Ranks 1–3 of [15-extraction-pipeline](15-extraction-pipeline.md)).
2. Walk Scripts block. Grep for filename patterns.
3. Map every `file_text_write_*` and `file_text_read_*` site (i.e. all `file_text_*` calls) for `.bno` / `.bnb` / `.bnu` (NOT `file_bin_*` — see ERRATA above).
4. Reconstruct the line-by-line layout from the call sequence, recording any `@TOPIC` / `@REPLY` style ASCII section markers as record-group boundaries.
5. The save-format byte stream does **not** flow over the network in the same shape — the 39dll wire protocol is independent. See [08-39dll-networking](08-39dll-networking.md).

## Do NOT

- Spend time reverse-engineering `.bno` / `.bnb` / `.bnu` blindly via hex inspection before extracting `.gmd`. The GML reveals it for free.
- Assume any standard format. These are bespoke per-game.
- Assume `file_bin_*` byte primitives — the corrected primary claim is `file_text_*` (see ERRATA above and ground-truth scripts).

## Ground-truth references

- `extracted/server-5-4/scripts/0365-mb_backup.gml` — `.bnb` writer using `file_text_open_write` + `file_text_write_string` + `file_text_writeln`, with `@TOPIC` / `@REPLY` ASCII section markers between record groups.
- `extracted/server-5-4/scripts/0367-users_restore.gml` — `.bnu` reader using `file_text_open_read` + `file_text_read_string` + `file_text_readln` + `file_text_eof` flat-loop pattern.

## See also

- [03-gmd-format](03-gmd-format.md) — extraction prerequisite
- [07-gml-core-functions](07-gml-core-functions.md)
- [08-39dll-networking](08-39dll-networking.md) — independent byte-stream paradigm (not shared with `file_text_*` save formats)
- [15-extraction-pipeline](15-extraction-pipeline.md)
