Any City Generator · Documentation
Generating Cities and Regions
A city starts from a preset, a size and a seed. The generator lays out the streets and spawns one road network actor, which builds its roads, lanes and city blocks. Towns, countryside and the highways between them come from the same panel and join at their ports. This article covers the presets, size and seed, placement, the city highway, rural areas, corridors, growing a region, the blocks left for buildings and generating at runtime.
← All Any City Generator documentation1 · Presets
A preset is a kind of city
Open Tools > Any City Generator > Any City Generator and pick a Preset. The stock presets are data assets in /AnyCityGenerator/Data/AnyCity/Presets: five make towns, three make the land and roads between them.
▾ Preset → what it makes
A preset holds a Generator (Grid, Radial or Organic City Generator, Rural Road Generator or Road Corridor Generator) with its settings inline, the road profile for each street class, the Driving Side and the block count for each size. To make your own kind of city, duplicate a preset and change these in its Details panel.
Profiles a preset needs. Local, Collector and Arterial are required. Without Local One Way there are no one-way streets; without both Highway and Ramp there is no highway. Give each slot its own profile asset, because the generators recognise streets by their profile.
2 · Size, seed and placement
How big, which variation and where
The panel's other options start fresh each time the tab opens and are never saved.
▾ Option → default
A block count reads differently per generator. A grid builds exactly that many blocks of 80 to 120 m. An organic town's outline holds about that many. A radial city builds X ÷ 2 + 1 rings, at least 2. A rural area is 400 m per block, and a corridor is 500 m long per block along X.
Viewport Center is where the active viewport's view ray meets Z = 0, or the point 100 m ahead when the camera looks level or up or is below Z = 0. For ground at another height, use Custom Location. Generate City spawns the network as AnyCity_<Seed>, selects it and builds it in one undo step; Generate Block does the same at Size Block. The status line reports the nodes, segments and ports, and any notes or failures are in the Output Log under LogAxCity.
Same seed, different city? The generator draws its random numbers in order, so changing a chance setting or the Local One Way profile can change how many draws one step makes and re-roll every step after it. A radial city ignores its seed: the same preset and size always give the same radial city.
3 · City highway
An elevated highway with diamond interchanges
With Add Highway on in the preset's generator, as in DA_City_Metro, the city gets a two-way highway along its south (−Y) side. It runs at full height from 50 m before the city to 50 m after it, then descends to a ground port beyond each end, where another network can continue.
▾ Generator > Highway
Each interchange is a diamond. An arterial that meets the south side carries on along the ground under the highway, with a junction on each side and a port beyond, and four one-way ramps leave and join the highway on the curb side. Left-hand driving mirrors them. Corners are skipped; when no arterial meets the south side, the node nearest the middle of that side gets the interchange.
One straight highway, and only the interchanges that fit. The highway is a single straight west-to-east line along the south side. An interchange whose ramp junctions would come within 60 m of the previous interchange or of an end port is left out; with the defaults, interchange arterials must be about 460 m apart. The highway reaches the streets only through interchanges, so a city with none, such as a Block-size grid, gets no highway. The Output Log says when this happens. A ramp steeper than 7 % only adds a message.
4 · Countryside
Rural road networks
DA_Rural_Countryside fills an area with a sparse network for the land between towns: winding main roads, farm lanes and the fields between them. It has no edge street. Its roads run to the edge of the area and end there as ports, so towns, corridors and other areas can continue from them.
▾ Rural Road Generator
- Lanes wander and end at a farm (a dead end with a turnaround bulb), at another road, or at the edge as a port.
- Roads never cross without a junction. A lane that meets a road joins it at a T-junction when the angle and spacing allow; otherwise it stops short.
- Loops make fields. Where a lane joins another road, the land it encloses becomes a large block.
- Rural profiles have no sidewalks. Rural Lane (50 km/h), Rural Road (80 km/h) and Rural Highway (100 km/h) have painted edge lines instead, and a lane meeting a rural road gets a yield or stop sign from the road classes.
- Add Highway works here too: the highway runs south of the area, with interchanges on the south ends of the south-north roads.
5 · Corridors
Highways and country roads between cities
A corridor is one long main road heading along +X, 500 m per block; the corridor presets give 1, 2, 4 and 8 km. Each end and every crossing road ends in a port. Main Road Class sets the kind: Highway (DA_Corridor_Highway) builds a grade-separated motorway, Arterial (DA_Corridor_CountryRoad) a country road with crossings at grade.
▾ Road Corridor Generator
On a highway corridor the highway stays on the ground and crossing roads bridge it at 7.5 m. A diamond interchange adds four one-way ramps on the curb side to ground junctions 150 m either side of the highway. An overpass is the same bridge without ramps, so the two roads don't connect. A country road instead gets crossroads (some of them roundabouts), T-junctions and the odd overpass. Crossing roads run straight, square to the main road.
Add Highway doesn't apply to a corridor; a message says so. Without a Ramp profile in the preset, every highway crossing becomes an overpass. A bridge climbing more than 7 % only adds a message.
6 · Growing a region
Connect a new network to an open port
Generated networks end in ports: the port stubs on each side of a town, the city highway's ends, and the road ends of rural areas and corridors. A new city, area or corridor can start from any open port of an existing network.
- Select the existing network in the level.
- In the generator panel, turn on Connect To Selected Network and pick a port in Connect Port. It lists only the open ports, as Port <id>.
- Pick the preset, size and seed, then click Generate City.
The port sets the location and heading, so Placement and Yaw Degrees are ignored: the new network lies beyond the port, facing away from the existing one. A connection road with the port's own profile leads to the new streets (60 m, or at least 260 m when the new city has a highway), and the two networks join at the port. Where a city street meets a highway corridor, the profile changes at the corridor's first node. A region is built the same way:
▾ Building a region
When a connection stops. A port pick belongs to the network that was selected when you made it: with another network selected, generation stops and clears the pick, so pick again. A port that has been connected since, or is already stitched, also stops it. A preset with the other driving side still generates, with a message, but its lanes won't join.
7 · City blocks
Space left free for buildings
The generators lay out roads only and leave the land between the streets empty. Each network finds that land as city blocks when it builds: the areas enclosed by ground roads, inset to the outer edge of the road and its sidewalks.
- See them: turn on Debug > Draw Blocks in the network's Details panel.
- Use them: once the network is built, Get Blocks on the network (Blueprint or Python) returns each block's Outline, Area, Centroid and bounding segments. They are actor-local, so transform them by the actor's transform for world positions.
- What makes no block: the highway, ramps and other elevated roads pass over blocks instead of splitting them, port stubs and interchange extensions enclose nothing, and areas under 40 m² are dropped.
- In the countryside, the loops between lanes and roads are large blocks: fields.
8 · Runtime
Generating a city in a running game
The generator panel is editor-only, but generation is runtime code. Two Blueprint nodes under City > Generation take the same request as the panel: Preset, Size, Custom Block Count, Seed, Origin, Yaw Degrees and, to connect, Connect To Network and Connect To Port Node Id.
▾ City > Generation
Networks don't replicate. In a multiplayer game, run the same request on every machine: the same preset, size, seed and port give the same layout. Traffic is local and cosmetic too, so every machine runs its own.
Next: turn real roads from OpenStreetMap into road networks.