LIKABLE GAMES
Developer notes

How Turbo Rush draws a road that curves (without any 3D)

In Turbo Rush you race down a desert road at sunset. The road swings left and right, climbs over hills and drops away on the other side, while cacti, rocks and signs whip past and slower cars crowd the lanes ahead. It looks like a 3D world.

It is not. There is no 3D model anywhere in the game: no 3D road, no 3D cars, no 3D cactus. Everything you see is a flat shape drawn in exactly the right place at exactly the right size. The trick is decades old, and it is the same one used by classic arcade racers like Out Run. Here is how it works.

What "pseudo-3D" means

Pseudo means pretend. A real 3D game builds its world out of thousands of 3D shapes and lets the computer work out what the camera sees. A pseudo-3D game skips all that. It draws flat pictures that follow the same rules your eyes use to judge distance, and your brain fills in the depth.

The main rule is one you already know: things look smaller the further away they are. Stand between two railway lines and they seem to squeeze together until they meet at the horizon. They do not really get closer. They just take up less of your view as they get further away. Turbo Rush draws its whole road using that one idea.

A road made of slices

The road in Turbo Rush is a long list of short, flat segments, like slices of bread laid end to end. The track has 1,770 of them, and when you reach the end, it loops back to the start.

Every frame (one of the still pictures the game draws many times a second), the game looks at the next 260 slices ahead of your car. For each one it works out how far away it is, then draws it as a flat four-sided shape, wide at the bottom and a bit narrower at the top. Close slices come out big and low on the screen. Far slices come out small and high up, near the horizon.

The maths behind "smaller when further away" is one division. The game divides by the distance: a slice twice as far away is drawn half as wide. That single step, done for every slice, is what turns a flat list into a road that seems to stretch off into the distance.

The game also has to deal with hills hiding the road behind them. It draws the slices from nearest to furthest and keeps track of the highest point on screen it has filled so far. If a further slice would land below that line, it is hidden behind a crest, so the game skips it. That is why the road vanishes over the top of a hill and reappears as you climb it.

Curves and hills are just nudges

Here is the cleverest part. Nothing in Turbo Rush ever really turns. Each slice just carries a number that says how much the road bends there.

When the game draws the slices, it nudges each one a little further sideways than the one before. The nudges add up. Near your car the road barely moves, but by the horizon it has swung well off to one side. Your eyes see that as the road curving away. Hills work the same way up and down: each slice has a height, and the road rises or falls from slice to slice.

Curves and hills are also eased, which means they fade in and out gently instead of starting all at once. A bend starts soft, holds steady, then softens back to straight. Without easing, the road would kink like a bent paperclip. The whole track is written as a short list of sections, easy, medium or hard curves mixed with low, medium or high hills, and the game turns that list into hundreds of smoothly changing slices when a race starts.

Curves also push back on you. On a bend, your car drifts toward the outside, and the faster you are going the more it drifts, so you have to steer into the turn. The sun and the far-off ridge slide sideways during bends too, which adds to the feeling of turning.

Traffic lives on the road

There are 52 other cars on the track, each cruising at its own speed, all slower than your top speed. Each car is stored on the slice it is currently driving over. When it moves onto the next slice, the game moves it into that slice's list.

That makes crash checks quick. To see whether you hit someone, the game does not have to look at all 52 cars. It only looks at the cars on your own slice. Think of a teacher checking a classroom: it is much faster to check the one row you are sitting in than every desk in the school.

Storing cars this way also helps with drawing. Things are drawn from the furthest slice to the nearest, so a close car always covers a car further away, just like in real life.

Props sell speed

The speedometer in the middle of the screen goes up to 260 km/h. But a number does not make you feel fast. A road with an empty roadside reads as slow, however quickly it scrolls. What makes you feel fast is things rushing past at the edge of your view.

So the roadside is busy on purpose:

  • Marker posts hug the edge of the road every 6 slices, switching sides, so they tick past in a steady rhythm.
  • Bigger scenery, a cactus, a rock or a sign, turns up every 11 slices, placed further out from the road.
  • Rumble strips along both edges switch colour every 3 slices. That flicker is a big part of what your eyes read as speed.

Getting the size right

Props are drawn with the same "smaller when further away" rule as the road, but each one also needs its own size. We set that size as a fraction of the road's half-width at that distance. The half-width is the distance from the middle of the road to its edge.

  • 0.15 is a knee-high marker post.
  • 0.34 is a road sign.
  • 0.40 is a desert rock.
  • 0.50 is a full saguaro, the tall cactus with arms.

Getting these wrong is easy. A first pass used 0.55 for roadside barrels, and they came out so big that they blotted out the track. You could not see the road you were meant to be steering along. Anything close to 1.0 would wall the road off completely. A small change to one number makes a huge difference on screen.

Checkpoints and the clock

All this drawing serves a simple race. You start with 60 seconds on the clock. Every 250 slices you pass a checkpoint, marked by a band of yellow stripes across the road, and it adds 18 seconds: "CHECKPOINT +18s". That works out to seven checkpoints on each lap.

Passing a car is worth 100 points, and distance adds to your score as you go. Crashing into a car costs you 3 seconds and slows you almost to a stop. Running off the road also drags your speed down. The boost, on space or a tap, gives you just over a second at up to 25% above normal top speed, then needs 5 seconds to recharge. Your run ends when the clock hits zero, with a "TIME'S UP".

Try it at Turbo Rush, and next time you drive over a hill, watch the road vanish behind the crest and come back as you climb. That is one division per slice, for 260 slices, every single frame. If you want to see how we built proper physics instead of faking it, read inside Bumper Bash. For help picking a starter game for a younger player, see which game to play first.

Games in this post