commit ce26468cb5560de6cfec27d74831f026a6e13008
parent 90d4998fb45858e73280fa68531fe85a46b6d64b
Author: anon <anon@example.com>
Date: Tue, 20 Oct 2026 15:31:56 +0000
Simplify README and move detailed guidance to developer docs
Diffstat:
11 files changed, 411 insertions(+), 355 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md
@@ -0,0 +1,9 @@
+# Test process cleanup
+
+Close native game clients, browser tabs and temporary servers started for tests
+between runs and before resource-intensive builds. Leaving them running wastes
+CPU and memory and can cause out-of-memory failures.
+
+Ensure cleanup also runs after failed tests, for example with `finally` blocks.
+Clean up only instances started for your tests. Keep user-owned instances and
+sessions explicitly requested for manual testing available until asked to stop.
diff --git a/DEVELOPERS.md b/DEVELOPERS.md
@@ -0,0 +1,370 @@
+# Developer guide
+
+Detailed setup, operation and maintainer notes for Anarchy Online 14.9.1.
+See [README.md](README.md) for the quick start and repository overview.
+
+## Server build and operation
+
+Game definitions and their provenance are embedded YAML in `server/gamedata`. Static resources
+live in `server/assets` and are embedded in the server. Build with Go 1.24 or
+newer from the repository root:
+
+```sh
+go build -o ao-server ./server
+./ao-server
+```
+
+Distribute `ao-server` by itself (or the corresponding Windows binary). It can
+run from an empty directory; static resources are served directly from the
+binary. Saved characters remain in `data/users/` and certificates in
+`data/https/`. Server logs go to `logs/server.log` and profiles to `logs/profiles/`.
+Back up `data/` when moving servers. Paths are relative to the working directory.
+
+The browser build is kept outside Git. Before building the server, copy the
+six matching files into `server/assets/client/`: `index.html`, `game.js`,
+`game.wasm.br`, `profile-worker.js`, `audio-worklet.js`, and `build.json`.
+For example, copy them from a client build machine:
+
+```sh
+rsync -a workstation:/path/to/ao/server/assets/client/ ./server/assets/client/
+go run ./server
+```
+
+No Emscripten, Python, Make, C compiler, or original Windows client is needed
+on the server build machine. Rebuild the Go binary after updating resources.
+
+Requires Go 1.24 or newer. The server listens on all network interfaces. Default
+ports are login 7500, world 7501, chat 7502, HTTP 8080 and HTTPS 8443. Chat uses
+the port immediately after the world port. From another machine,
+open `https://<server-address>:8443/` or `/control`. On first startup, Go
+creates a self-signed certificate in `data/https/cert.pem` and a private key in
+`data/https/key.pem`; both stay out of Git. Trust the certificate on the client
+machine before playing: shared WebAssembly memory requires trusted HTTPS.
+The certificate covers the server hostname and current IP addresses for one year.
+If those change, remove both files and restart to generate a new certificate.
+HTTP remains available, including `http://<server-address>:8080/control`.
+For an existing installation, move `local/https/` to `data/https/` before
+restarting to preserve the trusted certificate. Existing `local/profiles/` files
+can be moved to `logs/profiles/`. Server messages are appended to
+`logs/server.log` and also printed to the terminal.
+
+```sh
+go run ./server
+```
+
+## Browser client
+
+Open [the game](http://127.0.0.1:8080/) in a browser supporting WebAssembly
+JSPI, shared memory, OffscreenCanvas and WebGL 2. It loads automatically with a
+randomized Solitus visitor near Bronto Burger in Omni-Entertainment. A persistent
+cookie identifies your character on later visits; no account or training is
+required. New visitors start in run mode with character tips disabled.
+Click the game or press a key to enable sound.
+Two-finger scrolling (or a mouse wheel) rotates the browser camera. Right-button
+drag and Ctrl-drag also work; the game canvas suppresses the browser context menu.
+Press Ctrl+Alt+M (Control+Option+M on Mac), or tap Opt on mobile, for player settings. Switch
+between CSS pixels and Retina pixels while playing; the choice is remembered.
+Retina uses the screen's pixel density, making the original interface smaller
+and sharper as well as increasing rendering resolution.
+The menu also provides fullscreen and, on mobile, touch controls and a 1P/3P toggle.
+On mobile, Move controls forward/backward and strafing; swipe the world to steer
+and drag with two fingers to orbit. Spread or pinch those fingers to zoom in or out.
+Autorun keeps moving after releasing Move.
+Jump, Attack and Use buttons provide the common keyboard actions; inventory uses
+the game's native INV button.
+Tap the game to left-click, drag to move windows or items, and hold briefly for
+a right-click. Touch controls hide while settings or the chat composer is open.
+Tap Chat to open the phone keyboard; Send enters the message through the game's
+chat input. The composer accepts the game's Windows-1252 character set and
+reports unsupported characters before sending.
+Android Firefox has been tested on a Android phone. iOS Safari still crashes during
+startup and is not yet supported.
+Press Enter to chat nearby. `/tell Visitor81 hello` sends a private message;
+`/g Global hello` sends to everyone connected. `/whisper` and `/shout` change
+the vicinity range. Visitor names contain no spaces so they work in commands.
+[Server controls](http://127.0.0.1:8080/control)
+provide character editing, teleporting and time controls.
+
+Bronto Burger, Lush Fields and Newland have passed browser rendering, movement,
+inventory/map, audio and connection checks. Performance work and broader
+gameplay validation continue.
+For native clients, keep the server running in a separate terminal and use the
+commands below. Creating a character in server controls also works.
+
+### Build the browser client on Debian
+
+Only the client build machine needs this toolchain. Install the native build
+dependencies and the pinned Emscripten SDK once:
+
+```sh
+sudo apt-get install build-essential cmake pkg-config git python3 python3-brotli xz-utils ca-certificates
+mkdir -p toolchains
+git clone https://github.com/emscripten-core/emsdk.git toolchains/emsdk
+./toolchains/emsdk/emsdk install 6.0.12
+./toolchains/emsdk/emsdk activate 6.0.12
+```
+
+Build and publish the client:
+
+```sh
+make wasm -j8
+```
+
+This downloads/builds the audio dependencies, compiles the game, and writes the
+six files above to ignored `server/assets/client/`, which Go embeds when building. The first build is
+heavy; allow several gigabytes of build space and substantial compilation time.
+ThinLTO optimizes calls across source files with eight linker workers. Keep
+`src/build/wasm/lto-cache/` to reuse that work on subsequent builds.
+Publishing also caches Brotli compression in `src/build/wasm/web/`, so page-only
+updates reuse the compressed executable. The browser decodes it over HTTP.
+Copy the complete matching bundle to other machines after validating it. Do not
+mix JavaScript and WASM from different builds or commit generated client files.
+
+## Game data
+
+NPC definitions are editable YAML in `server/gamedata/zones/zone_<playfield>.yaml`.
+Each zone holds both reconstructed NPCs and its original population record:
+level ranges, radii, timings, flags, stats, hashes and offsets. Comments,
+confidence and provenance remain ordinary searchable fields. `Source` and
+`FixedSource` link the loaded definitions to their original records.
+
+`population_evidence.yaml` holds extraction evidence and shared confidence descriptions. `npc_names.yaml`
+retains guide sources and name confidence. `monsters.yaml` holds all 290
+appearance definitions; `items/` holds all 87,611 item and nano definitions,
+including serialized effects, requirements and undecoded bytes. Item catalog
+provenance and coverage live in `items.yaml`. Map coordinates, playfields and
+terrain extraction evidence have their own YAML files in the same directory.
+
+Go embeds these files and decodes them into typed structs at startup. Item files
+contain one YAML document per record, keeping temporary parser memory bounded.
+Rebuild and restart after edits; runtime does not read external game-data files.
+`types.go` defines the schemas and `load.go` loads and validates the embedded data.
+
+Every NPC group has an explicit stable `id`, independent of its position in a
+file. `gamedata.NPCGroups[id]` resolves its definition, and live NPCs retain that
+ID for Go behavior code. Keep existing IDs when editing or moving definitions.
+The current server has generic roaming logic; per-NPC chat and walking scripts
+can be implemented in Go against these IDs when needed.
+
+For bulk processing, `go run ./tools/data/export_gamedata` exports all loaded
+definitions and extraction evidence as JSON. `tools/data/generate_npcs.py`
+writes extraction candidates to `local/reports/` for review, leaving maintained
+YAML intact. `make assets` copies game resources from the top-level
+`anarchy-assets-14.9.1/` directory and derived data from `data/` into
+`server/assets/`. `make wasm` runs this step before building and publishing
+the browser client. Go embeds the ordinary files directly; there are no
+resource archives, split files or startup extraction. Asset checksums are
+prepared during copying so browser cache validation does not scan large files
+at server startup. Extraction tools write reproducible JSON candidates into
+ignored `local/data/` and `local/reports/`; these are optional review artifacts.
+The server uses embedded definitions. Offline regeneration reads fresh extraction
+candidates plus maintained map coordinates and name evidence from YAML.
+
+## Native clients
+
+### Original Windows client (PowerShell)
+
+```powershell
+Push-Location anarchy-vanilla-14.9.1
+$env:ANARCHY_CD = 'cd_image'
+$env:ANARCHY_SETUP = 'Setupf'
+.\Clientr.exe localtest localtest 1 2130706433 7501 0 0
+Pop-Location
+```
+
+### Rebuilt Windows client (PowerShell)
+
+Uses the local LLVM-MinGW toolchain. `make clean` is only needed to discard an
+existing build; `make` also builds from a clean checkout.
+
+```powershell
+& .\toolchains\llvm-mingw-20261006-ucrt-x86_64\bin\mingw32-make.exe -j4
+Push-Location anarchy-runtime-14.9.1
+$env:ANARCHY_CD = 'cd_image'
+$env:ANARCHY_SETUP = 'Setupf'
+..\src\build\windows\game.exe localtest localtest 1 2130706433 7501 0 0
+Pop-Location
+```
+
+### Native Linux (Debian 13, x86-64)
+
+Install dependencies once, including Go for the server:
+
+```sh
+sudo apt-get install build-essential pkg-config libsdl2-dev libgl-dev zlib1g-dev libsndfile1-dev libfreetype6-dev libfontconfig1-dev golang-go xwayland
+mkdir -p ~/.local/share/fonts/anarchy
+cp anarchy-assets-14.9.1/fonts/*.ttf ~/.local/share/fonts/anarchy/
+fc-cache -f
+```
+
+Start the server above, then build and run from a graphical desktop terminal:
+
+```sh
+make -j4
+(cd anarchy-assets-14.9.1 && SDL_VIDEODRIVER=x11 ANARCHY_CD=cd_image ANARCHY_SETUP=Setupf ANARCHY=. ../src/build/linux/game localtest localtest 1 2130706433 7501 0 0)
+```
+
+### Linux through WSL (PowerShell)
+
+Install the same build dependencies and fonts inside WSL. Run the server there
+as well so the client can reach it on localhost:
+
+```powershell
+wsl --cd /path/to/ao --exec go run ./server
+```
+
+In another terminal:
+
+```powershell
+wsl --cd /path/to/ao --exec make -j4
+wsl --cd /path/to/ao/anarchy-assets-14.9.1 --exec env GALLIUM_DRIVER=d3d12 ANARCHY_CD=cd_image ANARCHY_SETUP=Setupf ANARCHY=. ../src/build/linux/game localtest localtest 1 2130706433 7501 0 0
+```
+
+## Copying to Debian
+
+The Linux client needs an x86-64 desktop with OpenGL 3.3 or newer. Use the native
+GPU driver; `GALLIUM_DRIVER=d3d12` belongs only in the WSL command. The current
+window/input adapter and tests are validated with X11, so the native command
+selects SDL X11 explicitly. On a Wayland desktop this uses XWayland; direct
+Wayland operation is not yet validated. No Wine,
+32-bit Linux libraries, Windows toolchain, or original game DLLs are needed.
+The four local Verdana files above preserve the tested font choice; otherwise
+Fontconfig may silently substitute a different font. They remain local assets.
+
+From WSL, copy to your mounted destination or substitute an SSH destination:
+
+```sh
+rsync -a --chmod=D755,F644 --info=progress2 --exclude=/local/ --exclude=/old_wip/ --exclude=/toolchains/ --exclude=/venv/ --exclude=/src/build/ --exclude=/anarchy-vanilla-14.9.1/ --exclude=/anarchy-runtime-14.9.1/ --exclude=/patches/ --exclude=__pycache__/ --exclude='Screenshots/*' /path/to/ao/ /path/to/ao/
+```
+
+Keep `anarchy-assets-14.9.1/` and `data/`, including your `data/users/` files.
+The asset directory contains game data/configuration only; Windows launchers,
+DLLs and Miles audio plug-ins are excluded. All zones' assets are retained.
+Its preparation script is `tools/client/prepare_portable_assets.py`; ordinary
+builds and runs do not need that script or the Windows runtime directory.
+See the [asset audit](docs/portable-assets.md) for the isolation test and its scope.
+Stop the server while copying mutable state. Do not use Git's ignore rules as
+rsync exclusions: that would omit required local assets and server data.
+Do not reuse Ubuntu-built objects on Debian. In the destination, `make clean`
+then `make -j4` forces a native rebuild. Reduce parallelism if memory is tight.
+Some generated C files take several minutes and multiple GB of RAM to compile.
+The rsync permissions option avoids copying Windows-mounted files as executable
+source files. Python and the Windows virtual environment are not needed for
+ordinary builds.
+
+Debian 13 supplies the [SDL2 development package](https://packages.debian.org/trixie/libsdl2-dev)
+and [Go 1.24](https://packages.debian.org/trixie/golang). Its
+[libsndfile 1.2.2 package](https://packages.debian.org/trixie/libsndfile1-dev)
+also includes the MPEG decoder dependencies used by the Linux audio adapter.
+The server may need network access on its first build to download Go modules.
+
+## Repository layout
+
+| Path | Purpose |
+| --- | --- |
+| `src/game/` | Maintained reconstructed C for Clientr.exe and 33 game DLLs; edit directly. |
+| `src/runtime/` | Windows host, portable memory/runtime, and Linux platform adapters. |
+| `src/data/`, `src/vendor/` | Non-code game initializers and translated support libraries. |
+| `src/tests/` | Native contract and regression tests. |
+| `server/`, `data/` | Go server, extracted world data, and local saved characters. |
+| `server/gamedata/` | Embedded YAML definitions, provenance and Go schemas. |
+| `server/assets/` | Embedded static resources and their Go loader. |
+| `server/assets/client/` | Ignored browser build, embedded when building the server. |
+| `anarchy-vanilla-14.9.1/` | Local original game for Windows reference comparisons. |
+| `anarchy-runtime-14.9.1/` | Windows runtime assets and native vendor DLLs. |
+| `anarchy-assets-14.9.1/` | Portable game assets and configuration; no Windows executables or plug-ins. |
+| `tools/client/` | Client validation, Windows/Linux comparisons, and reconstruction utilities. |
+| `tools/data/` | Game-data extraction and its tests. |
+| `toolchains/` | Local downloaded Windows compiler; ignored. |
+| `data/users/`, `data/https/` | Mutable server state: characters and HTTPS credentials. |
+| `logs/` | Server log and uploaded browser profiles; ignored. |
+| `local/` | Ignored extraction data, development reports, screenshots, test fixtures, and downloaded references. |
+| `old_wip/` | Archived experiments and old baselines; not part of the current build. |
+| `docs/` | Architecture, reverse-engineering evidence, and validation history. |
+
+The early standalone 14.9.1 sources are preserved by the annotated Git tag
+`ao-14.9.1-source-baseline` (commit `c5cc2f3`, source directory `decompiled/`).
+All 34 module extraction hashes match the current baseline. See the
+[repository size and packaging notes](docs/repository-packaging.md).
+
+The obsolete 13.2 `client-target` installation was removed. Its preferences are
+retained under `local/client-target-prefs/`. The old 13.2 sources and release
+clients are archived locally under `old_wip/`; they are not build dependencies.
+
+## Maintainer handoff
+
+**The baseline is 14.9.1.** Preserve classic Rubi-Ka scenery and GUI.
+Performance work is currently paused for the portable browser handoff.
+Linux only needs windowed mode. Read [src/README.md](src/README.md) before changing the runtime.
+
+- Compile the checked-in sources directly. Do not regenerate `src/game/` over
+ manual edits. Generation and decompilation tools are optional archaeology.
+- Windows builds one 32-bit executable using native Windows/DirectX and vendor
+ libraries. Linux builds one 64-bit executable with translated support-library
+ C, SDL2/OpenGL, and Linux adapters. Neither build executes original game code
+ from external game EXE/DLL files. Keep that standalone property intact.
+- Guest addresses are 32-bit identities. Windows uses its fixed address layout;
+ 64-bit Linux uses a reserved 4 GiB guest address region, while the browser
+ translates guest memory through `guest_pages`. Guest pointers, handles
+ and function tokens must never be confused with host pointers. Preserve guest
+ layouts, calling conventions, stack cleanup, TLS, exception and callback rules.
+- Linux file access resolves the game's mixed-case names through
+ `src/runtime/linux_path.c`. Test on a case-sensitive filesystem: running from
+ `/mnt/c` alone can hide filename-case bugs that will fail on native Linux.
+- Linux audio uses SDL2/libsndfile instead of Windows Miles plug-ins. The
+ [audio audit](docs/audio-audit.md) records asset coverage, tested API behavior
+ and the limits of the reverb investigation.
+- Hand editing or simplifying C is welcome when backed by evidence. Use focused
+ contract tests and compare with Windows where possible; do not claim full
+ equivalence from one successful screenshot. Keep changes small and avoid
+ speculative platform rewrites.
+- Implement platform calls with meaningful behavior. Unknown calls should fail
+ explicitly, not return blanket fake success. The portable request to restart
+ the Windows launcher is deliberately a no-op at its call site.
+- The initial WASM build includes worker-owned WebGL, shared audio mixing,
+ lazy asset loading and a WebSocket byte-stream adapter to the Go server.
+ Bronto Burger renders with movement, inventory/map, audio and a live server
+ connection in the optimized browser build. Performance and broader gameplay
+ validation remain in progress.
+- Keep original binaries, downloaded tools, generated reports and saved users
+ local. Maintained reconstructed sources, game definitions and required static
+ resource files belong in Git. Generated browser builds remain ignored. This
+ local handoff does not publish game data to a public host. Preserve
+ unrelated user edits between turns.
+
+### Validation
+
+On Linux, from a graphical desktop session:
+
+```sh
+SDL_VIDEODRIVER=x11 make test
+go test ./server
+```
+
+`make test` includes graphics/window tests and needs a working display. Windows
+comparison wrappers live in `tools/client/test_portable_*.py`; they use the local
+LLVM-MinGW compiler and WSL. Normal Linux tests do not require those wrappers.
+See [tools/README.md](tools/README.md) for the smoke-test fixtures and tools.
+
+For client smoke tests, wait at least 30 seconds for world loading, open/close
+inventory (`I`) and map (`P`), move and turn, and inspect the rendered results.
+On Windows, `F12` saves the game's own screenshot. The Linux harness captures
+the completed game framebuffer through GDB, before desktop clipping. Static screenshots cannot exclude brief
+rendering glitches. Keep test servers isolated from the user's saved characters.
+
+### Bronto Burger reference view
+
+The approved Bronto Burger view in Omni-1 Entertainment faces northeast:
+
+```yaml
+playfield: 705
+position: [960, 16.5, 510]
+rotation: [0, 0.9238795, 0, -0.3826834]
+```
+
+Set server time to 13:30 and use first person (`F8` toggles it).
+[Reference image](docs/images/bronto-burger-14.9.1.png).
+
+Detailed server controls, research history and older milestones are in
+[project notes](docs/project-notes.md). The [documentation index](docs/README.md)
+links protocol, game-data, maps, and remaining questions.
diff --git a/README.md b/README.md
@@ -1,363 +1,39 @@
# Anarchy Online 14.9.1
+A reconstructed C game client for browsers, Windows and Linux, with a Go game
+server. Static resources and game definitions are embedded into a single server
+binary.
+
## Build and run
-Game definitions and their provenance are embedded YAML in `server/gamedata`. Static resources
-live in `server/assets` and are embedded in the server. Build with Go 1.24 or
-newer from the repository root:
+Requires Go 1.24+ and a matching browser build in `server/assets/client/`.
+[Copy or build the browser bundle](DEVELOPERS.md#server-build-and-operation) first.
```sh
go build -o ao-server ./server
./ao-server
```
-Distribute `ao-server` by itself (or the corresponding Windows binary). It can
-run from an empty directory; static resources are served directly from the
-binary. Saved characters remain in `data/users/` and certificates in
-`data/https/`. Server logs go to `logs/server.log` and profiles to `logs/profiles/`.
-Back up `data/` when moving servers. Paths are relative to the working directory.
-
-The browser build is kept outside Git. Before building the server, copy the
-six matching files into `server/assets/client/`: `index.html`, `game.js`,
-`game.wasm.br`, `profile-worker.js`, `audio-worklet.js`, and `build.json`.
-For example, copy them from a client build machine:
-
-```sh
-rsync -a workstation:/path/to/ao/server/assets/client/ ./server/assets/client/
-go run ./server
-```
-
-No Emscripten, Python, Make, C compiler, or original Windows client is needed
-on the server build machine. Rebuild the Go binary after updating resources.
-
-Open [the game](http://127.0.0.1:8080/) in a browser supporting WebAssembly
-JSPI, shared memory, OffscreenCanvas and WebGL 2. It loads automatically with a
-randomized Solitus visitor near Bronto Burger in Omni-Entertainment. A persistent
-cookie identifies your character on later visits; no account or training is
-required. New visitors start in run mode with character tips disabled.
-Click the game or press a key to enable sound.
-Two-finger scrolling (or a mouse wheel) rotates the browser camera. Right-button
-drag and Ctrl-drag also work; the game canvas suppresses the browser context menu.
-Press Ctrl+Alt+M (Control+Option+M on Mac), or tap Opt on mobile, for player settings. Switch
-between CSS pixels and Retina pixels while playing; the choice is remembered.
-Retina uses the screen's pixel density, making the original interface smaller
-and sharper as well as increasing rendering resolution.
-The menu also provides fullscreen and, on mobile, touch controls and a 1P/3P toggle.
-On mobile, Move controls forward/backward and strafing; swipe the world to steer
-and drag with two fingers to orbit. Spread or pinch those fingers to zoom in or out.
-Autorun keeps moving after releasing Move.
-Jump, Attack and Use buttons provide the common keyboard actions; inventory uses
-the game's native INV button.
-Tap the game to left-click, drag to move windows or items, and hold briefly for
-a right-click. Touch controls hide while settings or the chat composer is open.
-Tap Chat to open the phone keyboard; Send enters the message through the game's
-chat input. The composer accepts the game's Windows-1252 character set and
-reports unsupported characters before sending.
-Android Firefox has been tested on a Android phone. iOS Safari still crashes during
-startup and is not yet supported.
-Press Enter to chat nearby. `/tell Visitor81 hello` sends a private message;
-`/g Global hello` sends to everyone connected. `/whisper` and `/shout` change
-the vicinity range. Visitor names contain no spaces so they work in commands.
-[Server controls](http://127.0.0.1:8080/control)
-provide character editing, teleporting and time controls.
-
-Bronto Burger, Lush Fields and Newland have passed browser rendering, movement,
-inventory/map, audio and connection checks. Performance work and broader
-gameplay validation continue.
-For native clients, keep the server running in a separate terminal and use the
-commands below. Creating a character in server controls also works.
-
-### Server (Windows or Linux)
-
-Requires Go 1.24 or newer. The server listens on all network interfaces. Default
-ports are login 7500, world 7501, chat 7502, HTTP 8080 and HTTPS 8443. Chat uses
-the port immediately after the world port. From another machine,
-open `https://<server-address>:8443/` or `/control`. On first startup, Go
-creates a self-signed certificate in `data/https/cert.pem` and a private key in
-`data/https/key.pem`; both stay out of Git. Trust the certificate on the client
-machine before playing: shared WebAssembly memory requires trusted HTTPS.
-The certificate covers the server hostname and current IP addresses for one year.
-If those change, remove both files and restart to generate a new certificate.
-HTTP remains available, including `http://<server-address>:8080/control`.
-For an existing installation, move `local/https/` to `data/https/` before
-restarting to preserve the trusted certificate. Existing `local/profiles/` files
-can be moved to `logs/profiles/`. Server messages are appended to
-`logs/server.log` and also printed to the terminal.
-
-```sh
-go run ./server
-```
-
-### Game data
-
-NPC definitions are editable YAML in `server/gamedata/zones/zone_<playfield>.yaml`.
-Each zone holds both reconstructed NPCs and its original population record:
-level ranges, radii, timings, flags, stats, hashes and offsets. Comments,
-confidence and provenance remain ordinary searchable fields. `Source` and
-`FixedSource` link the loaded definitions to their original records.
-
-`population_evidence.yaml` holds extraction evidence and shared confidence descriptions. `npc_names.yaml`
-retains guide sources and name confidence. `monsters.yaml` holds all 290
-appearance definitions; `items/` holds all 87,611 item and nano definitions,
-including serialized effects, requirements and undecoded bytes. Item catalog
-provenance and coverage live in `items.yaml`. Map coordinates, playfields and
-terrain extraction evidence have their own YAML files in the same directory.
-
-Go embeds these files and decodes them into typed structs at startup. Item files
-contain one YAML document per record, keeping temporary parser memory bounded.
-Rebuild and restart after edits; runtime does not read external game-data files.
-`types.go` defines the schemas and `load.go` loads and validates the embedded data.
-
-Every NPC group has an explicit stable `id`, independent of its position in a
-file. `gamedata.NPCGroups[id]` resolves its definition, and live NPCs retain that
-ID for Go behavior code. Keep existing IDs when editing or moving definitions.
-The current server has generic roaming logic; per-NPC chat and walking scripts
-can be implemented in Go against these IDs when needed.
-
-For bulk processing, `go run ./tools/data/export_gamedata` exports all loaded
-definitions and extraction evidence as JSON. `tools/data/generate_npcs.py`
-writes extraction candidates to `local/reports/` for review, leaving maintained
-YAML intact. `make assets` copies game resources from the top-level
-`anarchy-assets-14.9.1/` directory and derived data from `data/` into
-`server/assets/`. `make wasm` runs this step before building and publishing
-the browser client. Go embeds the ordinary files directly; there are no
-resource archives, split files or startup extraction. Asset checksums are
-prepared during copying so browser cache validation does not scan large files
-at server startup. Extraction tools write reproducible JSON candidates into
-ignored `local/data/` and `local/reports/`; these are optional review artifacts.
-The server uses embedded definitions. Offline regeneration reads fresh extraction
-candidates plus maintained map coordinates and name evidence from YAML.
-
-### Build the browser client on Debian
-
-Only the client build machine needs this toolchain. Install the native build
-dependencies and the pinned Emscripten SDK once:
-
-```sh
-sudo apt-get install build-essential cmake pkg-config git python3 python3-brotli xz-utils ca-certificates
-mkdir -p toolchains
-git clone https://github.com/emscripten-core/emsdk.git toolchains/emsdk
-./toolchains/emsdk/emsdk install 6.0.12
-./toolchains/emsdk/emsdk activate 6.0.12
-```
-
-Build and publish the client:
-
-```sh
-make wasm -j8
-```
-
-This downloads/builds the audio dependencies, compiles the game, and writes the
-six files above to ignored `server/assets/client/`, which Go embeds when building. The first build is
-heavy; allow several gigabytes of build space and substantial compilation time.
-ThinLTO optimizes calls across source files with eight linker workers. Keep
-`src/build/wasm/lto-cache/` to reuse that work on subsequent builds.
-Publishing also caches Brotli compression in `src/build/wasm/web/`, so page-only
-updates reuse the compressed executable. The browser decodes it over HTTP.
-Copy the complete matching bundle to other machines after validating it. Do not
-mix JavaScript and WASM from different builds or commit generated client files.
-
-### Original Windows client (PowerShell)
-
-```powershell
-Push-Location anarchy-vanilla-14.9.1
-$env:ANARCHY_CD = 'cd_image'
-$env:ANARCHY_SETUP = 'Setupf'
-.\Clientr.exe localtest localtest 1 2130706433 7501 0 0
-Pop-Location
-```
-
-### Rebuilt Windows client (PowerShell)
-
-Uses the local LLVM-MinGW toolchain. `make clean` is only needed to discard an
-existing build; `make` also builds from a clean checkout.
-
-```powershell
-& .\toolchains\llvm-mingw-20261006-ucrt-x86_64\bin\mingw32-make.exe -j4
-Push-Location anarchy-runtime-14.9.1
-$env:ANARCHY_CD = 'cd_image'
-$env:ANARCHY_SETUP = 'Setupf'
-..\src\build\windows\game.exe localtest localtest 1 2130706433 7501 0 0
-Pop-Location
-```
-
-### Native Linux (Debian 13, x86-64)
-
-Install dependencies once, including Go for the server:
-
-```sh
-sudo apt-get install build-essential pkg-config libsdl2-dev libgl-dev zlib1g-dev libsndfile1-dev libfreetype6-dev libfontconfig1-dev golang-go xwayland
-mkdir -p ~/.local/share/fonts/anarchy
-cp anarchy-assets-14.9.1/fonts/*.ttf ~/.local/share/fonts/anarchy/
-fc-cache -f
-```
-
-Start the server above, then build and run from a graphical desktop terminal:
-
-```sh
-make -j4
-(cd anarchy-assets-14.9.1 && SDL_VIDEODRIVER=x11 ANARCHY_CD=cd_image ANARCHY_SETUP=Setupf ANARCHY=. ../src/build/linux/game localtest localtest 1 2130706433 7501 0 0)
-```
-
-### Linux through WSL (PowerShell)
-
-Install the same build dependencies and fonts inside WSL. Run the server there
-as well so the client can reach it on localhost:
-
-```powershell
-wsl --cd /path/to/ao --exec go run ./server
-```
-
-In another terminal:
-
-```powershell
-wsl --cd /path/to/ao --exec make -j4
-wsl --cd /path/to/ao/anarchy-assets-14.9.1 --exec env GALLIUM_DRIVER=d3d12 ANARCHY_CD=cd_image ANARCHY_SETUP=Setupf ANARCHY=. ../src/build/linux/game localtest localtest 1 2130706433 7501 0 0
-```
-
-## Copying to Debian
-
-The Linux client needs an x86-64 desktop with OpenGL 3.3 or newer. Use the native
-GPU driver; `GALLIUM_DRIVER=d3d12` belongs only in the WSL command. The current
-window/input adapter and tests are validated with X11, so the native command
-selects SDL X11 explicitly. On a Wayland desktop this uses XWayland; direct
-Wayland operation is not yet validated. No Wine,
-32-bit Linux libraries, Windows toolchain, or original game DLLs are needed.
-The four local Verdana files above preserve the tested font choice; otherwise
-Fontconfig may silently substitute a different font. They remain local assets.
-
-From WSL, copy to your mounted destination or substitute an SSH destination:
-
-```sh
-rsync -a --chmod=D755,F644 --info=progress2 --exclude=/local/ --exclude=/old_wip/ --exclude=/toolchains/ --exclude=/venv/ --exclude=/src/build/ --exclude=/anarchy-vanilla-14.9.1/ --exclude=/anarchy-runtime-14.9.1/ --exclude=/patches/ --exclude=__pycache__/ --exclude='Screenshots/*' /path/to/ao/ /path/to/ao/
-```
-
-Keep `anarchy-assets-14.9.1/` and `data/`, including your `data/users/` files.
-The asset directory contains game data/configuration only; Windows launchers,
-DLLs and Miles audio plug-ins are excluded. All zones' assets are retained.
-Its preparation script is `tools/client/prepare_portable_assets.py`; ordinary
-builds and runs do not need that script or the Windows runtime directory.
-See the [asset audit](docs/portable-assets.md) for the isolation test and its scope.
-Stop the server while copying mutable state. Do not use Git's ignore rules as
-rsync exclusions: that would omit required local assets and server data.
-Do not reuse Ubuntu-built objects on Debian. In the destination, `make clean`
-then `make -j4` forces a native rebuild. Reduce parallelism if memory is tight.
-Some generated C files take several minutes and multiple GB of RAM to compile.
-The rsync permissions option avoids copying Windows-mounted files as executable
-source files. Python and the Windows virtual environment are not needed for
-ordinary builds.
-
-Debian 13 supplies the [SDL2 development package](https://packages.debian.org/trixie/libsdl2-dev)
-and [Go 1.24](https://packages.debian.org/trixie/golang). Its
-[libsndfile 1.2.2 package](https://packages.debian.org/trixie/libsndfile1-dev)
-also includes the MPEG decoder dependencies used by the Linux audio adapter.
-The server may need network access on its first build to download Go modules.
-
-## Repository layout
-
-| Path | Purpose |
-| --- | --- |
-| `src/game/` | Maintained reconstructed C for Clientr.exe and 33 game DLLs; edit directly. |
-| `src/runtime/` | Windows host, portable memory/runtime, and Linux platform adapters. |
-| `src/data/`, `src/vendor/` | Non-code game initializers and translated support libraries. |
-| `src/tests/` | Native contract and regression tests. |
-| `server/`, `data/` | Go server, extracted world data, and local saved characters. |
-| `server/gamedata/` | Embedded YAML definitions, provenance and Go schemas. |
-| `server/assets/` | Embedded static resources and their Go loader. |
-| `server/assets/client/` | Ignored browser build, embedded when building the server. |
-| `anarchy-vanilla-14.9.1/` | Local original game for Windows reference comparisons. |
-| `anarchy-runtime-14.9.1/` | Windows runtime assets and native vendor DLLs. |
-| `anarchy-assets-14.9.1/` | Portable game assets and configuration; no Windows executables or plug-ins. |
-| `tools/client/` | Client validation, Windows/Linux comparisons, and reconstruction utilities. |
-| `tools/data/` | Game-data extraction and its tests. |
-| `toolchains/` | Local downloaded Windows compiler; ignored. |
-| `data/users/`, `data/https/` | Mutable server state: characters and HTTPS credentials. |
-| `logs/` | Server log and uploaded browser profiles; ignored. |
-| `local/` | Ignored extraction data, development reports, screenshots, test fixtures, and downloaded references. |
-| `old_wip/` | Archived experiments and old baselines; not part of the current build. |
-| `docs/` | Architecture, reverse-engineering evidence, and validation history. |
-
-The early standalone 14.9.1 sources are preserved by the annotated Git tag
-`ao-14.9.1-source-baseline` (commit `c5cc2f3`, source directory `decompiled/`).
-All 34 module extraction hashes match the current baseline. See the
-[repository size and packaging notes](docs/repository-packaging.md).
-
-The obsolete 13.2 `client-target` installation was removed. Its preferences are
-retained under `local/client-target-prefs/`. The old 13.2 sources and release
-clients are archived locally under `old_wip/`; they are not build dependencies.
-
-## Maintainer handoff
-
-**The baseline is 14.9.1.** Preserve classic Rubi-Ka scenery and GUI.
-Performance work is currently paused for the portable browser handoff.
-Linux only needs windowed mode. Read [src/README.md](src/README.md) before changing the runtime.
-
-- Compile the checked-in sources directly. Do not regenerate `src/game/` over
- manual edits. Generation and decompilation tools are optional archaeology.
-- Windows builds one 32-bit executable using native Windows/DirectX and vendor
- libraries. Linux builds one 64-bit executable with translated support-library
- C, SDL2/OpenGL, and Linux adapters. Neither build executes original game code
- from external game EXE/DLL files. Keep that standalone property intact.
-- Guest addresses are 32-bit identities. Windows uses its fixed address layout;
- 64-bit Linux uses a reserved 4 GiB guest address region, while the browser
- translates guest memory through `guest_pages`. Guest pointers, handles
- and function tokens must never be confused with host pointers. Preserve guest
- layouts, calling conventions, stack cleanup, TLS, exception and callback rules.
-- Linux file access resolves the game's mixed-case names through
- `src/runtime/linux_path.c`. Test on a case-sensitive filesystem: running from
- `/mnt/c` alone can hide filename-case bugs that will fail on native Linux.
-- Linux audio uses SDL2/libsndfile instead of Windows Miles plug-ins. The
- [audio audit](docs/audio-audit.md) records asset coverage, tested API behavior
- and the limits of the reverb investigation.
-- Hand editing or simplifying C is welcome when backed by evidence. Use focused
- contract tests and compare with Windows where possible; do not claim full
- equivalence from one successful screenshot. Keep changes small and avoid
- speculative platform rewrites.
-- Implement platform calls with meaningful behavior. Unknown calls should fail
- explicitly, not return blanket fake success. The portable request to restart
- the Windows launcher is deliberately a no-op at its call site.
-- The initial WASM build includes worker-owned WebGL, shared audio mixing,
- lazy asset loading and a WebSocket byte-stream adapter to the Go server.
- Bronto Burger renders with movement, inventory/map, audio and a live server
- connection in the optimized browser build. Performance and broader gameplay
- validation remain in progress.
-- Keep original binaries, downloaded tools, generated reports and saved users
- local. Maintained reconstructed sources, the published browser client and the
- required static resource files belong in Git. These include
- game data; this local handoff does not publish it to a public host. Preserve
- unrelated user edits between turns.
-
-### Validation
-
-On Linux, from a graphical desktop session:
-
-```sh
-SDL_VIDEODRIVER=x11 make test
-go test ./server
-```
-
-`make test` includes graphics/window tests and needs a working display. Windows
-comparison wrappers live in `tools/client/test_portable_*.py`; they use the local
-LLVM-MinGW compiler and WSL. Normal Linux tests do not require those wrappers.
-See [tools/README.md](tools/README.md) for the smoke-test fixtures and tools.
+Open [localhost:8080](http://localhost:8080/). For phones and other devices, use
+`https://<server-address>:8443/` and trust the generated certificate.
-For client smoke tests, wait at least 30 seconds for world loading, open/close
-inventory (`I`) and map (`P`), move and turn, and inspect the rendered results.
-On Windows, `F12` saves the game's own screenshot. The Linux harness captures
-the completed game framebuffer through GDB, before desktop clipping. Static screenshots cannot exclude brief
-rendering glitches. Keep test servers isolated from the user's saved characters.
+Distribute the binary by itself. Runtime state lives in `data/`; logs and profiles
+live in `logs/`.
-The approved Bronto Burger view in Omni-1 Entertainment faces northeast:
+## Repository overview
-```yaml
-playfield: 705
-position: [960, 16.5, 510]
-rotation: [0, 0.9238795, 0, -0.3826834]
+```text
+server/ Go server and game logic
+ gamedata/ Embedded YAML definitions, provenance and Go schemas
+ assets/ Embedded resources and browser bundle
+src/ Reconstructed C client and platform runtimes
+tools/ Build, extraction and validation tools
+data/ Runtime state
+logs/ Logs and browser profiles
+local/ Ignored research and test output
+docs/ Design, research and validation
```
-Set server time to 13:30 and use first person (`F8` toggles it).
-[Reference image](docs/images/bronto-burger-14.9.1.png).
+[Developer guide](DEVELOPERS.md): detailed setup, client builds and testing.
-Detailed server controls, research history and older milestones are in
-[project notes](docs/project-notes.md). The [documentation index](docs/README.md)
-links protocol, game-data, maps, and remaining questions.
+[Documentation index](docs/README.md): architecture and research.
diff --git a/docs/14.9.1-validation.md b/docs/14.9.1-validation.md
@@ -2,7 +2,7 @@
The main `server/` now incorporates the recovered 14.9.1 packet layouts and
compact movement codec, while retaining release 11.0 serialization. Follow
-the [main-server launch instructions](../README.md#run-the-stock-1491-client-against-the-main-server)
+the [main-server launch instructions](../DEVELOPERS.md#original-windows-client-powershell)
for current development. A stock-client check loaded Omni Training and stayed
connected for 30 seconds with an isolated data copy and independently chosen
ports. Its character ID was taken from that instance's user data.
diff --git a/docs/README.md b/docs/README.md
@@ -9,7 +9,7 @@ for recovering behavior and checking our interpretation.
These documents describe the original artifacts and recorded experiments.
They do not inventory the Go server's functions, state fields, tests, or
current feature status. Read the source for implementation details and the
-[root README](../README.md) for local launch commands.
+[developer guide](../DEVELOPERS.md) for detailed build and launch commands.
## Where to start
diff --git a/docs/font-version-comparison.md b/docs/font-version-comparison.md
@@ -10,7 +10,8 @@ The reported isolated pixels are reproducible in native **11.0, 12.0, 12.1, 12.2
with the isolated corrected server, survives 90 seconds, and has clean chat
in native F12 captures at 30.95 and 66.02 seconds. The user selected forward
testing after the fresh 11.0 ISO reproduced the defect. The user subsequently
-approved the stock 13.6 Bronto Burger view, saved in the root README. The exact
+approved the stock 13.6 Bronto Burger view; the current reference view is in
+[the developer guide](../DEVELOPERS.md#bronto-burger-reference-view). The exact
historical scenery-change cutoff remains unknown.
The subsequent [14.9.1 validation](14.9.1-validation.md) also passes the inspected
diff --git a/docs/portable-assets.md b/docs/portable-assets.md
@@ -24,7 +24,7 @@ files, old logs and screenshots. It also excludes Miles plug-ins under
`cd_image/sound/redist/`: these are Windows PE binaries despite their `.flt`,
`.asi` and `.m3d` extensions. Preparation and the Linux smoke check inspect file
signatures as well as extensions. Fonts are installed through Fontconfig as
-shown in the root README; Linux system libraries and GPU drivers remain normal
+shown in [the developer guide](../DEVELOPERS.md#native-linux-debian-13-x86-64); Linux system libraries and GPU drivers remain normal
host dependencies.
Startup messages such as `attach bbr.dll` name modules compiled into the Linux
executable; they do not mean DLL files are being loaded.
diff --git a/docs/project-notes.md b/docs/project-notes.md
@@ -1,6 +1,6 @@
# Project history and server operation
-Current build/run commands and source layout are in [the root README](../README.md).
+Build/run details and maintainer guidance are in [DEVELOPERS.md](../DEVELOPERS.md).
Historical experiments below are evidence, not required setup steps.
## Development notes
diff --git a/docs/repository-packaging.md b/docs/repository-packaging.md
@@ -47,7 +47,7 @@ their local work, rather than merging the old history back into this repository.
## Clone and run
Clone the repository normally and copy the complete `server/assets/client/`
-bundle from a client build machine using the [README instructions](../README.md).
+bundle from a client build machine using the [developer instructions](../DEVELOPERS.md#server-build-and-operation).
Generated browser output is ignored and must not be committed. Build with
`go build -o ao-server ./server` using Go 1.24 or newer. Distribute the resulting
binary by itself; it can run from an empty directory. Open
diff --git a/docs/target-version-evaluation.md b/docs/target-version-evaluation.md
@@ -108,7 +108,7 @@ the actual 14.9.1 client. Character creation already changed in 14.6, per
2. Adapt only the isolated test server as needed. A protocol mismatch is not
evidence that the historical client was unstable.
3. Capture native F12 PNGs after loading: identical chat samples, classic GUI,
- and the [saved BB location/direction](../README.md#bronto-burger-reference-view).
+ and the [saved BB location/direction](../DEVELOPERS.md#bronto-burger-reference-view).
Compare with the approved 13.6 screenshot, including the building behind BB.
4. Exercise repeated launches, indoor/outdoor zoning, camera movement, maps,
and longer sessions. Verify Temple of Three Winds and Inner Sanctum geometry.
diff --git a/src/README.md b/src/README.md
@@ -13,7 +13,7 @@ regenerate them. Edit these sources in place.
- `build/windows/`, `build/linux/`: ignored platform-specific build output.
The root Makefile delegates here. `Makefile` selects `Makefile.windows` on
-Windows and `Makefile.linux` on Linux. See [the root README](../README.md) for
+Windows and `Makefile.linux` on Linux. See [the developer guide](../DEVELOPERS.md) for
exact dependency, build and launch commands. `make clean` removes only the
current platform's output. Builds need no original game EXE/DLL, Python,
decompiler, regeneration step, or PE image inputs.