RushHour Simulator is a small 3D city built from a grid of roads and buildings. Cars drive themselves around the city, stop at red lights, and wait behind each other so they never crash into one another. The city can be viewed from a drone above, from inside a car, or from a free-moving top-down camera. Time passes on its own and the sky shifts from day to night, with a sun and moon that rise and set. The player can also take manual control of the traffic lights and the time of day at any moment.
- Procedural City Grid Generation —
generate_city()builds the entire layout (building blocks, road centerlines, intersections) from a few grid parameters (GRID_ROWS,GRID_COLS,BLOCK_SIZE,ROAD_WIDTH). - Multi-Mode Camera System — switch between a drone view, a dashboard/first-person driver view, and a top-down intersection view.
- Self-Driving Cars — cars drive on the right-hand lane of their road and choose randomly to go straight or turn at each intersection, always staying on the grid.
- Automatic Traffic Lights — a single shared controller cycles every intersection through NS-green → NS-yellow → EW-green → EW-yellow.
- Manual Light Control — take over the traffic lights and step through phases by hand, or hand control back to the automatic timer.
- Lights-Aware Driving — cars stop for red/yellow lights before entering an intersection, but always clear an intersection they're already in.
- Collision Avoidance — cars check for other cars ahead of them and stop, so traffic jams form naturally behind red lights.
- Day/Night Cycle — a smooth cosine-based cycle moves through day → evening → night → morning, changing the sky and lighting, with cars' headlights/taillights switching on at night.
Controls:
Camera: Press 1 for the Drone camera, 2 for the Dashboard camera, or 3 for the Free-cam view. In Drone mode, the arrow keys orbit the camera left and right and raise or lower its height. In Free-cam mode, the W, A, S, and D keys move the camera across the city, and the up and down arrow keys zoom in and out. Traffic Lights: Press T to take manual control and step the lights forward one phase at a time. Press G to hand control back to the automatic timer. Time of Day: Press N to instantly switch between day and night. General: Press ESC to quit the simulator.