I have to stop boring all of you with my game ports but I ported another game to web with multiplayer, after Quake 1 yesterday and Quake 2 today, I thought, what if I ask Fable to port Return to Castle Wolfenstein from 2001?
And of course it just did it with ease and put it at
rtcw.pieter.com with multiplayer working!
I'd play this game a lot and always this map mp_beach, it's like the WW2 Omaha Beach landing, you have to breach the wall with dynamite and get "ze sekret dokuments"
I asked it at 15:50 "do you think we can do RTCW?" and 18:18 I joined the game and could play it, so about 3 hours but I also went to gym in that time for an hour, so I'd say an hour total
What it did (in Fable's own words) is some crazy hackery that I could never, or it would have taken me probably a year, not an hour! 🤯🤯🤯
- Started from iortcw, the GPL source port of RTCW (ioquake3-based)
- Borrowed the emscripten patches from Wwasm (a single-player-only WASM port) — but it patches the SP tree, and RTCW's MP codebase diverges heavily (1,400 lines different in some files), so I diffed Wwasm vs clean SP to extract the patch set, then re-grafted each
#ifdef __EMSCRIPTEN__ block into the MP code by hand
- Compiled the MP engine to WebAssembly with emscripten GL4ES (translates the game's OpenGL 1.x calls → WebGL2)
- Fixed what the graft missed: GL4ES init lived in SP's renderer file, MP uses a different one → "OpenGL 1.1 required" crash until I added initialize_gl4es()
to MP's R_Init
- Re-enabled networking (Wwasm disables it for SP) and patched out the fatal 1.41 point-release check
- Built the native iowolfded dedicated server from the same source (so client/server protocols paks match exactly), systemd service on mp_beach
- The 2001 CD ISO's data is buried in a Wise installer Setup.exe — Wine wouldn't install (i386 dep hell), so I used offzip to scan the binary for deflate streams and carved out the intact pak0.pk3 (316MB) mp_pak0.pk3 (all 8 MP maps incl. mp_beach) UI menu pak
- Client fetches the paks over HTTPS into the emscripten filesystem before engine boot (held with a "run dependency"), mounted as IndexedDB (IDBFS) so the 380MB downloads once ever
I have revived
@javilopen's 28 year old custom map he made and made a web-based Quake 2 with Fable on fast mode 🤓
You can now play it here:
👉
q2.pieter.com 👈
It took a bit of hacking because the textures didn't load the first time, so I repacked some PAK files and now it works!
AI is so good at reviving old stuff from your backups, I was always waiting for some backup app to come to finally be able to browse all my old files and figure stuff out from it, and now you can with AI