How to use Claude to port Xonotic to the browser
The author and Claude Code ported Xonotic to browser-based WASM/WebGL2, moved the engine onto a worker, streamed compressed assets and tested direct WebRTC multiplayer across the Pacific.
Suggested prompt
Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.
Help port [open-source C/OpenGL game] to WASM/WebGL2 with Emscripten. Run the engine on a worker owning an OffscreenCanvas, compress textures and audio, and stream map assets from [object storage]. Add WebRTC peer multiplayer, then help me profile a match and test [remote locations].
Reach people exploring AI agents
See placements →Evidence at a glance
Sourced account- Source author
- astlouis44
- Original account
- Read the source ↗
- Published
- Source link checked
- Reported result
- Xonotic is reported fully playable in the browser without plugins; a real Edmonton–Bangkok one-on-one match held up across the Pacific.
- Human involvement
- The author profiled a match and tested real cross-Pacific multiplayer; the post does not describe a separate code review process.
A linked account supports attribution. It does not mean we independently reproduced its result.
Report an issue with this case
Open correction emailOpens your email app with the case link included. Nothing is sent automatically.
How the agent did it
- Compiled DarkPlaces to WASM/WebGL2 and moved the engine onto a worker.
- Converted textures to Basis Universal/KTX2 and audio to Ogg Vorbis.
- Implemented an R2-backed streamed filesystem and enabled wasm128 SIMD.
The author used Claude Code to explore whether a complete open-source game could run in a browser. They selected Xonotic, an arena shooter based on the C and OpenGL DarkPlaces engine, with large assets and multiplayer. The reported result is playable without an installation or plugins, including matches against bots.
They compiled DarkPlaces to WebAssembly and WebGL2, running the engine on a worker through Emscripten's PROXY_TO_PTHREAD. An OffscreenCanvas lets the worker own the WebGL context directly. This arrangement allowed them to remove Asyncify. They also converted textures to Basis Universal/KTX2 for load-time GPU transcoding and re-encoded audio as Ogg Vorbis.
A streamed virtual filesystem backed by Cloudflare R2 loads a small boot set, prefetches a map's working set and streams other assets as surfaces draw. The author added wasm128 SIMD and hosted behind a Cloudflare Worker with the headers needed for threads and SharedArrayBuffer.
For multiplayer, a six-character invite code connects browsers through an unreliable, unordered WebRTC DataChannel. A Worker relays the initial handshake; game traffic then travels directly between browsers. The author tested a real one-on-one match between Edmonton and Bangkok and says it held up across the Pacific. They invited bug reports.
Who it's for: Game-porting developers tackling browser execution, large asset delivery and peer-to-peer multiplayer.
Prompt
Suggested prompt (written by Agents In Use, not the author's)
Source: Hacker News · astlouis44
Frequently asked questions
How does browser multiplayer connect?
The post describes a six-character invite code and a WebRTC DataChannel configured as unreliable and unordered. A Cloudflare Worker relays the handshake; subsequent game traffic is peer-to-peer.
What testing does the author report?
They report profiling a match and testing a real one-on-one game between Edmonton and Bangkok, which they say held up across the Pacific. They also request bug and glitch reports.
More details
Remaining steps
- Added WebRTC multiplayer and tested a match between Edmonton and Bangkok.
About this account
Claude Code assisted the port and technical optimization work; the author describes the effort as work they and Claude focused on together.
Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=48428134. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.
Credit: astlouis44 on Hacker News
Source published
Added to Agents In Use
Source checked
Tools and topics
Claude Code · DarkPlaces · Emscripten · WebGL2 · Cloudflare R2 · WebRTC
WebAssembly · Game porting · WebRTC
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.