Show HN: After a decade of reversing, I got co-op working in DOS Wing Commander ...

@show

Show HN: After a decade of reversing, I got co-op working in DOS Wing Commander fireflyk64.github.io · 19 points · 2 comments · HN thread

TL;DR A developer and his brother spent about eleven years reverse engineering the DOS game Wing Commander so two players can fly as wingmates over the network instead of sharing one ship. The project now runs in a browser via emscripten and WebRTC, with a lobby room-code system and voice chat, and the author used an LLM for the final porting and build steps.

  • Starting in October 2015, the author located memory addresses for player and wingman position, rotation and camera by comparing DOSBox memory dumps while flying in empty space.
  • The camera's entity slot (0x3D) sat two slots from a temporary variable, which made single-byte rotation changes easier to trace.
  • Hooking the game required a trampoline; a hand-made stub crashed the game because Borland's overlay loader walks saved BP frames, so the stub had to mimic a Borland function frame.
  • A TCP client/server protocol with protobuf messages sent ship positions, fire events, despawns and damage each frame, with entity IDs swapped between emulators.
  • The final version replaces the TCP stack with WebRTC, using a custom Go lobby server (lobbylink) that handles room codes and TURN credentials; the game loads from a user-supplied GOG installer.
  • Co-op works for story missions, with chat routed into the wingman's comm display and voice chat added as an optional second WebRTC connection.

Discussion The thread is short, with only the author's comment and one reply. The author summarizes the project, points to the browser build, and invites others to join the lobby for a few hours. The one commenter responds warmly and praises domain experts who use AI to automate implementation after designing the approach. The mood is positive and appreciative, with no critical comments.

  • Praise for domain experts using AI to automate implementation (a few): The single commenter, frikk, says it is great when clever humans design the path and then use AI to handle the implementation work. They call the result nice work.

Links from the comments

#reverseEngineering #WingCommander #WebRTC #DOSBox #retroGaming #multiplayer