Games / Crazy Mountain Drive 3D / How it was made

How Crazy Mountain Drive 3D was made

Seven mountain roads, twenty cars and a physics engine running in a browser tab: how the roads are grown from a curve, why every hazard is signed, how the cars were built with a kit, and what the game does to stay smooth on a phone.

A survival game, not a race

Crazy Mountain Drive 3D started with one question: can a browser game make a mountain road feel dangerous? There is no opponent to beat and no lap time. Each road runs from a start gate to a finish gate, and the only goal is to arrive with health left. The mountain wins if you go over an edge, lose all your health or, on the last road, get buried by the avalanche.

Seven roads climb from a sunny lake pass of 3.2 kilometres to a snowy summit of 7.5 kilometres. Each one is longer, narrower and meaner than the last: more hazards per kilometre, fewer guardrails and less grip. The hazards grow with them, from slow cars and small rocks to black ice, lightning, broken bridges and the avalanche that chases you on Level 7.

Roads grown from a curve

Every road begins as a smooth curve drawn through the mountains. The game turns that curve into asphalt with painted lines, gravel shoulders, rock walls, guardrails, bridges, tunnels and signs, and places the hazards along it. Distant ranges, forests of pine cards and grass on the verges fill the view, and the textures for all of it, from the asphalt and gravel to the cliff faces and snow, are scans from Poly Haven released into the public domain.

The skies are photographs too. Each level has its own high dynamic range panorama that also lights the scene: a clear alpine day for Level 1, a late afternoon over a dusty canyon for Level 4, a sunset for Level 5, storm clouds graded to night for Level 6 and cold bright snow for the summit.

Physics you can feel through the tyres

The car is simulated by Rapier, a physics engine that runs 60 times a second, as a body on four rays rather than a scripted slide along the road. Each tyre's grip comes from the surface under it: wet asphalt grips at 80 percent of dry, gravel at 70, mud at 55, snow at 50 and black ice at only 35. That is why the car feels different on a glossy patch before you can see why, and why off-road cars, which lose less on loose ground, are worth buying for the later roads.

I wanted every crash to feel like your mistake rather than bad luck. So every hazard is signed on the road and appears on screen with an icon and a word at least 1.5 seconds before it can reach you, often with a trickle of dust or snow, a deep rumble or a horn.

Twenty cars from a kit

There are 20 cars in 7 tiers, and every one is an original design with a made-up name. Six of the bodies are models by other artists, changed for the game with new wheels and materials and every logo removed; the guide's credits name them. The other fourteen were built for the game, and ten of those, from the Pip Hatch to the Pursuit Interceptor, came out of a car kit I wrote for Blender: scripts that build a body from a class, a stance and a set of parts, then paint it, texture it and render its garage pictures.

Each car ships in three levels of detail, around 140,000 triangles up close, 36,000 at a distance and 7,000 far away, so a phone draws the car in front of you in full and the traffic cheaply. The garage shows the detailed version on a turntable with a studio floor and a contact shadow.

Recorded sound, eight engines

Unlike my other games, the sounds here are recordings: public domain engine, tyre, impact and weather recordings from BigSoundBank, cut and layered by a script. Each of the eight car classes, from the hatchback to the monster truck, has its own engine family that rises from idle with the revs, with a limiter that bounces at the top and a crackle on the overrun. The music sits below the engine so the car always leads.

Keeping it smooth on a phone

The game picks a graphics quality for your device when it starts and lowers its resolution when a scene gets heavy. A small script in your browser keeps copies of the road and car files it has downloaded, so the next visit loads faster. If the browser drops the graphics context, which happens on phones under memory pressure, the game restores it and carries on instead of going black. A bot drives every road and every car in a headless browser before each release, measuring frame rate, memory and how far the camera trails the car at speed, and the build stops if a number slips.

Ready to drive? Start with How to play Crazy Mountain Drive 3D, or see what changed in the update notes.

Play Crazy Mountain Drive 3D