Skip to content

About

One arcade racing game built six ways (Three.js, Three.js on Bloom, Bloom native, hybrid, a real-world port, Bevy) from one spec and one asset set, with every agent log, benchmark and finding.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

One racing game, six ways

The same small arcade racing game was built five times from one spec and one shared asset set: plain Three.js in the browser, a native port of that Three.js game, Bloom Engine's own APIs, a Three.js-plus-Bloom hybrid, and Bevy in Rust. All five reached a playable 3-lap race. A sixth arm applied the native port to a real open-source Three.js project instead; that port is unfinished (see D below). Every build was done by the same AI coding agent (Claude Opus 5.5 in Claude Code), working from a fixed prompt with no human code edits. This repository has the prompts, the code of every arm, the agents' own logs, the benchmarks and a WebGPU spike.

Update (2026-11-28): three more arms, run on a Windows PC. The same spec was also built in C++ on SDL3 (F), in Unity 6.3 (G) and in Unreal Engine 5.7 (H). All three reached a playable 3-lap race. Because they ran on different hardware and were measured slightly differently, they have their own section and table: Three more arms on Windows.

Write-up: bloomengine.dev/blog/one-racing-game-six-ways

Three.js in Chrome (arm A1) Bloom, WebAssembly build of arm B

The setup

  • One asset set (race-assets/): a car with 4 colour variants, a 2.2 km circuit, scenery, sky, audio, UI icons and a manifest. Everything is generated by script, CC0, and validated with the Khronos glTF validator.
  • One game spec, identical in every prompt (prompts/). It asks for 3 laps against 3 AI cars, plus nitro, drifting, no wall tunnelling, auto-reset, anti-shortcut checkpoints, a chase camera and a hood camera, keyboard, multi-touch and gamepad input, engine audio, a HUD with minimap, and a persisted best lap. The target is ≥ 55 fps on an iPhone 12-class phone. Every prompt has the same 12-point Definition of Done.
  • One agent per arm, in its own fresh folder (setup.sh), with the docs of the tools it was allowed to use. Each arm kept a notes file and a friction or port log, written by the agent as it worked.
Arm What Folder Agent's own log
A1 Three.js + TypeScript, browser arms/a1-threejs-web NOTES
A2 A1 compiled to native with Perry, running on Bloom's Three.js bridge, minimal changes arms/a2-threejs-on-bloom PORT_LOG, NOTES (summary of the log)
B Bloom Engine's own APIs (rendering, Jolt physics, audio, UI), TypeScript compiled by Perry arms/b-bloom-native NOTES, FRICTION
C Hybrid: Three.js on the bridge for rendering, Bloom for physics, input, audio, HUD and storage arms/c-hybrid NOTES, FRICTION
D Port of a real open-source Three.js project (brunosimon/folio-2025 @ 70764a9) arms/d-folio-port INVENTORY, PORT_LOG (unfinished)
E Bevy 0.20.1 + avian3d 0.8.0, Rust arms/e-bevy NOTES, FRICTION
F C++20 on SDL3 3.4.20: the agent's own OpenGL renderer, arcade physics, mixer and HUD (Windows) arms/f-cpp-sdl3 NOTES, FRICTION
G Unity 6.3 LTS (6000.3.29f1), C#, URP + glTFast + Input System, Mono (Windows) arms/g-unity NOTES, FRICTION
H Unreal Engine 5.7.4, C++ only (no Blueprints), Chaos + Enhanced Input (Windows) arms/h-unreal NOTES, FRICTION

Plus bench/ (sizes, startup, memory, and a browser head-to-head) and webgpu-spike/ (can unmodified three.js WebGPURenderer run when compiled by Perry?).

