Earthsiege 2
Dynamix's 1996 mech sim, running in a browser tab: the open-source HERCULAN engine compiled to WebAssembly, playing from your own copy of the disc.
No game data is hosted here or in the build. The page asks once for your disc (a cue sheet with its image, a CloneCD image, an ISO, a zip, or the CD drive itself) and installs it into your browser's storage.
The port
HERCULAN is an MIT-licensed reimplementation of Earthsiege 2 in C#, written for the desktop on .NET and OpenGL 3.3. The browser port keeps its engine unchanged and replaces what sits under it:
- Graphics. Every OpenGL call in the engine now goes through one interface, with the desktop's OpenGL behind it on the desktop and WebGL2 (OpenGL ES 3.0) in the browser. The shaders are rewritten to GLSL ES 3.00 as they load, so the desktop and browser draw from the same sources.
- Runtime. The engine is compiled ahead of time to WebAssembly with .NET 9, rather than run on .NET's WebAssembly interpreter, which spent about 18 ms of CPU on each frame of a mission.
- The disc. The page reads the disc image itself, does what HERCULAN's installer does, and keeps the result in the browser. The CD's audio tracks become the music, even from a raw image with no cue sheet, where the tracks are found by the digital silence between them. Zips are read by a small reader of the page's own, built on the browser's decompression streams.
- Controls. Retail's cockpit pointer, or mouse aim with the pointer locked; a standard gamepad mapped the way the desktop maps one, with rumble when the cockpit is hit and on every shot.
- The rest. Movies upscaled smoothly with a bicubic filter (or retail's pixel-doubled look), retail bugs fixed by default with a switch to put them back, and save backups to a file.
Checking the record
Alongside the port, HERCULAN's claims about how the retail game behaves are being checked against the original executables with a reverse-engineering toolkit and Ghidra, so real divergences can go back upstream as issues. The disc used here turned out to be a third pressing, version 1.13, that upstream hadn't documented.
Fixes the browser surfaced along the way, such as file paths that only worked on a case-insensitive filesystem and a shader qualifier GLSL ES doesn't allow, also help HERCULAN's own Linux build.