# Architecture

**Analysis Date:** 2026-05-01

## Pattern Overview

**Overall:** Preservation-and-revival monorepo. Three logically distinct subsystems share one tree:

1. **Reverse-engineering knowledge base** (`decomp/`) — pure documentation; the methodology used to recover `.gmd` source from compiled `.exe` runners.
2. **Original-game artifact archive** (`legacy/`) — raw historical binaries, sources, server state, and asset pipelines for *Brand New Online* (BNO), a Game Maker 5.3a multiplayer game (2008–2014), plus its abandoned Unity port (2014–2017) and Maya asset pipeline.
3. **Reproducible mirror provenance** (scripts in `legacy/.mirror*.js` + `legacy/.mirror-report.json`) — Node tooling that pulled the archive from two source machines on 2026-05-01 over voidtools Everything HTTP/ETP.

There is no application being built or run from this repo. It is an archive + research workspace. "Architecture" therefore describes how the historical artifacts relate to each other and to the recovery pipeline that targets them, not a live runtime topology.

**Key Characteristics:**
- Brownfield / archival. No git history inside the artifact tree (versioning was filename-based, e.g. `5-2 DEBUG`, `5-6 TSide Revamp`).
- Two parallel game implementations of the same IP: the canonical Game Maker 5.3a build (working) and the abandoned Unity port (incomplete).
- Three coexisting server snapshots from two physical machines, each at different points in the live game's history.
- Documentation in `decomp/` is the active product; everything in `legacy/` is the input corpus it operates on.

## Subsystems

