Any City Generator · Documentation

Roads, Profiles and Your Own Art

A road network is one actor that builds its own roads from a layout of nodes and segments. Each road points at a profile for its lanes, sidewalks and markings, and the network's road style supplies the materials and furniture. This article covers profiles, junctions, left-hand traffic, the road style, swapping the placeholder art for your own, and when the editor rebuilds.

← All Any City Generator documentation

1 · The road network

One actor, one layout, its own roads

Place a network from Place Actors > City, or let Generate City or the OpenStreetMap import make one. A network is one actor holding one layout: nodes are points, segments are the roads between them, and every segment points at a road profile. From that layout the network builds its own road meshes, lanes, city blocks and furniture.

▾ Network actor → Details

Network Layout: Driving Side, Nodes and Segments, the only saved network data. Also the Rebuild Network and Build Editor Preview Now buttons
Mesh Mesh Builder: Style (DA_AnyRoadStyle in BP_AnyRoadNetwork), Chunk Size 10000 cm, Build Furniture on
Geometry How roads are sampled, cut back at junctions and raised. Elevation Threshold (250 cm) decides where a road becomes a bridge
Debug Preview In Editor (on), Draw Lane Graph, Draw Blocks, Draw Ports (on)

Everything in the layout is relative to the actor: moving the actor moves the whole network, and the actor's Z 0 is the network's ground. Only the layout is saved; meshes, lanes and blocks are rebuilt when play begins and by the editor preview. Scale the actor uniformly, ideally not at all: lane widths stay in profile units.

2 · Road profiles

Nine road types ship ready to use

Every segment points at a road profile: a data asset for its lanes, sidewalks, curbs, markings, road class and speed limit. A profile holds no materials; the look comes from the road style. Nine ship in /AnyCityGenerator/Data/AnyRoad/Profiles, six city profiles and three rural ones.

▾ Profile → lanes left to right (cm), sidewalks, class, speed

DA_Road_Local Backward 350, Forward 350 · sidewalks 250 + 250 · Local, 40 km/h · Dashed Center Line
DA_Road_LocalOneWay Forward 350 × 2, Parking 250 · sidewalks 250 + 250 · Local, 40 km/h
DA_Road_Collector Parking 250, Backward 350, Forward 350, Parking 250 · sidewalks 300 + 300 · Collector, 50 km/h
DA_Road_Arterial Backward 350 × 2, Median 200, Forward 350 × 2 · sidewalks 350 + 350 · Arterial, 60 km/h
DA_Road_Highway Shoulder 250, Backward 375 × 3, Median 200, Forward 375 × 3, Shoulder 250 · no sidewalks · Highway, 100 km/h · barriers
DA_Road_Ramp Shoulder 150, Forward 400, Shoulder 200 · no sidewalks · Ramp, 60 km/h · barriers
DA_Road_RuralLane Backward 300, Forward 300 · no sidewalks · Local, 50 km/h · Dashed Center Line
DA_Road_RuralRoad Shoulder 100, Backward 350, Forward 350, Shoulder 100 · no sidewalks · Collector, 80 km/h · Dashed Center Line
DA_Road_RuralHighway Shoulder 250, Backward 365, Forward 365, Shoulder 250 · no sidewalks · Arterial, 100 km/h

Lanes are listed left to right as seen driving from the segment's start to its end, in right-hand traffic: a two-way street is Backward, Forward; a one-way street has only Forward lanes. The city presets use the six city profiles; the village, countryside and corridor presets swap some of them for the rural ones.

Left-hand traffic uses the same profiles. Set Network > Layout > Driving Side to Left (Right by default) and the network mirrors every cross-section when it builds: lane order reversed, sidewalks swapped, each lane keeping its direction, markings following the lanes. DA_Road_LocalOneWay then has its parking on the driver's left instead of the right. City presets carry their own driving side, and the OpenStreetMap import has a Driving Side setting. A city generated onto the port of a network with the other driving side still generates, but its lanes do not join.

3 · Profile settings

What a profile controls

Open a profile to change it, or right-click a stock one and duplicate it to make a variant. The defaults below are those of a new profile; the nine stock profiles set their own lanes, sidewalks, class and speed.

▾ Setting → default

Lanes Type, Width and Direction for each lane. A new lane is Driving, 350 cm, Forward. Width at least 50 cm
Road Class Local; also Collector, Arterial, Highway and Ramp. Picks the Auto junction control and the priority roads. Highway and Ramp roads never bound city blocks
Speed Limit Kmh 50 km/h. The speed traffic aims for on this road
Left / Right Sidewalk Width 250 cm each. 0 gives no sidewalk on that side. An edge with a sidewalk gets a curb instead of an edge line
Curb Height 15 cm. Also raises median tops
Has Barriers Off; Barrier Height 80 cm, Barrier Width 30 cm. Bridges get barriers whatever this says
Dashed Center Line Off: a double solid line between opposite directions. On: one dashed line
Center / Lane / Edge Line Color Yellow (1, 0.75, 0.05, linear) / white / white
Marking Width, Dash Length, Dash Gap 15 cm, 300 cm, 600 cm
  • Driving lanes carry traffic, one lane each, on asphalt. Direction is read on Driving lanes only.
  • Parking and Shoulder lanes are asphalt without traffic.
  • Median lanes carry no traffic: they are raised to Curb Height with a curb wall on each edge.
  • Lane lines follow the lanes: dashed between lanes of the same direction, Center Line Color between opposite directions, solid edge lines beside a shoulder, parking strip or an edge without sidewalk.

