Conversations
Developer spends decade reverse-engineering cooperative mode for DOS version of Wing Commander
Hacker News user danielrh shared that, as children, he and his brother wanted to cooperate in Wing Commander as wingmen rather than share one fighter. Starting in 2015, he dumped memory in DOSBox, located player coordinates and rotation data, and wrote snapshot-comparison tools, gradually laying the foundation for online cooperative play in the classic DOS game.
On October 4, 2015, while playing the classic version of Wing Commander in DOSBox, the author realized that the game’s memory might fit entirely within 640K. If he could dump the memory and find the locations of the player’s and wingman’s X, Y, and Z coordinates, it might be possible to use network packets to control the wingman.
To reduce interference, he tried making other entities in the game disappear and flew into empty space during missions without the wingman Paladin following him. Using DOSBox’s MEMDUMPBIN debugging command, he saved memory snapshots in stationary and moving states, then compared unchanged and changing data. Thirty-five groups of changing bytes appeared in the data segment; after manually inspecting changes in floating-point numbers and small integers and combining that with the chase camera view, he finally located the ship-coordinate address. Modifying the integer at that address with a debugger caused the ship to jump to a new position.
The author also piloted the ship through a memory editor and reproduced the phenomenon near the carrier “Claw” and other NPC ships. In September 2016, he began writing a small tool to automatically compare DOSBox snapshots rather than relying solely on the vbindiff graphical interface; rotation direction was harder to locate, and the project was paused for a time before resuming that November. He found that the game’s vectors used 4-byte scalars, with 256 representing 1.0 and valid forward-vector positions ranging from 0 to 255, so small rotations often changed only one byte. The post also mentions reverse-engineering details such as the game reserving 64 slots for entity attributes.