Play DOS-era Wing Commander cooperatively in your browser
Wing Commander Together is a hobby project by danielrh (with his brother Patrick) that adds cooperative multiplayer to the original DOS Wing Commander. Instead of re-implementing the game, it runs the original WC.EXE inside DOSBox and hacks the running process: locating the player and wingman state in the game's 64K data segment, hooking the main loop, and invoking the game's own native functions (firing guns, applying damage) through a trampoline system written over unused string bytes. Positions, fire events, damage, and mission events (ejection, landing, death) are exchanged between two players over a TCP client/server connection using protobuf messages, letting two people finally fly the Kilrathi War campaign as actual wingmates rather than sharing one cockpit.
Lets two players fly the classic Wing Commander campaign together as pilot and wingman, instead of the original game's shared single craft.
Reverse-engineered the game's DOS memory layout (player/wingman position at 13D3:A9C2, velocity, orientation vectors, mission tree, victory points) by diffing DOSBox memory snapshots, then syncs state between players at runtime.
A trampoline system (written over the dead 'Loading WING COMMANDER' string in memory) pushes arguments and calls the original Borland-overlay functions like fireAllGuns and do_damage, so lasers, missiles, and damage behave like the real game.
Every frame, the leader sends each ship's position plus fire, despawn, and damage events; the client replies with its own position, shots fired, and major mission events (ejection, landed, died).
The project offers a browser-playable version of the DOSBox-based multiplayer experience directly from the site.
Used DOSBox's MEMDUMPBIN debug command to snapshot the 640K of DOS memory with the ship stopped, then again after moving, and diffed to isolate the bytes holding position, velocity, and orientation vectors (int32 values where 256 equals 1.0).
Found a deterministic hook point in the game's main loop at 0560:20E3 (identified via watchpoints tracing vector_add → per-ship physics → per-frame → main loop), so multiplayer logic runs at a predictable point each frame.
Because writing raw memory couldn't handle lasers and missiles, DOSBox pushes CS:IP, writes a pushf/pusha/call-far/retf thunk over a dead string at 13D3:0187, and redirects CS:IP to it — calling the original overlayed game functions with correct arguments wherever the overlay happens to be loaded.
A simple TCP client/server architecture exchanges protobuf game messages each frame: positions for every ship from the leader, plus fire, despawn, and damage events; the client sends its own position, shots, and mission outcomes.
It is a project by danielrh and his brother Patrick that adds cooperative multiplayer to the original DOS Wing Commander, letting two players fly the campaign together as pilot and wingman — the co-op experience they wished for as kids.
It runs the original WC.EXE in DOSBox and modifies the running process: it located player, wingman, and camera state in the game's 64K data segment by diffing DOSBox memory snapshots, hooks the main loop at a fixed point, uses trampolines written over a dead string in memory to call the game's own functions (firing guns, applying damage), and syncs everything between players.
Through a simple TCP client/server architecture with protobuf game messages: each frame the leader sends every ship's position plus fire, despawn, and damage events, while the client replies with its own position, shots fired, and mission events like ejection, landing, or dying.
Yes — the project drives the original DOS Wing Commander game code inside DOSBox rather than re-implementing the game, so the original game assets are needed.
Yes, the project site offers a 'Play it in your browser' option alongside a video demo on YouTube.
The project began on October 4, 2015, when danielrh started dumping and diffing DOSBox memory while playing Wing Commander; the site describes it as an 11-year journey, with major milestones including the networking protocol in August 2017 and the do_damage fix in July 2017.
It is designed around two players — a leader and a client — each flying their own ship in the same mission, with the client's ship puppeteered through the game's own wingman and entity slots.