0xreversed/with.ai
Games and modsWorks
Target: Urban Terror

Got Urban Terror running in the browser after Claude Fable found a 4-byte struct mismatch

Urban Terror: A Quake 3 mod in the browser, fixed by finding a 4-byte offset.
Image: @levelsio on X

What was done

levelsio's WebAssembly port of the Quake 3 based shooter Urban Terror loaded but would not play. Claude Fable 5.1 found that the engine's struct was 4 bytes longer than the game's bytecode expected, and rewrote the bytecode.

Pieter Levels (levelsio) got Urban Terror, a shooter built as a mod on the Quake 3 Arena engine, running in the browser through WebAssembly. Six months earlier his port loaded but would not play. Claude Fable 5.1 on high effort found the cause: a struct size mismatch between the engine and the game's compiled bytecode.

How it was done

Because Urban Terror runs on the Quake 3 engine, the plan was to build ioquake3 for WebAssembly, add a multiplayer server and have it just work. The port stayed buggy and never really played. A new try with Claude Opus 5.5 did not fix it either. On a last attempt with Fable 5.1, the model reported that the engine's struct was 4 bytes longer than what Urban Terror's bytecode expects, so everything after it, the entity count and the entity list, was read 4 bytes off. It then rewrote the bytecode to match.

Results

The game now runs fully in the browser at ut.pieter.com, tied to a multiplayer server, and the post's video shows Levels playing it with a friend. The post shares no code, and the fix is only described at the level above.

From the source