DEV Community

CodeLong888
CodeLong888

Posted on

I gave a new AI model my browser racing game and one sentence: "make it AAA quality"

Four days ago my side project mylambo.money got a browser racing game: a 3D supercar with 25 ad panels, and a one-lap race where you start last against the projects on the leaderboard. It worked. It also looked like a tech demo.

Today I opened Claude Code on the new Claude Fable 5.1 model and typed one sentence: "make it AAA quality." I did not write a line of code. This is what happened, with the numbers from the session.

Before and after, same lap: the day version from four days ago on the left, tonight's build on the right

The starting point

  • One file, race.js, 2,028 lines, vanilla ES modules, three.js r180 vendored, no build step (it is a Cloudflare Pages site).
  • 8 rivals on rails. No collisions, no AI.
  • The player car was a point with a heading and a speed. No slip, no body roll. The wheels did not even spin: the hook was called every frame but nothing ever set it.
  • A text 3-2-1 countdown, while the start gantry had five red lights modelled on it that were never used.
  • One synthesised music loop, no engine sound.

What the model did first: split the file

Before touching a feature it refactored the one file into 14 modules, none over 800 lines, with a shared state object and an events bus as the contract between them (physics, rivals, camera, audio, fx, env, hud, track, and so on). Then it spawned five agents, four of them in parallel, one per module group. The four that finished reported 865,875 tokens between them. The fifth hit the account's session limit mid-sentence; its last log line was "Now I have the full picture. Let me make the track.js changes first." It came back three hours later and did.

Nothing could be checked in a browser during the build. Headless Chrome software-renders WebGL on the CPU and has frozen this machine before, so every module was verified with node --check, an import resolver, and a node harness that mapped three to the vendored build and drove the real physics through full laps. 37 assertions for the car, 173 for the seams between modules (a second harness that mounts the real game entry with a stubbed DOM and runs two races, mute, resize, close and re-mount).

The car

  • Velocity-vector physics instead of a point: lateral grip that turns slide into forward speed, a handbrake for drifting (Space), six gears with a torque dip on upshift, nitro (Shift) that refills in a slipstream.
  • Wheels that actually spin and steer. This took measuring the glTF: the wheel nodes are empty groups with the hub at the origin, the tyre is 0.768 m in diameter, and the front axles are yawed 30 degrees in the asset, so each wheel gets a pivot that undoes that before it spins.
  • Body roll and pitch on a pivot under the car, so the 25 sponsor plates lean with it.
  • A clean lap is about 15.6 seconds. The scoring API refuses anything under 9, and it was not touched.

The rivals

Each rival is the same car flattened into four merged buffers (paint, trim, metal, lights), four draw calls instead of about twenty. They now brake for corners using the circuit's own curvature (a 900-sample radius table built once), change lanes to pass slower cars, block the player about 30% of the time when directly ahead, and rubber-band mildly so the field stays within sight. Pole still laps in about 16.1 s, so a clean lap from the back wins by a dozen metres.

The night

The first pass kept daylight, and my verdict when I saw the before/after video was blunt: I did not see any upgrade at all. Fair. The stadium was already there four days ago. So the second pass turned the sun off.

The night race: floodlit circuit, neon hoardings, brake lights

  • A pool of six spotlights re-targeted every frame to the six floodlight towers nearest the car (two on phones), with additive beam cones for all towers in one draw call, and pooled lens flares.
  • Two real spotlights on the player's headlights plus a painted road wedge, because 800-candela headlights blew out everything within 20 metres on the first try.
  • The reflection probe is baked from the venue itself with PMREMGenerator.fromScene once the track exists, so the floodlights reflect in the wet road and the clearcoat paint.
  • Wet asphalt: a puddle mask painted into the roughness map, with a specular cap injected through onBeforeCompile so the floods do not turn the road into a mirror at low camera angles.
  • Bloom with a threshold of 1.05. The 25 sponsor plates are unlit white and render at exactly 1.0, so every threshold below that made the car glow like a lamp. Real emitters are written above 1.0 instead.

The menu at night

The graphics agent could see its own frames: eight rounds of GPU screenshots through Playwright with --use-angle=d3d11, judging each one and fixing the four different ways the image went white before it landed.

Everything else

  • F1 start: five lights on the gantry, one per second, a random hold, lights out, with a camera sweep along the grid.
  • Slow-motion orbit at the flag, then a results screen with top speed, overtakes and a personal best kept in localStorage.
  • Engine, tyre squeal, wind, kerb rumble, gear clicks, overtake chime, crowd roar: all Web Audio synthesis, zero downloads.
  • Tacho with gear numeral, lap bar, gaps to the cars ahead and behind, overtake toasts, tilt steering and haptics on phones.
  • Tyre smoke, skid marks, sparks, speed lines, fireworks, confetti.

Nitro on the straight

What I would tell you

It cost more than two million tokens across the agents and two rate limits, and the visible difference was not the physics or the sound. It was turning the lights off. If you are going to have a model rebuild a game, decide what the screenshot should look like first; the feel is invisible in a video.

The race is live and free, no account: mylambo.money/race. The car model is the Khronos glTF Sample Assets CarConcept, CC BY 4.0.

Top comments (0)