Levelsio says Claude Code helped port Battlefield 1942 to the browser
Levelsio released a browser-playable multiplayer port of the Battlefield 1942 demo. He reports using one million output tokens to decompile the game and convert it to C and WebAssembly.

TL;DR
- Battlefield 1942’s demo now runs in a browser, as levelsio’s first video demonstrates.
- Claude Code handled a machine-code-to-C-to-WebAssembly conversion, including graphics and networking rewrites, according to his technical account.
- The project consumed roughly one million output tokens on a $100/month Claude subscription, according to his usage post.
- Multiplayer capacity went from 16 to 64 slots between his first server update and his follow-up.
He says he revived a six-month-old failed attempt with “Opus 5.5” and the prompt “can you try port the BF1942 demo in this folder to web”. The build ran on a MacBook Pro before deployment to Ubuntu, according to his reply about the setup.
From x86 to WebAssembly
Levelsio says he started with compiled machine code and worked through six stages:
- Disassembly: Identify approximately 57,000 x86 functions in the executable.
- x86 → C: Translate machine instructions into C functions. His example turns
mov eax, [esi+0x110]intoeax = READ32(esi + 0x110). - C output: Generate approximately 100,000 lines of C.
- C → WebAssembly: Compile that output with Emscripten.
- Windows/Direct3D → WebGL 2/OpenGL: Rewrite approximately 300 platform-specific functions for the browser.
- Multiplayer networking: Build a custom network stack connecting the browser client to a multiplayer server through WebSockets.
The playable project’s page identifies the graphics work more specifically as DirectX 8 reimplemented on WebGL 2. Rebuilding those Windows-facing interfaces is the impressive bit.
Emscripten’s graphics documentation describes an OpenGL subset that maps directly to WebGL; its networking documentation explains that browsers cannot open TCP sockets directly.
Benchmarks that moved
The server hit its 16-player ceiling after launch. Levelsio then announced 64 slots: 16 → 64, +48 slots.
Across his old-game ports, he also claimed faster loading than on his RTX 5090 gaming PC. The posts provide no timed loading comparison, frame-rate measurements or latency results.
One million output tokens
Levelsio says the work ran through his $100/month Claude subscription. Expanding from output alone to every category in his usage ledger changes the accounting:
- Tokens counted, in millions: 1.0 → 291.2, approximately +290.2 million tokens when input and cache operations are included. Most of that volume consists of repeated reads of cached context.
- Estimated API cost, in dollars: 19.99 → 102.50, approximately +82.51 dollars when input and cache operations are included.
These comparisons count the same run at different scopes; the dollar figures estimate API billing.
Where it regressed
Levelsio describes this as harder than his Quake and DOOM ports: those benefited from existing open-source work, while Battlefield 1942 had no open-source engine to build on, according to his account.
The playable scope is the free demo, as he emphasized in a reply. He also calls the game “abandonware”.
EA’s November 2012 announcement offered a free PC copy through Origin, subject to conditions. That announcement contains no permission to publish a modified browser build.
The browser project describes itself as non-commercial, unofficial and unaffiliated with EA or DICE.
The browser-game museum
Levelsio’s Quake III and DOOM projects already offer browser multiplayer. He describes the goal as “open tab, instant multiplayer”.
His other creator invitation is more outdoorsy: in a separate conversation, he offered to travel and film walks with people doing interesting work.