
Kart Arena: a real indoor track, rebuilt as a browser game
About the footage: the clip under What shipped comes from the live game and shows the first seconds of a four-lap race. A bot that follows the racing line drove it, so the lap times you see are the bot’s, not a person’s. The game has one driving camera, the cockpit view.
The brief


Guests at an indoor karting venue wait for their session. We built a game for that wait, one they open on their phone from a QR code. It is a virtual copy of KartArena Plzeň’s own track, so they drive the corners they are about to drive for real. A race ends on a results screen with a button that opens the venue’s booking page.
The game runs in Czech, English, German and Ukrainian.
The constraint that shaped everything
There was no survey and no drawing of the track, so it had to come from phone video. We walked one lap down the middle of the track with an iPhone 16 Pro (4K, 24 fps, 3 min 54 s). We pulled 701 frames and ran structure-from-motion (COLMAP) to recover the camera path: 693 frames registered, 136,079 points, 0.85 px reprojection error.
The game had to run primarily on phones. It has one runtime dependency (three.js) and no physics engine. Geometry is procedural and textures are drawn at runtime, so the only image files are the venue’s logo and icons (82 KB).
The problems
The pillar grid fooled the reconstruction

The hall has a regular grid of identical red columns, about 9.8 m apart. Loop detection matched frames to look-alike places one pillar period away, so part of the walk was glued onto a shifted copy of the map. We noticed because consecutive frames jumped by the same vector and then jumped back: five jumps of equal length (about 38 m, roughly four bays) along the hall’s long axis. Subtracting the jump made the junctions agree to within 0.6 m. To confirm it, we rebuilt with sequential matching and explicit closure pairs, and the result agreed to a median of 0.42 m. COLMAP’s global mapper collapsed on this hall three times.
Scale without a tape measure

Our first scale came from an assumed phone height of 1.40 m, good to about 7%. The OpenStreetMap footprint (177 x 46 m) is the whole building, and filling it with the track would have meant walking at 2.65 m/s. For the second capture we filmed a walk with the phone at about 1.175 m, and a phone on a kart’s nose over two slow laps. The videos put the kart camera 0.51 m above the floor, where we had guessed about 60 cm. The first track was about 4% too big from scale alone. The current lap is 336 m, with road width measured along the whole lap (3.1 to 6.9 m, median 4.5 m).
Rendering the game from each frame’s camera pose

We converted each video frame’s camera pose into game coordinates and rendered the game from that exact pose and field of view, for 19 poses in headless Chromium. Sheets of real frame, game frame and a 50% blend show position errors as doubled edges. The figure above shows three frames from the second capture’s walk video, with the game rendered from the same pose today. The sheets exposed three causes. The walker had been on the inside in 89% of tight corners, by 0.98 m on average. Widths were stored per corner, so a 7 to 8 m hairpin width bled down a straight about 4.3 m wide. And our barrier model could not describe the venue. Re-centring between the scanned barriers lengthened the lap to 406 m, an intermediate value the second capture later replaced.
Barriers and collision that match a real hall

The old engine put tyre barriers 1.3 m outside the road edge, limited the kart by its distance from the centreline and put kerbs on every tight corner. KartArena has panelled barriers, painted corner markings and pillars wrapped in tyre rings. We rewrote barrier geometry as one module shared by the renderer, collision, track editor and tests. Collision then showed a flaw in our measurement: the new bumper sank up to 0.146 m into a barrier. We wrote a test that fails if any bumper outline point goes more than 6 cm in, then built the collision shape from two body circles plus a small circle inside each of 28 outline points. Penetration is now 0.000 m.
Handling tuned to real lap times

Our first physics lapped about 4 s too fast and reached 30 km/h in about 1 s. The venue times we were given are 37 s for a very fast lap and 38 to 41 s for a typical one. We built a racing-line bot as a measuring instrument: it drives a minimum-curvature line through the real physics at the speed the kart’s grip allows. A parameter sweep set top speed at 16.5 m/s (59 km/h). Then Václav, a racing driver, found it accelerated suddenly out of corners and understeered. We measured both causes on an open floor and replaced the model with a dynamic bicycle model, tests first. The bot then lapped in 37.0 to 37.5 s at the limit and 38.6 to 39.1 s at 85% of it. Those are bot times. They tell us the physics is in the right range, not how a guest will drive it.
Engine sound matched to a recording

We first synthesised the engine in WebAudio and tuned it in the browser against the spectrum of a real kart’s onboard audio. The numbers matched and it still did not sound like a kart: a spectrum match is not a listening test. So the game now plays the real engine. We recorded a KartArena kart onboard and cut the recording into 465 single engine cycles, each tagged by pitch, loudness and throttle. The game plays short runs of real cycles recorded close to the current revs, overlapped in phase, so nothing repeats as a loop. The revs follow the kart’s speed the way they do in the recording, so the corners, where most of a lap is driven, sound as alive as the straights. The synthesiser stays as a fallback.
Full screen on an iPhone

In landscape, Safari’s bar took about a fifth of the screen, and iPhone Safari has no page fullscreen. Our research said to use a Home Screen web app. We noticed that Safari hides its bar when a page scrolls, so we made the page scrollable under the fixed game and added a “swipe up” prompt. On an iPhone, one swipe hid the bar for the whole drive. Testing then found two bugs: the prompt appeared while the phone was held upright, and the menu scrolled instead of the page. We fixed both. A ten-second test on a phone settled it, which none of our sources had done. The stills on this page come from an emulated Android phone, so the iPhone prompt does not appear in them.
What shipped


- A 336 m track with barriers, painted kerbs, a start gantry and a TV leaderboard, inside a 3D copy of the hall.
- A rental kart modelled on kart #43, with six driver suits and a cockpit view.
- A racing line with braking arrows, taken from a recorded lap (35.335 s).
- Countdown, anti-cut checkpoints, a ghost of the best lap, a minimap, a laps selector (4 to 20) and a results screen with the booking link.
- Phone onboarding: language, tilt or button steering, motion permission and the swipe-up step.
- A performance pass. Measured in headless Chromium on a desktop GPU (RTX 4060 Ti) with a 4x CPU throttle, so these are not phone numbers: draw calls fell from 198 to 98 in the menu and from 152 to 95 in a race, and time to menu from 3.7 to about 2.2 s. About 1.3 s of that came from shader compiles, which a boot profile found.
- Automatic graphics quality: the game picks a tier from the device’s GPU, memory and screen, measures the frame rate during play and drops a tier if it stays under 45 fps. It was tested on low-end Android phones at the venue, and no frame-rate problems showed up.
Honest limits
- The floor is only partly matched: the real one is glossy epoxy and ours is still too matte.
- The venue did not want a global leaderboard for now, so the leaderboard lives in the player’s browser.
- The clips and the results stills come from a bot, and some stills use a camera the game does not offer. We say so next to each one.
- The venue uses the game and has advertised it.
Credits
- KartArena Plzeň Client
- AMOX Studios Design, 3D, game engineering, track capture, sound