Profiles are shared and not watched. Every network and city preset that uses a profile changes with it, so duplicate a stock profile for a variant. After an edit, click Rebuild Network on the networks that use it: they do not rebuild by themselves.

4 · Junctions

What a node becomes

Each node's shape is decided when the network builds, from how many roads meet there and its Junction Type: Auto (the default), Intersection, Roundabout or Dead End. Select the network and expand Network > Layout > Nodes to set it.

▾ Roads meeting → built shape

One road Dead end: a turnaround bulb. With Is Port on, an open end instead: a flush end that can join another network
Two roads, Auto Continuation: the two roads join as one with no junction surface, when they have the same profile where they meet, one starts and the other ends there, and they meet within 30° of straight. Otherwise an intersection
Two or more, Roundabout A roundabout. Falls back to an intersection, with a Warning, when a road is too wide for the ring (its carriageway reaches Roundabout Radius)
Three or more, Auto or Intersection An intersection: the roads are cut back and the corners get rounded curbs and sidewalks
  • Corner Radius (600 cm) rounds an intersection's curb corners; 0 gives sharp corners.
  • Roundabout Radius (2200 cm, at least 300) is the ring's outer radius. Roundabout Lane Count 0 is Auto: the most lanes any approach brings in, at most 3. Each ring lane is Roundabout Lane Width (500 cm) wide and the island gets the rest, at least 300 cm.
  • Control (Auto) puts stops, yields or signals on an intersection. Auto picks one from the road classes: a Collector meeting Local streets gets Priority Yield. Controls and signal timing are covered in Traffic and Road Rules.
  • Is Port makes a node with one road an open end that can join another network (section 8).

To force a junction where two roads would join as one, set Junction Type to Intersection. Dead End on a node where two or more roads meet gives an intersection and a Warning, and Roundabout on a node with one road logs a Warning.

5 · The road style

Materials, furniture, bridges and collision

The look of a network comes from its road style, set under Mesh > Mesh Builder > Style. BP_AnyRoadNetwork uses DA_AnyRoadStyle in /AnyCityGenerator/Data/AnyRoad. A network without a style logs once and builds no meshes; its lanes still work, because traffic never reads a mesh.

▾ Style setting → default

