Game dev
Saved & recent

Traffic simulation

Also called: traffic AI, vehicle AI

Related terms: lane graph, car following, lane changing, traffic lights, vehicle simulation

The system that makes computer-controlled vehicles move through a road network. Each vehicle follows a route through connected lanes, adjusts its speed to keep a gap, chooses lane changes and responds to signals, junctions and obstacles. Pathfinding chooses where to go; local driving decisions control how to get there.

The visible traffic comes from many vehicles making these decisions together: one red light can produce a queue. Vehicle handling and collisions add a separate physics cost. A simulation can simplify physics for distant cars while keeping their routes and speeds, reserving detailed motion for traffic near the player.

Further reading
CARLA: traffic manager and hybrid physics
gap red signal moving lane green signal
Three cars hold following gaps while the signal is red. The perpendicular lane has green and traffic keeps moving through the junction.

View in the full Game dev collection