What we found

  1. Bloom native (B) was the shortest path to a finished native game.
    • It took 1 h 13 min of working time (wall-clock minus waits for the user), against 2 h 12 min for the hybrid and 2 h 25 min for Bevy on the same basis. The browser-only Three.js build (A1) took 33 min, but it is not a native app.
    • It produced the smallest app: 71 MB on macOS and 76 MB on iOS, against 131 / 130 MB for Bevy.
    • A one-line change rebuilt in 5.4 s. Bevy took 10–12 s in dev and 5 min 46 s for the same change in a release build (thin LTO), and the hybrid took about 2.5 min, because it recompiles three.js on every build.
    • It ran at a steady 60 fps (vsync cap) on an iPhone 16 Pro on the Low preset.
    • It also made the agent read the most: 61.7M input tokens, the highest of any arm (see the costs table).
  2. Porting a normal Three.js game (A2) touched 2 lines of game code. The port was 17 changes and 428 lines in total. The other 426 lines were adapters (222) and build/packaging (204). The 3D scene was not the bottleneck; the DOM/CSS HUD was.
    • On an iPhone 16 Pro the port ran at 38.4 fps at first. The bridge's page engine spent 14–17 ms a frame on about 10,200 HUD draws.
    • A phone profile (Low preset, flat HUD stylesheet, page updates at 30 Hz) brought it to 59.5–59.8 fps. None of the three was enough alone: Low alone gave 43.9 fps, and Low plus 30 Hz gave 49.4.
    • A Web Audio emulation bug also took the game from 57 to 35 fps after about 3 minutes.
  3. The same bridge gaps kept coming back in A2, C and D:
    • Points, Sprite, Line and InstancedMesh are not drawn.
    • Normal and ORM maps are dropped, and so is the equirect sky background.
    • The 2D canvas is incomplete.
    • Three of A2's five most-wanted bridge improvements are on this list: drawing sprites, instancing, points and the sky; the 2D canvas; and Web Audio's event history. C's top request was a bridge feature matrix in the README, so that gaps like these are known up front instead of found by debugging.
  4. A real-world port (D) needed 0 lines of game code changed, and still did not fully arrive.
    • folio-2025 needed an ~820-line Rapier→Jolt facade, patched copies of GSAP, Howler and three's TSL files, and a staged asset pipeline.
    • It surfaced Perry bugs that no small test had caught. Spreading arguments into the constructor of an imported class silently turned every TSL colour white.
    • Shader-driven content (TSL node materials, GPU compute particles, post-processing) cannot run on the bridge's renderer, so most of folio's look was lost.
    • The agent's port log stops before its required summary. Treat D as a stress test, not a finished port.
  5. Unmodified three.js WebGPURenderer compiled by Perry is correct, but too slow (spike).
    • After two Perry fixes, the WGSL and the WebGPU call stream were byte-identical to Node's.
    • CPU time per frame was 3.4–5.0 ms against 0.33–0.37 ms in Node, about 10–12× slower.
    • About 62 % of frame time went to runtime slow paths. A missing-property lookup on a deep class chain costs 39.8 ns in Perry against 0.7 ns in Node.
    • So providing navigator.gpu on wgpu is a viable route for Three.js on Bloom. The blocker is Perry's runtime speed, not correctness.
  6. On the web, Three.js is still clearly ahead of Bloom's WebAssembly build (results). Both held 120 fps in Chrome on an M1 Max, but Bloom+WASM was worse on everything else:
    • It loaded in 3.44 s against 0.56 s.
    • It used 4.28 ms of page CPU per frame against 2.00 ms.
    • It used about 380 MB more RAM during a race.
  7. Bevy got there, but it was the heaviest build.
    • A clean macOS release build (empty target directory, Bevy default features) took 11 min 27 s, and binaries were 95 MB.
    • Most of its friction was API renames between Bevy versions and ECS access conflicts reported without system names.
    • It never ran on a real phone; the only mobile number comes from the iOS simulator.

Numbers side by side

A1 Three.js web A2 port B Bloom C hybrid E Bevy
Agent working time (wall-clock minus waits for the user)† 33 min 2 h 38 min 1 h 13 min 2 h 12 min 2 h 25 min
Model calls 62 165 186 138 163
Input tokens (incl. cache) 12.0M 36.3M 61.7M 37.4M ≈44.2M
Output tokens 175k 112k 184k 156k ≈214k
Clean release build – ≈2 min first native build, not labelled release, excl. one-off ≈26 min Perry build 267 s (+282 s engine) ≈2.5 min 11 min 27 s
One-line rebuild – ≈16 s 5.4 s ≈2.5 min 10–12 s dev / 5:46 release
macOS app 36.5 MB web dist 94 MB 71 MB 52 MB binary + 48 MB assets (no .app built) 131 MB
iOS app – 103 MB 76 MB ≈107 MB 130 MB
iPhone 16 Pro fps – 59.5–59.8 (Low preset + flat HUD + 30 Hz page; 38.4 without) 60 (vsync cap) 59.96 avg, min 55.6 not run on a device
Friction / port-log entries – 17 29 16 14

