Skip to content

CityGen quick start

This guide takes you from an empty level to a small city you can save and reload. It assumes CityGen is installed.

  1. In the Place Actors panel, search for CityGenStreamingManager and drag one into your level near the world origin.

  2. In its Details panel, set Terrain Material (under WorldGen | General). Use the included terrain material, or your own (see the FAQ).

  3. Open your level’s Game Mode and set Default Pawn Class to BP_CityGenCameraPawn and Player Controller Class to BP_CityGenPlayerController. Both are included. The RTS camera and the HUD (WBP_HUD) activate automatically, and the HUD comes with Road, Residential, Commercial, Industrial, Demolish, Save and Load buttons already wired up.

  4. Press Play. Terrain streams in, the HUD shows, and the placement keys work immediately.

  1. Press R (or click Road on the HUD) to enter road mode.

  2. Left-click on the terrain to add points. The road preview updates after each click. Backspace removes the last point.

  3. Press Tab to lock new points to 45° or 90° angles relative to the last point, for clean corners.

  4. Press Enter to confirm. The road is built from spline-mesh tiles, and the terrain along it is flattened and cleared of foliage.

  5. Press R again to leave road mode.

Bridges appear on their own where a road crosses a river, valley or other low ground. To make a T-junction, end a new road on an existing one: its endpoint snaps to the existing road’s centreline and tucks slightly under it, so the meshes don’t z-fight.

  1. Press Z, or click Residential, Commercial or Industrial on the HUD. Wireframe cells appear along every road: grey when unpainted, tinted when painted.

  2. Left-click a cell. A 4×4 block of cells is painted on that side of the road, and buildings from the zone’s building pool fill the painted cells.

  3. To erase, set ActiveZoneAsset to null and click painted cells. Buildings that zoning spawned there are removed; buildings you placed by hand stay.

  4. Press Z again to leave zone mode.

  1. Press B to enter building mode. A ghost of the building follows the cursor: green means placement is valid, red means it is refused.

  2. Move the cursor near a road. Within RoadAlignRange (500 cm by default) the grid lines up with the road; further away it uses the world axes.

  3. Left-click to place the building.

  4. Press B again to leave building mode.

Placement is refused if the ground under the footprint is steeper than the building asset’s MaxSlopeDegrees (5° by default), or if the building would overlap another building or a road.

  • Press X for demolish mode. A translucent red box shows the building you are pointing at, and left-click removes it and clears the zone cells under it. You can also click a road segment to remove it.
  • Press F5 to QuickSave and F9 to QuickLoad. The save holds your roads, buildings, zones and terrain changes. After a load, buildings appear a second or two after the roads, once the terrain under them has finished building.
  1. Drop an ACityGenTimeOfDay actor into your level. (The demo map already has one.)

  2. Assign your level’s Post Process Volume to its PostProcessVolume slot. The actor then blends exposure between day and night.

  3. Assign your Sky Light to its SkyLight slot. The actor recaptures the sky every SkyLightRecaptureInterval seconds (1.0 by default), so you can keep the Sky Light Movable without per-frame Real Time Capture.

  4. Assign a Material Parameter Collection to IlluminateMPC. The actor writes the Illuminate scalar to it every tick; the included buildings, lamp posts and light decals read it from MPC_CityGen.

  5. Set TimeOfDay and click Preview In Editor to see the lighting for that time without entering Play.

Input Action
R Road mode
B Building mode
Z Zone paint mode
X Demolish mode
Left-click Add a road point, place a building, paint a cell or demolish
Enter Confirm the road
Backspace Undo the last road point
Tab Toggle the 45° / 90° snap while drawing a road
F5 / F9 QuickSave / QuickLoad
WASD or arrow keys Pan the camera
Hold middle mouse and drag Pan the camera
Hold right mouse and drag Orbit the camera
Mouse wheel Zoom

Only one mode is active at a time: entering a mode cancels any other.

  • Features covers roadside props, sidewalks, zone building pools and the HUD API.
  • Troubleshooting covers refused placements, missing sidewalks and props, and night lighting.