Quiet Mile is an original open-source 3D browser game about an unhurried, endless drive through a procedurally generated landscape. There are no races, scores, missions, ads, analytics, cookies, API keys, or network requests during play.
The road, terrain, car, rocks, road markings, roadside architecture, vegetation, and sound are created in code. The forest uses original reusable procedural geometry without downloaded models or vegetation textures. Each drive begins at a small parking overlook, while rare deterministic fuel stops and rest shelters appear farther along the road.
Requirements: Node.js 20.19+ or 22.12+ and npm.
npm install
npm run devVite prints the local address. Open it in a modern browser and press START DRIVE.
Production build:
npm run buildThe static output is written to dist/. To inspect it locally, run npm run preview.
Place legally distributable .mp3, .ogg, .m4a, .wav, or .webm files in public/music/. Both npm run dev and npm run build automatically regenerate public/music/playlist.generated.json; do not edit that file manually. Commit the audio files and generated manifest, then push normally. The in-game player uses one streaming HTMLAudioElement, never autoplays before a user action, and keeps its volume separate from the synthesized vehicle audio. An empty folder is supported and displays No music tracks.
Included music credits and usage information are recorded in THIRD_PARTY_NOTICES.md.
Desktop:
W/ArrowUp— accelerateS/ArrowDown— brake, then reverse at very low speedA/ArrowLeft,D/ArrowRight— steerSpace— brakeP— toggle autopilotR— return to the nearest road pointM— mute or unmute procedural audioC— switch between chase and near-hood camerasV— toggle cruise control+/-— change the cruise target in 5 km/h steps- hold the left mouse button and drag — orbit around the car
- mouse wheel — adjust chase distance
F3— toggle diagnostics and chunk bounds in development buildsF4— cycle development inspection views at 90° and 180°F6— toggle the vehicle topology wireframe in development buildsF7— toggle procedural vegetation statistics in development builds
On touch devices, the game displays a wide steering surface on the left and large throttle/brake controls on the right, plus AUTO and RESET buttons. Landscape orientation is recommended but portrait remains usable.
Standard-mapped Xbox and PlayStation-style gamepads are supported. The left stick steers, RT/R2 accelerates, LT/L2 brakes, A/Cross applies the handbrake channel, Y/Triangle changes camera, B/Circle resets the car, the D-pad adjusts cruise speed or changes music, Start/Options opens settings, and the right stick orbits the camera. Deadzones, vibration, and connection status are available under CONTROLS in the settings panel.
Steering takes over from autopilot immediately, while braking disengages both autopilot and cruise control. The accelerator remains available as a temporary speed override.
The instrument-style cruise panel sets a shared target from 5 to 375 km/h for both manual driving and autopilot. In manual mode cruise controls the pedals while the player steers. Holding the accelerator temporarily overrides the target for a smooth boost; releasing it returns to the selected speed. Braking disengages both cruise control and autopilot. Steering takes over from autopilot without dropping the active cruise target.
The HUD odometer measures the car's actual three-dimensional displacement. TRIP starts at zero on every page load, while TOTAL is retained locally between sessions. Reset and floating-origin repositioning re-anchor the measurement and never add teleport distance.
An automatic six-speed transmission gives each speed range its own drive ratio and uses hysteresis for stable shifts. The HUD reports the current gear and engine RPM. Upshifts under load briefly interrupt torque, move the body on its mounts, drop the synthesized engine pitch, and may trigger code-generated exhaust flames and a short Web Audio backfire pop.
The renderer uses sRGB output, ACES tone mapping, a procedural gradient sky, atmospheric fog, soft local shadows, and code-generated asphalt and terrain variation. ProceduralVegetationFactory creates three irregular pines, three dense spruces, two young conifers, birch, aspen, five full-size shrubs, three low shrubs, two ferns, five grass clusters, dead trees, a stump, and a fallen branch. Trees use joined tapered trunks, real low-sided branch geometry, and many irregular solid foliage clusters rather than cone-on-cylinder primitives. Every repeated variant uses InstancedMesh, shared materials, subtle instanceColor, and texture-free procedural bark/foliage shading. Trees have staggered NEAR/MID/FAR LOD tiers; shrubs and ground plants have NEAR/MID tiers and disappear when too distant to matter.
Wind is a lightweight vertex-shader deformation. Roots remain fixed, adult trunks barely move, and upper branches or small plants receive stronger phase-varied motion. Seed-derived placement and transforms remain identical across chunk reuse, renderer resize, floating-origin shifts, quality changes, and LOD changes.
The HUD offers three quality profiles. LOW reduces pixel density, shadows, vegetation, and viewing distance for modest phones. MEDIUM is the balanced default for powerful mobile devices and typical laptops. HIGH increases vegetation, shadow resolution, and atmospheric range for desktop hardware. The initial profile is selected automatically and the choice is remembered locally.
The centerline is a deterministic, smooth mathematical curve based on one seed. Its logical Z coordinate always advances, which prevents self-intersections; low-frequency components create gradual corners and elevation changes. Every seed reproduces the same drive. A local closest-road projection tracks road distance, chunk index, and lateral offset independently from render coordinates.
The visible world is a transactional pool of road/terrain chunks keyed by vehicle road progress, never camera position. Five chunks behind and fourteen ahead form the steady safety range. Missing chunks are completed before distant chunks enter the pool, so the vehicle chunk cannot disappear between generation and rendering. Geometry, normals, bounding boxes, bounding spheres, and instance bounds are recalculated whenever a pooled chunk changes logical index or the floating origin shifts.
The terrain profile is anchored to the road surface across the full shoulder width, preventing the carriageway from floating above the landscape. The permanent starting parking area moves with the same floating origin as the streamed world. Fuel stops and picnic shelters use seed-derived placement and reuse each chunk's object container, so their appearance remains reproducible without growing the active world. Their foundations flatten and blend the local terrain, and paved connectors share a collision surface with the vehicle so the player can leave the road and drive onto each area.
Landscape detail is split into near (88 m), mid (280 m), and far (820 m) zones. The far geometry extends beyond the 720 m maximum fog horizon and ends in lowered skirts, preventing a side or rear orbit view from exposing the physical terrain edge. A floating render origin keeps the car near zero while logical road distance continues indefinitely.
src/game— main loop, renderer, scene, resize handling, damped camerassrc/world— deterministic road function, chunk pool, terrain, procedural vegetation factory, instancing, shader wind, and LODsrc/vehicle— original lofted muscle-coupe model, lightweight vehicle dynamics, autopilotsrc/input— unified keyboard, Pointer Events, and standard Gamepad API inputsrc/audio— synthesized engine and band-limited tire rumble, plus a very low-level oscillator airflow layer without looping white-noise windsrc/ui— start screen and responsive HUDsrc/config— centralized tuning values
Physics run at a fixed 60 Hz. The car owns its world-space velocity and physical heading; local -Z is the only forward direction and local +X is right. A dynamic bicycle-style steering model derives yaw rate from wheelbase, real steering angle, and longitudinal speed. World velocity is decomposed into longitudinal and lateral components, with gradual tire grip preserving a small natural slip angle. Engine force, separate braking, rolling resistance, aerodynamic drag, reverse, speed-sensitive steering, and increased off-road resistance are integrated in meters and seconds.
The simulation uses one world unit per metre and stores velocity only in metres per second. Shared kmhToMps and mpsToKmh helpers handle UI/configuration boundaries. Development stability mode includes a ten-second speed calibration at 60, 100, 120, and maximum speed, plus a 30/60/120 FPS consistency check.
The camera consumes vehicle state only after each physics update and never feeds orientation or direction back into movement. Mouse/touch orbit is stored as an angle relative to vehicle heading; it supports a full horizontal turn, constrained pitch, 4.5–12 m zoom, terrain clearance, and delayed frame-rate-independent auto-centering while driving. Autopilot produces the same throttle, brake, and steering interface as keyboard and touch input; it never writes vehicle position or heading. Three damped gameplay cameras remain available: chase, close chase, and hood.
The code-generated coupe uses a continuous 96-section BufferGeometry body shell rather than a box body. Cubic interpolation shapes the long crowned hood, shoulder line, flared fenders, short rear deck, and low curved roof. Real mesh openings and separate lips form the wheel arches. The model also includes recessed fascias, four layered round headlights, curved glass, bucket seats and a rear bench, a detailed steering wheel and dashboard, rounded lathed tyres, five-spoke wheels, rotating brake discs, stationary calipers, underbody components, hollow dual exhausts, and procedural PMREM reflections. No downloaded model, marque, badge, or trademark element is used.
Development acceptance modes are built in: press F6 to inspect topology, or open ?vehicleSilhouette=1 to assign a single black material and evaluate the outline independently of paint and trim.
For a constant-pool sanity check in development, press F3 or run window.__quietMileDiagnostics() in DevTools before and after a long drive. The overlay reports FPS, draw calls, triangles, geometries, and textures; resource counts remain unchanged as chunks stream.
This is a static Vite application and needs no Workers, Pages Functions, database, secrets, or environment variables.
- Push the project to a GitHub repository.
- In the Cloudflare dashboard, open Workers & Pages, choose Create application, then Pages and connect the repository.
- Select the production branch (usually
main). - Set Build command to
npm run build. - Set Build output directory to
dist. - Save and deploy. Cloudflare Pages will build a new deployment after subsequent pushes to the production branch.
The app is configured for the site root (/) and all runtime dependencies are bundled locally.
The repository also includes wrangler.jsonc for deployments created as a Cloudflare Worker with static assets. In that configuration use npm run build as the build command and npx wrangler deploy as the deploy command. Wrangler uploads dist/ directly; no Worker script, backend, observability, bindings, or runtime API is used.
.github/workflows/ci.yml runs npm ci, strict TypeScript type checking, and a production build for pushes and pull requests. The repository stores no secrets and the game makes no external runtime requests.
Original project code is available under the MIT License. Runtime and build dependencies use permissive licenses suitable for commercial use; see THIRD_PARTY_NOTICES.md. All vegetation code and geometry are part of the original MIT-licensed project.