Asphalt, Sidewalk, Curb, Marking, Median, Island, Structure, Barrier Material One material per surface; empty leaves the engine default material. DA_AnyRoadStyle uses asphalt, sidewalk, concrete (curbs, bridge decks, pillars, barriers), marking and grass (medians, roundabout islands)
Surface UV Scale 400 cm per texture tile. Keep the Mesh Builder's Chunk Size (10000 cm) a whole multiple of it, or junction textures do not line up between chunks
Street Light, Signal Pole, Signal Head, Stop Sign, Yield Sign Mesh, Scale, Offset and Material Override for each kind. A kind without a Mesh places nothing
Place Street Lights, Place Signs On, on. Street Light Spacing 3500 cm (at least 500)
Pillar Spacing, Pillar Width 2500 cm, 150 cm
Trace Ground For Pillars On: each pillar reaches down to the ground below it
Create Collision On. Markings never collide
  • Street lights stand every Street Light Spacing along roads with a sidewalk, alternating sides, 60 cm inside the sidewalk's outer edge. None stand within 10 m of a road's end or on a bridge.
  • Signal poles and heads stand on each approach of a Traffic Signal junction, at the stop line 80 cm onto the sidewalk, with the head 450 cm up. Stop and yield signs use the same spot on approaches that have one.
  • Bridges. A segment whose Structure is Auto becomes a bridge where it rises above Elevation Threshold (Geometry, 250 cm above the network's ground). Bridge makes a deck everywhere; Ground never does. Bridges always get barriers.
  • Pillars stand every Pillar Spacing under bridges, plus one under each raised junction, except where a street of the same network passes below. With Trace Ground For Pillars each pillar traces down up to 1 km to World Static collision, so your landscape must be loaded when the network builds; with no hit it stands on the network's Z 0.
  • Collision is a hidden mesh per chunk made from every surface except markings, blocking all, built in final builds only. Furniture has no collision.

6 · Your own art

Swap in your own materials, furniture and street lights

The furniture and vehicle meshes that ship in /AnyCityGenerator (Content Browser > Settings > Show Plugin Content) are placeholders. The plugin's C++ writes no material parameter values: road materials get everything from the road mesh, signal heads from per-instance custom data, vehicles from the body's Custom Primitive Data. Any material that reads the same inputs works.

  1. Duplicate DA_AnyRoadStyle and assign your materials and furniture meshes.
  2. Set the copy as a network's Mesh > Mesh Builder > Style. For every new network, set it in your own network Blueprint and pick that Blueprint as Default Network Class under Project Settings > Plugins > Any City Generator; Place Actors > City picks it up after an editor restart.
  3. Click Rebuild Network on each network.

▾ Shipped asset → what your replacement must keep

M_AnyRoad_Asphalt, _Sidewalk, _Concrete, _Grass Road surfaces. UV0 arrives in tiles of Surface UV Scale (400 cm per unit), not centimetres: multiply it by a tiling factor, never divide by a world size
M_AnyRoad_Marking Lane lines, crosswalks, stop lines. Masked. Colour comes from vertex colour RGB (the profile's line colour, linear). Paint where frac(UV0.y) ≤ vertex colour A, the dash fraction (1 on solid lines). UV0.x runs 0 to 1 across the line
SM_AnyCity_StreetLight Pivot at the base, +X toward the road. Slot 0 M_AnyCity_Metal, slot 1 M_AnyCity_Lamp, which only glows and places no light
SM_AnyTraffic_SignalPole, _SignalHead Pole pivot at the base, head pivot on the pole's axis, both +X toward the approaching traffic. The head stands 450 cm above the pole's base; adjust with the Signal Head's Offset Z
M_AnyTraffic_SignalHead Reads per-instance custom data 0: 0 Off, 1 Red, 2 Yellow, 3 Green. Any lens layout works if your material maps it
SM_AnyTraffic_StopSign, _YieldSign Pivot at the base; the plate faces +X, toward the approaching traffic
M_AnyTraffic_Vehicle, MF_AnyTraffic_VehiclePaint Vehicle paint. Body colour from Custom Primitive Data 0 to 2 (linear RGB), brake lights from index 3 (0 or 1). Add MF_AnyTraffic_VehiclePaint to your car material, or read them with parameters that tick Use Custom Primitive Data
DA_AnyRoadStyle, DA_Road_*, BP_AnyRoadNetwork The style with every road material and furniture mesh, the nine profiles, and the network Blueprint that uses the style (Data/AnyRoad, Data/AnyRoad/Profiles, Blueprints/AnyRoad)

Fit a furniture mesh with its kind's Offset (X along the facing) and Scale; Material Override replaces every slot. Vehicle Blueprints and vehicle types are covered in Traffic and Road Rules.

Tick Used with Instanced Static Meshes on your own furniture and signal head materials. Without it, Play In Editor draws them with the engine's grey default material. The editor sets the flag by itself only when the material is first drawn outside Play, and then marks it unsaved: save it once. Vehicle materials need no flag.

7 · Rebuilding

The editor preview, and when to press Rebuild Network

With Preview In Editor on (Debug, the default), the network builds in the editor level, so roads show, collide and answer queries while you work. An edit only requests a rebuild; the next editor tick builds when something actually changed.

▾ You do this → the network does

Change a value in the Details panel, undo, or release a dragged point A preview without collision while values keep changing (at most every 0.2 s), then a final build with collision once nothing has changed for 0.5 s
Move the actor Rebuilds the lanes only; the meshes already followed the drag
Toggle a Debug option Nothing to rebuild
Edit a profile or the style, change the ground under pillars, or change the layout from a script Nothing: the network does not watch these. Press Rebuild Network
Rebuild Network (Details > Network) A final build on the next editor tick. Build Editor Preview Now builds at once

Each build reruns the whole network on the game thread: geometry, lanes, blocks, every mesh chunk, pillar traces and furniture. Its cost grows with the size of the network, not of the edit; unchanged mesh chunks are reused, which only saves uploading and collision cooking. Turning Preview In Editor off clears the network from the editor level.

8 · Large maps

Split a large map into networks joined by ports

A smaller network rebuilds faster. Split a large map into several networks and join them at ports: traffic and routing cross from one network to the next.

  • A port is a node with Is Port on and exactly one road. It builds as an open, flush end.
  • Two ports join when they lie within 100 cm of each other and face each other. Every lane leaving through a port must find a lane of the other network, so use the same profile and travel direction on both sides.
  • To join them, bring the two ports within Port Connect Distance (30 m, Project Settings > Plugins > Any City Generator), select the network that should move, right-click its port node and pick Connect To Nearest Port (only this road bends), Move Network To Nearest Port (this whole network turns and moves) or Add Transition To Nearest Port (this road tapers to the other port's profile). The other network never changes.
  • Draw Ports (Debug, on) puts an arrow on every port: orange is open, green means every lane continues, yellow only some, magenta none (usually different profiles).

Traffic leaving through an open port vanishes. End a road that should not continue at a node with Is Port off: it builds a dead end with a turnaround bulb.

Next: edit a network's nodes and roads in the viewport, save and load layouts as JSON, and drive the tools from Python.