# wcmulti adds two-player co-op to DOS Wing Commander, in your browser, after 11 years of reverse engineering

> Developer Daniel R. and his brother spent a decade finding Wing Commander's game state in memory and learning to call its own functions. The result is a GPL-licensed DOSBox fork that lets two players fly story missions together over WebRTC, with your own game files never leaving the browser.

Published Nov 6, 2026 by TechMeasured Staff · Repos · Canonical: https://techmeasured.com/repos/wcmulti-wing-commander-dos-co-op-browser-decade-reverse-engineering

**wcmulti** is an open-source project that adds **two-player co-op** to the original DOS space-combat game **Wing Commander**. Each player flies their own fighter as the other's wingmate through the story missions. It runs in a web browser. Developer **Daniel R.** (GitHub: danielrh) posted it to Hacker News this week. The Show HN reached **246 points and 34 comments** by the time we read it, the top score on the Show HN front page when we checked.

Why it's interesting: the original game had no multiplayer code. The project's write-up says co-op only became possible after about **11 years** of work, starting in **October 2015**, to work out where the game keeps its state in memory and how to call its own functions from outside. Daniel's brother **Patrick** worked on it from the start. It's a clear, well-documented case study in how game preservation and modding work at the byte level.

## How they did it

The author's key insight, from the Show HN post: the game's whole state fits in a single **64 KB data segment**. From there, the write-up describes these steps:

- **Find the ships.** They dumped DOSBox memory while flying, turning and stopping, then compared snapshots. That narrowed **413 candidate bytes to 132** and showed the layout: **64 entity slots of 12 bytes each**. Slot 0 is the player. The camera sits in slot **0x3D**, which the author suspects was the original developers' nod to "3D."
- **Find the main loop.** Memory watchpoints traced writes back through the call stack to the per-frame loop. The team hooked one stable point in it.
- **Call the game's own code.** A small "trampoline" placed in an unused string lets DOSBox call game functions such as firing guns and applying damage. It mimics a Borland stack frame so the game's overlay loader doesn't crash.
- **Queue events.** DOSBox injects one queued call per frame: fire, damage, spawn, despawn or chat.
- **Sync two machines.** From 2017, the session leader acts as server and streams per-frame ship positions and events. Short-lived objects such as laser bolts are kept in **slots 12–15** so their IDs match on both machines.
- **Chat.** Typed messages appear through the wingman's in-cockpit display, using the game's own comm-text function. This was added in 2020.

## The 2026 browser version

The repo is a **DOSBox fork compiled to WebAssembly** with Emscripten and Asyncify. Asyncify lets the emulated CPU pause while it waits for network data. Networking moved from TCP to **WebRTC**:

- **lobbylink**, a Go signaling server, pairs players by **room code**. It hands out TURN relay credentials for players behind strict NATs.
- **Voice chat** runs on a separate WebRTC connection. The author told one commenter this stops bursts of voice traffic from delaying game packets.
- The repo also lists text chat, controller support, a public chat lobby and **Wing Commander II** support.

The author says AI handled the final step: compiling for the browser, porting the networking to WebRTC, adding voice, and fixing bugs. Asked about this in the thread, he said the 8+ years of reverse engineering and calling the game's functions were done by hand.

## What you need to play

- **Your own copy of Wing Commander.** No game files are hosted. You drop in a zip of the game folder or the **GOG installer**, and it's unpacked in the browser and cached in IndexedDB. The repo says nothing is uploaded.
- **A modern browser** with WebAssembly and WebRTC. The README says it was tested in headless Chrome and that Firefox and Safari haven't been tried.
- **A room code** shared with your partner, and a microphone if you want voice.

There are rough edges. Saves live in memory and disappear when you close the tab, unless you save in the game's bunk. The page can then keep a copy in local storage or let you download a save file.

No copy of the game? The page instead loads an open-sourced DOS/3Dfx version of the author's space game **Vega Strike**, with AI-upscaled art and multiplayer. The author says most visitors pick that one-click option.

## Building it yourself

The README's build steps need the Emscripten SDK, CMake, autotools, protoc and Node:

```bash
git submodule update --init   # pulls lobbylink
scripts/build-web.sh          # builds dependencies and web/dist
web/serve.py                  # serves on http://localhost:8000/
```

The public lobby only accepts pages from its own origin. To self-host, run the bundled `p2p-lobby-server` and allow your page's origin. A native, non-browser build is also available through `runwc.sh`. The code is **GPL-2.0**, matching DOSBox.

## Who should care

Retro gamers with a GOG copy can try co-op tonight with a friend. For developers, the write-up is worth reading on its own. It walks through snapshot diffing, memory watchpoints and function trampolines in a real 16-bit game. In the thread, the author named **Privateer** and the **X-Wing/TIE Fighter** games as possible next targets, but hasn't announced any plans.


## Sources

1. [GitHub — danielrh/wcmulti](https://github.com/danielrh/wcmulti)
2. [Wing Commander Together — project write-up](https://fireflyk64.github.io/wcmulti/)
3. [Hacker News — Show HN: After a decade of reversing, I got co-op working in DOS Wing Commander](https://news.ycombinator.com/item?id=50369895)
