Stonedrum City Generator
Rivers and bridges A meandering river crosses the city and carves its own valley into the terrain ... Rectangle, L-, T- and U-shaped and chamfered footprints, with flat, gabled, hipped and ...
by Stonedrum
Price History +
Requirements
• Unity 6 (6000.0 or newer; developed and tested on 6000.5)
• Universal Render Pipeline (URP 17+)
• AI Navigation package (com.unity.ai.navigation)
Render pipelines
• URP: fully supported
• Built-in and HDRP: the geometry generates with the pipeline’s default Lit material. The glass, water and foliage shaders are URP-only, so assign your own materials for those.
Workflow
• Editor tool with Inspector buttons: Generate All, or each step on its own (Roads, Parcels, Buildings, Vegetation, Terrain)
• Every generation step supports Undo
• All settings live in ScriptableObject assets: City Settings, Building Type, Church Settings and OSM City Data
• The same seed always gives the same city. Each building has its own random stream, so changing one feature doesn’t reshuffle the rest
• Your own materials can be assigned for every surface; empty slots use the built-in shaders and textures
• Generation also runs at runtime in a build. Assign the glass, water and foliage materials so the shaders aren’t stripped.
Content
• 100% procedural meshes and textures
• Tileable 256×256 surface textures with normal maps, pre-baked and included; they re-bake automatically if deleted
• 3 custom URP shaders: see-through window glass with grazing-angle reflection, water, and foliage
• Doors use the BuildingDoor component and can be opened and closed at runtime
OpenStreetMap import
• Reads .osm XML (from openstreetmap.org Export or the Overpass API); .pbf is not supported
• OSM data is © OpenStreetMap contributors under the ODbL. Credit it if you ship a city built from it. The package itself contains no OSM data.
Code
• Full C# source in the Stonedrum.City namespace
• Separate Runtime and Editor assembly definitions
• Includes Clipper2 (Boost Software License) under its own namespace; see Third-Party Notices.txt
Performance
• The demo city (400 m × 400 m) takes about 50 seconds to generate on a desktop PC and produces about 8,000 mesh renderers
• Buildings get an automatic LOD level; mark-static, batching and occlusion culling are recommended for large maps
Stonedrum City Generator builds a whole city in the Unity Editor: the street network, the river, every building with its rooms, and the parks, playgrounds and trees in between. Nothing is a prefab and no outside art is needed. Every mesh and texture is generated, so each seed gives you a new city with its own layout.
A street network that grows like a real city
• Roads grown by an L-system, as a regular grid or an organic old-town layout
• A street hierarchy: main roads link the district centres and get wide sidewalks, avenue trees and bus stops
• Service alleys through deep blocks, footpaths, crosswalks, curbs and street lamps
• Benches, bins, mailboxes, hydrants and signs along the sidewalks
Rivers and bridges
• A meandering river crosses the city and carves its own valley into the terrain
• Stone quay walls with railings and a riverside walk in the centre, grassy banks further out
• Bridges where roads meet the river at a sensible angle, with decks, parapets, piers and abutments
Rebuild real places from OpenStreetMap
• Import an .osm export and the real streets, river, buildings, entrances and roof shapes are used
• Parks, squares, playgrounds and pitches from the map are built too, with gardens and trees generated in between
• Building heights, roof shapes and colours, shops and restaurants are read from the map tags
Buildings with real interiors
• Zoned districts: a dense urban core, mixed-use areas and residential streets of houses
• Rectangle, L-, T- and U-shaped and chamfered footprints, with flat, gabled, hipped and pyramid roofs
• Window openings cut through the wall, so you can see into rooms with floors, partition walls, staircases and doors that open
• Shopfronts, restaurants with awnings and furnished dining rooms, supermarkets with shelves
• Skyscrapers with detailed usage for each floor
• Churches with graveyards, schools, hospitals, and buildings made of several parts
• Rooftop details: plant rooms, skylights, solar panels, helipads, aerials, lightning rods and roof signs
• Weathering streaks and grime, bay windows, porticos, window and door frames, steps up to the door
• An automatic LOD level for every building
Public spaces and nature
• A town square with a fountain, parks, playgrounds, soccer pitches, basketball courts and swimming pools
• Gardens with fences or hedges, plus several tree species and bushes on a custom foliage shader
• Terrain that rises into hills around the city
Ready to use
• A NavMesh is built for the finished city, so agents can walk its streets right away
• Colliders where they belong; water stays out of the NavMesh
• Generated objects are marked static for batching and occlusion
• Procedural brick, plaster, roof tile, stone, wood, asphalt and paving textures with normal maps
• A demo scene and ready-made settings to start from
Change a seed, a road pattern or a building mix and click Generate All. The demo city takes about 30 seconds.
Public todo list
- See this trello for the features and bug fixes for the next release: https://trello.com/b/6iTKsqui/building-generation-framework