† Measured the same way for all five from the Claude Code session logs: first prompt to the agent's last message before it was asked to log its effort, minus every stretch where the agent was waiting for the user. Raw wall-clock: A1 33 min (no waits), A2 2 h 57, B 1 h 27, C 3 h 20 (68 min of it waiting for an iPhone to be unlocked), E 2 h 56. The arms' own logs used different endpoints, so their self-reported times (e.g. E's ≈3 h 09) differ from these.

The asset set itself took 63 model calls, 10.4M input and 191k output tokens, and about 34 min (BUILD_TOKENS). D is not in this table: its port is unfinished and it has no time or token record.

Sources for every number: the arm's own NOTES, FRICTION, PORT_LOG and TOKEN_USAGE files, and bench/results. Token counts are sums of the per-call usage records in each Claude Code session log.

Read this before quoting any number

  • Arm D is unfinished. The folio-2025 port stops before its required summary and never states whether the game is playable; it is a map of what breaks, not a result to compare.
  • One run per arm. These are anecdotes with numbers attached, not statistics. Agents make different choices on a second run.
  • The builder was an AI agent, not a team of humans. The numbers say as much about how well each stack's docs and errors guide an agent as about the stack itself. Every arm got the same model. Arms A1–C and E got the same game spec, with different docs; D had its own prompt and ported a different game (folio-2025).
  • No iPhone 12-class device was tested. The spec's 55 fps target was measured only on an iPhone 16 Pro (B, C, A2), in the iOS simulator (E), or on desktop Chrome with throttling (A1).
  • Not verified with a real hand on the device: multi-touch, gamepad, and engine audio by ear (E's audio was never listened to).
  • The browser benchmark compares the apps as built, not the engines. Bloom's web build had no tyre smoke or skid marks. The native size/startup run was a single launch on a busy machine.
  • The toolchain moved during the experiment. B used Perry 0.5.1664. C pinned 0.5.1663, because 1664 miscompiled three.js. A2 built Perry from main.
  • Gaps in the logs. A2's agent never updated its NOTES.md, so the file first published here was an unchanged copy of A1's. On 2026-11-26 it was replaced with a short summary written from A2's PORT_LOG.md, which remains the agent's own record; the original copy is in git history (commit 5425ad5). C did not report its app sizes or an incremental build time; the numbers above come from du.

Three more arms on Windows (F, G, H)

Added on 2026-11-28. Same game spec, same asset set, same 12-point Definition of Done, same model (Claude Opus 5.5), no human code edits. The prompts (F_cpp_sdl.txt, G_unity.txt, H_unreal.txt) share the spec text of the Bevy prompt word for word. Only the opening section, the language-specific quality-bar lines, the build metrics asked for and the friction-log name differ. They target Windows desktop first, because the machine is a Windows PC with no Mac.

  • F (C++/SDL3): the agent chose to write most of the stack itself: an OpenGL 3.3 / GLES 3.0 renderer, an arcade vehicle model, a mixer on SDL's audio stream and the HUD. Its dependencies are SDL 3.4.20, cgltf, stb and nlohmann/json, fetched by CMake and pinned by hash. The game code builds with zero warnings at /W4 /WX, and a full race under AddressSanitizer reported no errors.
  • G (Unity): the agent never opened the editor GUI. Scenes, prefabs, materials, the URP asset and the build all come from C# editor scripts run in batchmode. The Unity project is in game/, because Windows paths ignore case, so Unity's Assets/ folder and the read-only assets/ folder would have been the same folder.
  • H (Unreal): all game logic is C++, with no Blueprints, because those are binary files the agent can't write. The assets were imported by one headless editor Python script (Interchange), and the map is built at runtime. Chaos's own continuous collision detection (CCD) let 1–2 of 10 cars through a wall at 300 km/h, so the agent added its own wall sweep; after that, 0 of 10 got through.

Findings

  1. All three finished in about an hour of agent time: 63 min for C++/SDL3, 72 min for Unity and 71 min for Unreal. None of them needed a human during the run.
  2. Each arm passed Definition of Done items 1–11 with test modes it built into its own game. These test modes inject keys and touches, log the results and save screenshots. Item 12 (≥ 55 fps on an iPhone 12-class phone) could not be measured, because no phone build is possible on this machine: there is no Android SDK, NDK or JDK, and no Mac. Each arm's NOTES lists exactly what is missing for Android.
  3. The C++ arm was the fastest to build and the smallest. A clean build including dependencies took 38–40 s, a one-line rebuild 2.2–2.4 s, and the Windows build is 40.5 MB, of which 37.3 MB is assets.
  4. The engines cost size and rebuild time, not agent time. Unity's player is 152 MB, with a 15.1 s one-line rebuild run in batchmode all the way to a finished player. Unreal's package is 333 MiB, about 32 MiB of it from ML plugins the game doesn't use (NNE, DirectML and onnxruntime) that the engine enables by default. Its one-line C++ rebuild took 8.8–10.6 s.
  5. Unreal used the most tokens (56.6M input, 268k output), against 29.1M and 32.3M input for C++ and Unity.
F C++/SDL3 G Unity H Unreal
Agent working time† 1 h 03 min 1 h 12 min 1 h 11 min (+5.5 min aborted first attempt)
Model calls 124 135 186
Input tokens (incl. cache) 29.1M 32.3M 56.6M
Output tokens 218k 198k 268k
Clean release build 38–40 s, dependencies included 105.1 s (Library/ deleted, to finished player); first editor import 61.4 s 131.8 s full Shipping package incl. cook (game target alone 51.7 s)
One-line rebuild 2.2–2.4 s 15.1 s, to finished player 8.8 s editor module / 10.6 s Shipping exe
Windows build 40.5 MB 152 MB 333.4 MiB
Uncapped fps on this PC, full race, 4 cars ~277 at 1920×1080 ~445 at 1280×720; 227 at 2532×1170 215.6 at 1920×1080 (Shipping)
With vsync / 60 fps cap 59.9 59.99 –
Phone build not possible here not possible here not possible here
Friction-log entries 9 13 14

† From the subagent transcripts: first prompt to final summary. These agents never waited for a human, so wall-clock equals working time. See each arm's TOKEN_USAGE.md; the full subagent transcripts (JSONL, one record per message and tool call, with a .meta.json each) are in arms/<arm>/transcript/.

Read this before comparing with arms A1–E

  • Different machine. The PC is a Windows 11 machine with an AMD Ryzen 5 7640HS, integrated Radeon 760M graphics and 26 GB RAM. Arms A1–E ran on an M1 Max Mac and an iPhone 16 Pro, so their build times and fps can't be compared directly with these.
  • Run as subagents. F–H ran as Claude Code subagents of one parent session, not as standalone sessions. Each was given its prompt verbatim plus a short preface: work only in your folder, don't look at other arms, and record any blocker instead of asking. Token counts are summed from the subagent transcripts, the same way as for A1–E.
  • One run per arm, no device. As with the earlier arms, these are anecdotes with numbers attached. There is no phone number for any of the three.
  • Checked by automated tests and screenshots, not a real touchscreen or gamepad. Multi-touch was tested with simulated touches, and nobody listened to the engine audio during the runs. A person played all three Windows builds afterwards, and they worked as they should.
  • A restart and background load. H was stopped by accident after 5.5 min and restarted from a clean folder; its NOTES record this. The Unity editor download and install shared the machine with the start of F and the start of H.
  • The C++ arm is a library, not an engine. Its small size and fast builds come partly from writing less: a simpler renderer and no physics engine.

Repository layout and what was removed

  • race-assets/: generator scripts plus the generated assets. Run make assets to rebuild them.
  • arms/*/assets is a symlink to race-assets/assets, so the 48 MB asset set is stored once.
  • Removed from every arm: build output (dist/, .app bundles, binaries), node_modules, logs, iOS provisioning profiles, and the original git history.
  • Signing identities and local paths were replaced with placeholders (YOUR NAME (TEAMID), $HOME/projects/..., <racer>/...). To build the native arms you need Perry, Bloom Engine, and your own Apple signing setup; see each arm's NOTES.
  • arms/d-folio-port/ holds only our port work (bloom/ adapters, build scripts, the inventory and the port log), plus the upstream MIT licence. To reproduce it, check out folio-2025 at 70764a9 and copy bloom/ into it. folio's own models, textures and music are not redistributed here.
  • Arms F–H: only the files each agent committed (build folders, Unity Library/, Unreal Intermediate/, Saved/, DerivedDataCache/ and the packaged builds are excluded by their own .gitignore). From G we also removed a stray game/TestOutput$NAME folder, which a test script wrote by accident when a shell variable wasn't set. G keeps its imported copy of the assets in game/Assets/RaceAssets (byte-identical, so git stores them once), and H keeps its imported .uasset files. A few of those binary .uasset files still record the local path they were imported from. To build: F needs MSVC + CMake + Ninja, G needs Unity 6000.3.29f1, and H needs UE 5.7.4; see each arm's NOTES. ./setup.sh F|G|H <run> creates fresh run folders.

Licence

  • Code: MIT, see LICENSE.
  • race-assets/assets: CC0-1.0, except the Russo One font (SIL OFL 1.1, licence alongside).
  • arms/d-folio-port is a derivative of folio-2025: MIT, © 2025 Bruno Simon (see its license.md).

About

One arcade racing game built six ways (Three.js, Three.js on Bloom, Bloom native, hybrid, a real-world port, Bevy) from one spec and one asset set, with every agent log, benchmark and finding.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages