Real Cities – Procedural City Generator, Real-World Buildings & Destruction
- Buildings grown along streets where the map has none, and an informal-building ... The package reads no brand or operator tag at all. ... One switch (CitySettings.Flags) turns them off.
by u3d
Price History +
- Built and tested on Unity 6000.3.21f1 with URP 17.3, and URP only: Built-in RP and HDRP are not supported.
- Tested on Windows desktop, Direct3D 11 and Direct3D 12, Unity Mono (Editor Play mode and development players). Vulkan, Metal, IL2CPP, WebGL, mobile and console are not tested and not claimed. The renderer needs compute shaders and indirect draws.
- Two assemblies: RealCities.Core (engine-free C#, no UnityEngine reference, 537 automated tests that run outside Unity) and RealCities.Rendering (URP). The core computes in double through its own deterministic math and gives the same bytes on .NET and Unity's Mono.
- Input: an OpenStreetMap extract in .osm XML (the reader takes the "out geom" and "out skel" forms of an Overpass answer). Four sample extracts are included. No network code is in the package.
- Level of detail: L0 up to 8,192 triangles per building, L1 1,024, L2 256, L3 32, then one mesh per 128 m cell. Every level change is a morph.
- Draw calls: 3 indirect draws per view list; one city adds 18 draw calls at 300 m (opaque, depth-normals and shadow cascades).
- Real-footprint measurements, Prague (3,944 buildings), 1920 × 1080: at 300 m 314,700 triangles, DrawOpaque 1.9 ms with the city and 0.9 ms without it, main-light shadow 0.31 ms, depth-normals 0.23 ms; from above 131,000 triangles. Kyoto (18,645 buildings) and the other fixtures are in the Manual.
- 50,000 buildings: a synthetic 6 km city is fully in view at 0.65–0.94 ms of GPU time at 1080p (2026-11-01 build, before the facade materials of 2026-11-03, which add about 0.4–0.8 ms to the opaque pass).
- Load: SetModel takes 0.34 s on the main thread for 50,000 buildings; with the far field the build takes 2.3–2.7 s. SetModelAsync returns in 0.17 s and fills in over a few frames.
- Memory: the pools reserve about 300 MB per renderer by default and are configurable; a 3 × 3 grid of cities uses 732 MiB of pools. Set Streaming.MaxVertices, MaxTriangles and MaxClusters for small cities.
- Data in the package: settlement pack 339 tiles (about 32 MB), Noto signed-distance-field atlases for 26 script sets (about 12 MB), sign-text tables and reject filters for 114 languages (about 6 MB), 13 architecture groups, 76 facade styles, 153 flags and 24 pictograms (under 1 MB).
- Package size: 50.3 MB (52,768,868 bytes). Everything is under Assets/RealCities.
- Destruction: structural grid with 2–6 m cells, deterministic solver, up to 2,048 live chunks; a blast on 3,031 buildings is computed in about 90 ms on the main thread under Mono (ApplyExplosion) or on a worker (ApplyExplosionAsync).
- Samples: Prague, Kyoto, Havana, Bergen and Prague at night, with a City prefab and four OpenStreetMap extracts. Documentation: Manual, Changelog, AGENTS.md (guide for AI coding agents) and third-party notices.
Turn OpenStreetMap footprints into a real city in Unity: buildings with regional architecture, roofs, windows, signs and flags, drawn up to 50,000 at a time in one GPU pass with smooth level of detail, and destructible down to a collapsing tower. For the Universal Render Pipeline (URP) in Unity 6.3 (6000.3.21f1).
Give Real Cities the buildings of a map and it builds the city: the outline of every house, courtyard and block becomes a building with walls, roof, windows, signs and flags in the style of its region. Hand it a map extract, press Play, and fly from a bird's-eye view to a street at 2 m without a pop. Blast a block and watch it break.
Buildings from a map
- Footprints in, buildings out. Reads an OpenStreetMap extract (.osm XML) with the package's own reader: building outlines, building parts, courtyards, canopies, raised bases, party walls between terraced houses, fences, walls and hedges.
- Four real cities included: Prague, Kyoto, Havana and Bergen, each as an OpenStreetMap extract in the samples, plus a night scene of Prague. The CitySample component turns a text asset into a city, so your own extract is one drag away.
- Roofs that are roofs. Roofs are built from the outline with a straight skeleton: hips, gables, mansards and flat roofs, with chimneys, dormers, eaves and ridges. Sloped roofs carry courses of tiles, slate, metal, bitumen or thatch; flat roofs carry gravel.
- Walls and windows with depth. Plaster grain, plinths, the colour of each building, brick and tile values one by one. Window openings have frames, glass that reflects the sky and a room behind: curtains, blinds, a dark room or clear glass. Shutters, balconies and rooftop equipment follow the region.
- Heights and roofs where the map is silent. OpenStreetMap height, levels, roof and colour tags always win. Where they are missing, the building's typology, its region and the settlement class from a bundled European Commission settlement pack (GHSL) decide.
- Buildings grown along streets where the map has none, and an informal-building slider from 0 to 1 (unfinished top floors, self-built extensions) that starts at a default for the country.
Regional architecture and signs for the whole world
- Thirteen architecture groups cover 240 countries and territories with 76 facade styles: Western Europe, Mediterranean, Balkans, Nordic, post-Soviet, Middle East and North Africa, sub-Saharan Africa, South Asia, Southeast Asia, China, Japan and Korea, Latin America and the Caribbean, and North America. All of it is plain JSON data you can read and change.
- Signs in the local script. Shop and street signs are set in 114 languages and 26 script sets, with right-to-left Arabic and Hebrew, joined Arabic letters, Indic and Thai clusters and vertical Han columns, and 24 pictograms. The text is made-up, so it reads as a sign in that script and never spells a real word, a brand or an operator. The package reads no brand or operator tag at all.
- National flags on poles and buildings: 153 flags drawn from the geometry that each country's flag law describes. One switch (CitySettings.Flags) turns them off.
- Night. One slider (CityRenderer.Night) lights the windows and the signs; a Prague night scene is included.
50,000 buildings in one frame
- One GPU pass. Every building lives in shared GPU pools; a compute pass picks the level of detail of every building for every view and draws the whole city with three indirect draws per view. Measured: real Prague (3,944 buildings) adds 18 draw calls at 300 m.
- Four levels of detail plus a far field. L0 has real window openings, reveals and sills (up to 8,192 triangles per building), L1 keeps the exact footprint and roof, L2 is flat walls, L3 is a handful of triangles, and beyond them 128 m cells merge into one mesh each. Levels are picked by projected size, so a tower keeps its detail further out than a shed.
- A morph, not a cross-fade. Every vertex knows its place in the next coarser level, so a level change shows nothing: no dither, no double draw, no popping. The worst frame of a 16 s fly-over of real Prague and Kyoto moved 0.039 % and 0.021 % of the pixels (the project's gate is 0.05 %); without the morph the same flights move 0.31 % and 0.22 %.
- Real shadows. The city casts and receives URP cascaded sun shadows and follows the scene's sun (RenderSettings.sun), so it works with Real Skies' sun or your own light.
- Triangles stay in budget. A 50,000-building test city draws 0.86 million triangles from above and 0.65 million at street level (2026-11-01 build).
Destruction from the start
- Three tiers: a partial hit takes cells out of a building and leaves jagged holes with dark rooms and slab edges; a lost support or a weakened ground floor makes the building collapse floor by floor, on the GPU, from a single record write; a mass event does the same for thousands of buildings in a radius, spread over frames.
- One call from code. city.Destruction.ApplyExplosion(position, radius, energy) takes effect at once; ApplyExplosionAsync runs the solver on a worker for anything large; CollapseBuilding(id) brings one building down. OnBuildingDamaged and OnBuildingCollapsed events feed your audio, VFX and gameplay.
- Falling pieces keep their windows. Chunks that break away are cut from the building's own mesh, fall as dynamic pieces (up to 2,048 at a time) and settle as rubble; small stones and dust are a compute particle system.
- Deterministic. The same blasts in the same order give the same buildings, bit for bit, on .NET and on Unity's Mono, which makes save games and lockstep multiplayer possible. A building you did not touch keeps exactly the bytes it had.
Built for your project
- Public API: CityRenderer (SetModel and SetModelAsync, Lod.UserBias for a quality setting, Night, WorldOffset, Sun, Destruction), CityPlanner.Plan to turn map data into a city model on a worker thread, and the engine-free RealCities.Core assembly that can be used without Unity.
- Made to sit in a bigger world. CityRenderer.WorldOffset places a city on a grid of cities with no rebuild, CityGround.Seat sets every building on your own terrain heights with a foundation, and CityMasks tells your terrain and tree system where the buildings, courtyards, paved lots and gardens are.
- Part of Real Earth Planet. Our Real Earth Planet ships Real Cities as a preview, off by default, so a place built there can have its buildings.
- Quality levels. Lod.UserBias trades detail for speed; defaults for High, Medium and Low are 1.0, 0.8 and 0.6.
- Data you can read. The 13 architecture groups, the facade styles, the sign grammar and the flag recipes are JSON files in a Resources folder.
AI Ready. Built to be driven by AI coding agents as well as by hand. Documentation/AGENTS.md gives Claude Code, Codex, Cursor or a Unity MCP bridge the map of the package: the CityRenderer component (SetModel and SetModelAsync, Lod.UserBias, Night, WorldOffset, Sun, Destruction), CityPlanner.Plan(inputs, catalog, report, signs: signs) with the ICityInputs it reads, the CitySample component that turns an OpenStreetMap extract into a city, the destruction calls (ApplyExplosion, ApplyExplosionAsync, CollapseBuilding), the 13 architecture groups and the sign grammar as plain JSON data, the sample scenes by path, task recipes, and a Verify section (build a sample city, compare its building count and plan hash with the values in the guide, blast one building and replay the blast for the same result), so an agent can build, tune and check a city without guessing.
Honest limits
- Heights, roofs and styles that the map does not carry are modelled from the region, the building type and the settlement class: plausible, not surveyed.
- The 13 architecture groups are broad regional styles with judgement values, not a survey of each city. Some regions read better than others at street level.
- Destruction: hole outlines follow a 2–6 m cell grid, rooms behind a hole are empty boxes, rubble is a mound with slabs, and there are no colliders for the buildings by default.
- There is no Hi-Z occlusion yet, and no per-object motion vectors: collapsing buildings can ghost slightly under TAA or STP. The far field ends at the edge of the city box.
- Roof courses, wall grain and window rooms are drawn by the shader: they read best near the camera and fade out with distance by design.
- Signs use made-up text. Mongolian vertical script is not built, and 39 minor languages have no table.
- The package builds buildings. Ground, roads, trees and sky are yours (or Real Earth Planet's).
Data and licences
- The package reads no map data over the network. It contains OpenStreetMap extracts of the four sample cities (© OpenStreetMap contributors, ODbL 1.0): show the credit with any city built from OpenStreetMap data, and read the notes in Documentation/THIRD-PARTY-NOTICES.md.
- It contains a settlement pack derived from the GHSL R2023A of the European Commission's Joint Research Centre (CC BY 4.0, © European Union) and regional data from Natural Earth (public domain), Unicode CLDR 49 (Unicode License v3) and Wikidata place names (CC0, as syllable tables only).
- Signs use Noto fonts as signed-distance-field atlases (SIL Open Font License 1.1, text included). Flags and pictograms are the publisher's own vector drawings; no flag is traced from another file.
What is not included
- Built-in and HDRP versions.
- Terrain, roads, railways, trees and sky. Use your own, or Real Earth Planet and Real Roads & Tracks.
- A map download: you provide the OpenStreetMap extract (the four samples are included).
- Interiors, people, vehicles and traffic.
- Colliders for the buildings, and WebGL, mobile and console support claims.
Support
Questions and bug reports: Unity Discussions or cgteamorg@gmail.com. Please include your Unity version, the city's source (extract and box) and the log lines of the problem.