About the Generative City Simulator

Procedural generation creates complex structures algorithmically rather than by hand. This city generator uses recursive block subdivision: the canvas is treated as a large city block and split along its longer axis into two halves separated by a road. Each half is split again recursively until parcels reach a minimum size. Roads emerge naturally as the boundaries of these subdivisions, creating a hierarchical street network similar to how real cities grew over decades.

Each parcel is assigned a zone type — residential, commercial, industrial, park, water — based on stochastic rules weighted by distance from the city centre. Buildings are placed within zones, varying in footprint and simulated height to create visual density gradients that resemble real urban morphology: dense high-rises near the centre, lower residential suburbs toward the edges, industrial zones near transport links, and green spaces scattered throughout.

A seeded pseudo-random number generator ensures reproducibility: every seed produces a unique but deterministic city. This simulator is related to techniques used in video-game world generation, urban planning visualisation, and generative art. Clicking regenerate samples a new seed, instantly creating an entirely different skyline from the same algorithm.

Frequently Asked Questions

How does procedural city generation work?

A large rectangle is recursively split into smaller parcels along alternating axes, with gaps between them becoming roads. Each parcel is assigned a zone (residential, commercial, industrial, park, water) by weighted-random rules. Buildings are then placed within parcels according to zone density rules — the whole city emerges from a single recursive algorithm.

What is recursive block subdivision?

Starting with a single rectangle, the algorithm splits it into two smaller rectangles (separated by a road) and recurses on each half until a minimum parcel size is reached. This creates a hierarchical street network naturally, with major roads at the top levels of recursion and minor streets at deeper levels.

How does the seed control the city layout?

A seeded PRNG always produces the same numerical sequence from the same starting value. All random choices — where to split, which zone to assign, building placement — are drawn from this sequence. The same seed always reproduces the identical city; a different seed creates a completely different layout from the same rules.

What real city-planning concepts does this reflect?

Real cities exhibit similar hierarchical road structures (arterials, collectors, local streets) and concentric zoning (CBD, inner residential, outer suburban, industrial periphery). The density gradient — tall dense buildings near the centre, lower-density outward — reflects land-value patterns described by the bid-rent curve in urban economics.

Where else is procedural generation used?

Procedural generation powers world-building in games like Minecraft and No Man's Sky, generates synthetic training data for machine-learning models, creates infinite music and textures in real time, and is used by urban planners to rapidly prototype city layouts. The core idea — complex output from simple recursive rules — appears throughout computer graphics and computational design.

About Generative City

Generative city modeling uses procedural algorithms and agent-based rules to create realistic urban environments algorithmically, without hand-placing every street and building. Inspired by the observation that cities worldwide share statistical regularities — street networks follow power laws, building height distributions are log-normal, land use zones cluster by activity type — generative systems encode these regularities into rules that produce infinite variations of plausible cities from a compact set of parameters. Applications span video game city generation, urban planning visualization, architectural design exploration, and training data for computer vision systems.

Street network generation typically uses one of three approaches: tensor field methods that align streets with principal stress or curvature directions derived from elevation and boundary shapes; L-system grammars that define hierarchical growth rules producing organic or grid-like networks with branching patterns; or agent-based growth where virtual road agents explore terrain following population density gradients, natural boundaries, and existing infrastructure, mimicking historical city growth. Building footprints and heights are then generated within the blocks defined by the street network, respecting setbacks, floor area ratios, and zoning regulations.

This simulator grows a city from a seed point using agent-based road expansion and procedural block subdivision, letting you tune population density gradients, terrain influence (roads follow ridgelines and valley floors), grid vs. organic growth modes, and zoning distributions. Watch the city grow outward in real time as road agents explore and building density fills the resulting blocks — demonstrating how simple local rules can produce complex, realistic-looking urban morphology without specifying every street.

Frequently Asked Questions

What makes cities statistically universal despite their visual diversity?

Despite cultural, historical, and geographic differences, cities worldwide share measurable statistical universals: street length distributions follow a log-normal distribution; the rank-size distribution of streets and blocks follows a power law; building heights in city centers follow a Pareto distribution; and population density gradients from city centers decay approximately exponentially. These universals emerge because all cities are shaped by similar optimization pressures — minimizing travel time and infrastructure cost while maximizing land-use efficiency and accessibility — regardless of local culture.

What are L-systems and how are they used in city generation?

L-systems (Lindenmayer systems), invented by biologist Aristid Lindenmayer in 1968, are parallel rewriting systems that define string grammars for generating self-similar branching structures. For road networks, L-system rules encode how a main road spawns side streets, how far they extend before branching, and what angle branches take. Stochastic L-systems introduce randomness at each rule application; parametric L-systems vary rule behavior by environmental inputs like population density and terrain. The resulting networks have the hierarchical, self-similar structure of organic city road networks.

How does terrain influence road network generation?

Real road builders follow physical constraints: roads avoid steep slopes, cross rivers at narrow points, follow ridgelines and valley floors (natural corridors), and connect population centers by the most direct viable route. Tensor field generation models these influences by computing a field of preferred directions based on terrain gradient and boundary shapes. Road agents in agent-based generators sense local terrain slope and elevation, biasing their expansion direction toward low gradient and high population — naturally producing roads that hug valleys and avoid steep hillsides.

How is procedural city generation used in video games and films?

Open-world games like Grand Theft Auto, Watch Dogs, and Cyberpunk 2077 use procedural generation for city districts, building facades, and street-level details — it would be economically infeasible to hand-craft every building in a large city. Space Syntax analysis of street network connectivity guides procedural placement of commercial, residential, and industrial zones to match realistic urban patterns. In film and TV visual effects, procedural city generators (Houdini, CityEngine) create background cityscapes for helicopter shots or dystopian future cities, generating kilometers of unique buildings and streets in hours rather than months of manual modeling.

How does Space Syntax theory inform generative city models?

Space Syntax, developed by Bill Hillier at UCL in the 1970s-80s, analyzes the geometric and topological properties of urban street networks to predict pedestrian flow, land use patterns, and social activity. Key measures include integration (how accessible a street is to all other streets) and choice (how often a street appears on shortest paths between all pairs). High-integration streets attract retail and commercial activity; low-integration streets become residential. Generative city models incorporate Space Syntax metrics as fitness functions — producing cities with realistic activity distributions that emerge from street geometry alone.