Discord

← All devlog posts

Tyre smoke that behaves like smoke

Two cars doing a burnout in thick tyre smoke on the drag strip

A burnout is the first thing you see before every race, so the smoke has to look right. The first version was what most 2D games do: round smoke sprites that grow and fade. It looked fine in a still image and wrong in motion. The puffs did not care about wind, about the car driving through them or about the rain.

So the smoke is now a small air simulation.

A grid of air behind every lane

Each lane has its own grid of air cells, 3 pixels each. Every cell knows how fast the air moves, how much smoke it holds and how hot it is. The grid steps at a fixed 60 times per second, like the rest of the game:

  • Hot rubber rises. Smoke from a hot tyre is warm and lifts. On a cold day it rises even more.
  • Wind comes from the location's weather and is weaker close to the asphalt.
  • Turbulence and swirls break the cloud up so it never looks like a blob.
  • The asphalt is a wall. Smoke rolls along the ground instead of going through it.

The tread throws smoke backwards at the speed it is slipping, the rest leaks out of the wheel arch. When the car launches, its body drags air along and the cloud gets sucked into its wake.

It builds up

Smoke depends on how fast the tread is spinning and how hot the rubber is. A burnout starts light and becomes a full cloud after about two seconds, the way it does on a real strip.

The same burnout after 1.5, 3 and 4.5 seconds
The same burnout after 1.5, 3 and 4.5 seconds

Weather matters

Rain washes the smoke out of the air, while damp air holds it longer. On the storm location the cloud is thin and low, and the spray from the wet tyres is carried by the same air.

Burnout in the rain on the storm location
Burnout in the rain on the storm location

Still pixel art

A fluid simulation can easily look like a blurry photo pasted into a pixel art game. To avoid that, light comes through the cloud from above: bright tops, dark undersides. The shading is cut down to five tones that match each location, with dithering fixed to the world, so nothing shimmers when the camera moves.

The whole thing costs about 2.5 ms per frame for both lanes, and an empty grid sleeps. It is purely visual: smoke never changes the race result, so the physics stays the same for everyone.

Exhaust bangs blow holes in the cloud too. That one is the most fun to watch, so expect it in a video soon.