Back to projects

Traffic Sim

A calm city builder about traffic: draw roads, place homes and workplaces, and time the lights while commuters follow real right-of-way rules.

A top-down city builder in Unity where the challenge is the traffic. You draw 2-lane and 4-lane roads, place homes, offices, shops and industry, and keep commuters moving between them without going bankrupt.

  • cars follow a car-following model: a time gap to the car ahead, braking that eases in, slowing for bends, and queues that pull away in a ripple
  • right-of-way at every junction: the main road has priority, then priority to the right, turns across traffic yield, and no one blocks the box
  • traffic lights with smart timing that skips directions with no cars
  • drive on the left or the right, with every rule mirrored
  • automatic day and night, with headlights and lit windows

Built by scripts

The HUD and the main menu are generated by editor scripts from a design mockup, and the menu's backdrop city is baked from the same layout data its live traffic drives on.

Traffic changes are checked with play-mode stress tests that build awkward junctions and count crashes and stuck cars over several in-game days.