← Home

Cities

Algorithmically generated city layouts.

At the start of the simulation, the City is seeded with a major road node at a geographically central point. New nodes and edges are gradually added to represent roads and junctions. In the city, there are two types of road—major roads and minor roads. Cycles of major roads form “Quarters” with each Quarter having an assigned type of property (commercial, residential or industrial) and an associated StreetPattern that affects the geometric properties of the random road expansion (for example, road length and angle). Once a Quarter is established, it is filled with minor road expansion. If no Quarters are available for minor road expansion, the major road network is expanded until new Quarters are created.

The main simulation code consists of a road expansion loop that grows the city step by step, picking an existing node in the road network and creating and testing a proposed random road expansion.

Traffic is periodically simulated between residential and commercial areas. Candidate roads become permanent once their traffic usage passes a threshold.