**`decomp/` — Reverse-Engineering Knowledge Base**
- Purpose: Searchable wiki + long-form research report on extracting `.gmd` source from Game Maker 5.3a `.exe` runners.
- Location: `decomp/`
- Contents:
  - `decomp/GameMaker 5.3a Reverse Engineering Pipeline.md` — long-form source report (the wiki's input).
  - `decomp/wiki/` — 19 short cross-linked Markdown pages derived from the report, organized by task (extract `.gmd`, parse format, recover from `.gb1` backups, evaluate tools, look up GML syntax).
- Depends on: nothing (self-contained Markdown).
- Used by: humans/agents performing extraction work against `legacy/`.
- Entry point: `decomp/wiki/README.md` (task-keyed jump table).

**`legacy/open-source-release/` — Canonical 2014 Public Drop**
- Purpose: The final shipped artifacts, treated as the canonical "main" build of the game.
- Contains: `BN Online Master 5-4a.exe` + `BN Online Master 5-4.gmd` (server) and `BN Online Client 5-8.exe` + `BN Online Client 5-8.gmd` (client), plus `39dll.dll` (TCP/IP transport), the wire-protocol opcode table (`BN Online Message ID's Table.xls`), operator key reference (`,ServerCommands.txt`), watchdog (`Server Saver.exe`), and a sample `UserData/` snapshot (Areas, HXB, Inv, MB_News).
- Role: Decompilation target of first resort — `.gmd` source is present, so this build is recoverable as plain GML.

**`legacy/source-archive/` — Full Version History**
- Purpose: Filename-versioned chronology of every Client (v1 → 5-7) and Master (v1 → 5-3) build that was retained, including paired `.gmd` (source), `.exe` (binary), and `.gb1` (auto-rotation backup) where each existed.
- Subtrees:
  - `BNO/` — bulk of 2009–2010 client + master builds, plus PSDs, sprite sheets, signature graphics, and a parallel `BNO/BNO_Server/` dev tree.
  - `BNO_Server/` (sibling) — earliest 2008 master builds (v2 → v4).
- Role: Time-machine for recovering pre-5-4a behavior or comparing protocol drift across versions. The `5-4` client `.gmd` is *only* in `open-source-release/` (and never compiled to `.exe`).

**`legacy/servers/` — Live-Server State Snapshots (×3)**
- Purpose: Three independent dumps of running BNO servers, each preserving real-world `UserData/`, message-board logs (`MB_Log.bnb`, `MB_News/`), settings (`MSettings.bno`, `Settings.bno`), and operational tooling (`Account Updater.exe`, `Accounts Reloader.exe`, `Server Saver.exe`, `Crasher.exe`).
- Snapshots:
  - `enlyzeam-current/` — 2021 refresh of `E:\GM Games\BNO_Server\`. Richest user data and message-board logs.
  - `enlyzeam-archive/` — older `D:\BNO_Server\` snapshot (~2013–2017), parallel to current.
  - `local-current/` — `E:\BNO Official Server\` (FRAGZON machine). Run more recently but missing some logs.
- Role: Source of real protocol traffic, real save-format examples, and real operator tooling. The Open Source Release wiped historical message-board logs, so these snapshots are the only place they survive.

**`legacy/unity-project/` — Abandoned Unity Port ("BNO Successor")**
- Purpose: 2014–2017 attempt to rebuild BNO in Unity 5.x. Abandoned 2017-05.
- Structure:
  - `Assets/_Scripts/` — 11 `.cs` files. Notable: `Networking/NetMenu.cs` + `Networking/SerializePlayer.cs` (Photon-based multiplayer), `SectorTrigger.cs`, `ShaderManager.cs`, `ShaderHeightControl.cs`, `TextureAnimator.cs`, `SideTextureRotationTest.cs`.
  - `Assets/_Scenes/` — 3 `.unity` scenes (`test.unity`, `test_new.unity`, plus a Dropbox-conflicted copy).
  - `Assets/_Models/` — `.obj` tile / portal / slope geometry from the Maya pipeline.
  - `Assets/Plugins/` — `Photon3Unity3D.dll` (multiplayer transport).
  - `Assets/Editor/TileManager.cs` — editor-side tooling.
  - `Assets/Player/` — player prefabs + scripts.
  - `Library/`, `obj/`, `Test Builds/{Android,Windows}/` — build cache + prebuilt APKs/`.exe`.
  - Many `*conflicted copy*.csproj/.sln/.dwlt` files from Dropbox sync wars (the historical multi-collaborator artifact, intentionally retained).
- Role: Secondary subject of preservation; not actively built. Working title in `.csproj` names is "BNO Successor".

**`legacy/maya-project/` — Asset Pipeline (2014–2016)**
- Purpose: 3D source for Unity port assets.
- Structure:
  - `scenes/` — `megaman_rig*.mb` (rig versions 1–5), `megaman_anim_v00{1..5}.mb` (animation), `latlong_render.mb` (environment).
  - `scenes/export_to_unity/` — exported `.obj` tile geometry that lands in `unity-project/Assets/_Models/`.
  - `scenes/dev/`, `scenes/source/` — work-in-progress scenes.
  - `images/` — render outputs (`latlong_render__*.exr`, Nuke transform `.nk`).
  - `sourceimages/` — texture PSDs/PNGs.
  - `workspace.mel` — Maya project marker.
- Role: Upstream content pipeline feeding the Unity port.

**`legacy/audio/` — Music + VO**
- `bno-songs/` — 10 MIDI files (MMBN3/4/5 themes, EXE themes, cyberworld) used as in-game music.
- `quotes/` — single Brandon Smith voice clip (`Zig Zag or Joog Jaug_.mp3`).

**`legacy/open-source-release-extras/` — Sibling Files to OSR**
- `BN Online Client 5-8.exe` — duplicate of OSR client.
- `Game Maker 5.3a/gmaker5.3a.zip` + `registration.txt` — IDE installer needed to reopen `.gmd` files natively.

**`legacy/.mirror.js`, `.mirror-fix.js`, `.mirror-report.json` — Provenance / Mirror Tooling**
- Node scripts that originally pulled the archive from two source machines via voidtools Everything HTTP/ETP.
- Per-bucket fetch report retained for reproducibility.

## Data Flow

**1. Recovery flow (decomp → legacy, for BNO source not already paired with `.gmd`)**

```
legacy/<some>.exe  ──► [methodology in decomp/wiki/15-extraction-pipeline.md]
                        │
                        ├─ Tier 1: pair with sibling .gb1 auto-backup (decomp/wiki/14-gb1-backups.md)
                        ├─ Tier 2: dynamic memory dump while runner decrypts payload (decomp/wiki/02-encryption.md, 09-tool-gmd-recovery.md)
                        ├─ Tier 3: static decompiler v2.1 (decomp/wiki/10-tool-gm-decompiler-v21.md)
                        └─ Tier 4: parse .gmd directly (decomp/wiki/03-gmd-format.md, 04-dnd-serialization.md)
                        │
                        ▼
                  recovered .gmd / GML source
                        │
                        ▼
              re-open in Game Maker 5.3a IDE
                  (legacy/open-source-release-extras/Game Maker 5.3a/)
```

For the canonical `5-4a` master and `5-8` client, this flow is short-circuited: `.gmd` source is already in `legacy/open-source-release/`.

**2. Runtime flow (original game, historical — for reference only)**

```
Client.exe (Delphi 5 runner stub + appended ZLIB+XOR'd .gmd payload)
       │  decrypts payload to RAM, instantiates GML VM (decomp/wiki/05-gml-vm.md)
       │
       ▼
  39dll.dll  ◄──── TCP/IP, opcodes per legacy/open-source-release/BN Online Message ID's Table.xls
       │
       ▼
Master.exe (same Delphi runner pattern)
       │
       ▼
  on-disk state in <server>/UserData/
       ├─ Areas_*.bnu          (world / area data)
       ├─ HXB/Bridges_*.bnu    (bridge / connection data)
       ├─ Inv/                 (inventories)
       ├─ MB_News/News_*.bnu   (message-board posts)
       ├─ MSettings.bno        (master settings)
       ├─ Settings.bno         (client/shared settings)
       └─ MB_Log.bnb           (message-board log)
```

`.bno` / `.bnb` / `.bnu` are proprietary BNO formats; per `decomp/wiki/16-bno-bnb-notes.md` their layout becomes self-evident once GML source is recovered.

**3. Unity-port pipeline (parallel, abandoned)**

```
maya-project/scenes/*.mb
       │  Maya export
       ▼
maya-project/scenes/export_to_unity/*.obj
       │  copied/imported
       ▼
unity-project/Assets/_Models/*.obj
       │  referenced from scenes + prefabs
       ▼
unity-project/Assets/_Scenes/*.unity
       │  Unity 5.x build (Photon transport)
       ▼
unity-project/Test Builds/{Android/*.apk, Windows/*.exe}
```

## Entry Points

**Documentation entry:** `decomp/wiki/README.md` — task-keyed table directing readers to the right wiki page.

**Long-form research entry:** `decomp/GameMaker 5.3a Reverse Engineering Pipeline.md` — the comprehensive source report.

**Archive entry:** `legacy/README.md` — describes every bucket, its provenance machine + path, and dedup decisions.

**Canonical game binaries:**
- Server: `legacy/open-source-release/BN Online Master 5-4a.exe`
- Client: `legacy/open-source-release/BN Online Client 5-8.exe`

**Canonical game source (reopen in GM 5.3a IDE):**
- Server: `legacy/open-source-release/BN Online Master 5-4.gmd`
- Client: `legacy/open-source-release/BN Online Client 5-8.gmd`

**IDE installer (required to open `.gmd`):** `legacy/open-source-release-extras/Game Maker 5.3a/gmaker5.3a.zip`

**Wire-protocol reference:** `legacy/open-source-release/BN Online Message ID's Table.xls`

**Operator command reference:** `legacy/open-source-release/,ServerCommands.txt`, `legacy/servers/enlyzeam-current/Ctrl+O Codes.txt`

**Mirror reproduction:** `legacy/.mirror.js`, `legacy/.mirror-fix.js` (Node, query Everything HTTP on each host, fetch via `fs.copyFile` locally or curl over Everything ETP remotely).

**Unity-port build:** `legacy/unity-project/BNO Unity Project.sln` (`-csharp.sln` for the C#-only flavor) — Unity 5.x; `ProjectVersion.txt` in `ProjectSettings/`.

## Error Handling

Not applicable to an archive. Process-level recovery posture:

**Mirror:** `legacy/.mirror-report.json` records 0 fetch failures from the 2026-05-01 pull (778 MB / 7958 files). `.mirror-fix.js` exists specifically because the initial query missed name-less files.

**Game runtime (historical):** `Server Saver.exe` is a watchdog; `Crasher (Test With Server Saver).exe` is its companion failure-injection tool. Both ship in `legacy/open-source-release/` and every `legacy/servers/*/` snapshot.

## Cross-Cutting Concerns

**Versioning:** Filename-based throughout BNO history. No SCM. Versions like `5-2 DEBUG`, `5-6 TSide Revamp`, `5-4a` are the source of truth. The Unity port has no SCM either; Dropbox sync conflicts (`*conflicted copy*` files) are the only branching record and are intentionally retained.

**Provenance:** Recorded in `legacy/README.md` (per-bucket source machine + path table) and `legacy/.mirror-report.json` (machine-readable). Two source machines: `enlyzeam` (UHREMUARRE 2TB merged drive) and `local` (FRAGZON).

**Networking transport:** `39dll.dll` (Game Maker TCP/IP DLL by 39ster) is bit-identical and present in `legacy/open-source-release/`, every `legacy/servers/*/`, and `legacy/source-archive/`. Documented at `decomp/wiki/08-39dll-networking.md`.

**Proprietary formats:** `.bno` (settings), `.bnb` (binary blob, e.g. message-board log), `.bnu` (per-record user data). Strategy: read the GML in the recovered `.gmd` rather than reverse them in isolation. See `decomp/wiki/16-bno-bnb-notes.md`.

**Open-source-release dedup note:** OSR wiped historical message-board logs. For real-world MB content, use `legacy/servers/enlyzeam-current/UserData/` instead.

**Secrets:** None expected in this archive. `RealVNC Enterprise Edition 4.4.2 (Keygen by ZWT)` directory exists under `legacy/servers/local-current/` — do not redistribute; preserved only as historical context for how the live server host was administered.

---

*Architecture analysis: 2026-05-01*
