BCG Building Generator — User Guide

Version 1.0.0 · Unity 6 · Built-in Render Pipeline and URP

BCG Building Generator is a procedural building tool for city-filler geometry: low-cost, one-draw-call-per-building background buildings for driving, open-world, and mobile games. All mesh and prefab assets are generated at editor time. The only runtime components are two data-only MonoBehaviours that carry no generation logic: BCG_BuildingZone (an optional district marker on BoxCollider zones) and a hidden BCG_BuildingMarker stamped on every generated building.


Contents

  1. Installation
  2. Opening the window
  3. Workflow A — Single building
  4. Workflow B — Variation Row
  5. Workflow C — Street Scatter
  6. Workflow D — Populate Zones
  7. Scene tab — inventory & health
  8. BCG_BuildingZone district component
  9. Archetype reference
  10. Advanced fields
  11. Regenerate All
  12. Fix Materials (Active Pipeline)
  13. Bake UVs (Existing)
  14. Save As Prefab Assets
  15. Pipeline notes
  16. Managing generated output
  17. Package contents

1. Installation

Import the package. All shipped scripts, textures, and the demo scene land under Assets/BCG/BuildingGen/. Generated meshes, prefabs, and materials are written to Assets/BCG/BuildingGen/Generated/ the first time you generate a building.


2. Opening the window

Tools > BoneCracker Games > Building Generator > Building Generator

The same submenu also holds Welcome Window — a quick-start panel that opens automatically the first time the asset is imported.

The window is a single docked panel. Minimum size is 418 × 840 px. There is no Play-Mode dependency — everything runs in the Editor.

Window layout

The status badge on the left of the footer shows the active render pipeline and whether the facade materials match it — URP · materials OK / Built-in · materials OK (green dot) or … · materials need Fix (amber dot) when the materials would render pink. It is re-checked about once a second and turns green immediately after Fix Materials.

The Frame on generate toggle (right of the footer badge, persisted per-user) controls whether each generate action also frames the new building(s) in the Scene view; selection happens either way.


3. Workflow A — Single building

Single Building mode — archetype, massing, advanced fields, live preview, and the persistent footer.
Single Building mode — archetype, massing, advanced fields, live preview, and the persistent footer.
  1. Choose an Archetype (Tower / Shop / Apartment / House). Switching archetype applies sensible size presets; all fields remain editable.
  2. Choose a Texture Variant (A – D palette: Light Gray / Brick / Graphite Curtain / White Plaster).
  3. Set Cells X, Cells Z, Floors, and Seed. - Width = Cells X × Cell Width; Depth = Cells Z × Cell Width. - The live Footprint readout below the fields shows the resulting dimensions.
  4. Click Generate + Place In Scene.

The generator writes a mesh asset and a prefab under Generated/ (GUID-stable overwrites), then instantiates the prefab at the scene-view pivot dropped to y = 0. The instance is registered with Undo. (When Save As Prefab Assets is off, the building is placed straight into the scene with no asset written — see §14.)

If that spot would overlap a building you generated earlier, the new building is moved clear automatically — see §16, Managing generated output. In an open area it is placed exactly where you asked.


4. Workflow B — Variation Row

Generates five seeded size/seed variations of the current parameters placed in a row, spaced 8 m apart.

All five instances share a single Undo entry.


5. Workflow C — Street Scatter

Fills one or both sides of a road with seeded buildings facing the street. Expand the Street Scatter foldout.

Street mode — road settings, weighted archetype mix, and variant mix.
Street mode — road settings, weighted archetype mix, and variant mix.
Field Default Notes
Scatter Seed 12345 Drives every plot: archetype, size, variant, gap.
Road Length (m) 120 Plots fill +X until this length is reached.
Both Sides on Line the opposite side of the road as well.
Road Width (m) 16 Clear carriageway between the two rows.
Gap Range (m) 4 – 10 Random spacing between neighbouring plots.
Tower / Shop / Apartment / House weights 0.35 / 0.30 / 0.35 / 0.25 Relative archetype probability.
Variant Mix (A / B / C / D) all on Palettes eligible for this scatter.

Click Generate Street Row. All instances parent under BCG_StreetRow_{seed} (one Undo).


6. Workflow D — Populate Zones

Fills BoxCollider-bounded areas with a seeded block of buildings in alternating rows (front-facing, then back-to-back pairs, like a real city block). Expand the Populate Zones (BoxCollider markers) foldout.

Zones mode — the Zone Fill settings and the Populate / Create Zone Marker actions.
Zones mode — the Zone Fill settings and the Populate / Create Zone Marker actions.

Quick start

  1. In the scene, create a GameObject with a BoxCollider sized over the area to fill. - Or click Create Zone Marker in the foldout; this drops a 40 × 4 × 30 m marker at the scene-view pivot, already carrying a BCG_BuildingZone component.
  2. Select the marker object(s).
  3. Set Zone Seed (or leave 0 to auto-assign), Edge Margin, and Row Gap range.
  4. Click Populate Selected Zones.
Field Default Notes
Zone Seed 24680 Per-zone seeds derive from this. A non-zero seed on the district component overrides it.
Edge Margin (m) 1 Buildings keep this distance from zone bounds.
Row Gap (m) 6 – 10 Random alley/street width between building rows.
Markers After Disable What happens to each zone marker once its area is filled (the buildings live in their own object either way). Disable keeps the marker but switches off its BoxCollider, so the bounds stay readable and a repopulate / Clear Output still works. Delete removes the marker GameObject entirely.

Each populated zone creates a parent GameObject named BCG_Zone_{markerName}_{seed}. District-component zones store a reference to this parent in lastPopulated; a repopulate replaces the old output automatically.

Populate runs asynchronously — one building per frame — so a large zone does not freeze the editor. A progress bar is shown while the job runs; closing the window aborts it (partial output stays in the scene and can be removed with Undo).


7. Scene tab — inventory & health

The fourth toolbar tab, Scene, is a read-only inventory of every generated building in the open scene — buildings carrying the hidden BCG_BuildingMarker (§16). It does not generate anything; it lets you audit, find, isolate, and clean up what is already placed. If the scene has no generated buildings, the tab shows a hint and a Refresh button.

Scene tab — overview stats, filter toolbar, district-grouped building list, and bulk-action footer.
Scene tab — overview stats, filter toolbar, district-grouped building list, and bulk-action footer.

The inventory is scanned once and cached; it is rebuilt automatically only when the scene hierarchy changes (or when you press the toolbar Refresh button), never on every repaint.

Overview stats

The header summarises the whole scene:

Toolbar (filtering & sorting)

Control Effect
Search field Matches a building's GameObject name or its seed.
Archetype filter All / Tower / Shop / Apartment / House.
Variant filter All / A / B / C / D.
Refresh Rescans the open scene.
Flat toggle Off = grouped by district (default); on = a single flat list.
Sort (Flat only) Sort the flat list by Tris, Floors, Name, or Footprint.

When any filter is active, a showing X of N line appears above the list.

The list

Health flags

Each building is checked for the following problems; the row's warning tooltip lists every one that applies:

Flag Meaning
Missing mesh No MeshFilter, or a null shared mesh.
Missing / magenta material No renderer, a null material/shader, or Unity's magenta error shader.
Pipeline mismatch The facade shader does not match the active render pipeline (the pink-under-URP trap). Fix with Fix Materials (§12).
Not marked static The Batching Static flag is cleared, so the building loses static batching.
Overlapping The building's gap-padded footprint clips another building's (the same test the placement guard uses — §16).

Bulk actions

The tab's own footer (distinct from the window footer) acts on the list:


8. BCG_BuildingZone district component

BCG_BuildingZone is a Runtime MonoBehaviour that gives a BoxCollider marker its own per-zone archetype mix, variant allowlist, and layout settings. It requires a BoxCollider on the same GameObject and carries no generation logic, so it is safe in a build.

Serialized fields

District Mix

Field Type Default Description
towerWeight float [0–1] 0.35 Relative chance a plot becomes a Tower.
shopWeight float [0–1] 0.30 Relative chance a plot becomes a Shop.
apartmentWeight float [0–1] 0.35 Relative chance a plot becomes an Apartment.
houseWeight float [0–1] 0.25 Relative chance a plot becomes a gabled House.

Weights are relative (normalized internally); setting all four to 1.0 gives an even mix.

Texture Variants

Field Type Default Description
variantA bool true Allow the A – Light Gray palette.
variantB bool true Allow the B – Brick palette.
variantC bool true Allow the C – Graphite Curtain palette.
variantD bool true Allow the D – White Plaster palette.

Layout

Field Type Default Description
seed int 0 0 = auto; the tool writes a stable seed on first populate. Same seed + same bounds → same block.
edgeMargin float [0–8] 1 Distance (m) buildings keep from zone bounds.
gapMin float 4 Minimum random spacing (m) between plots along a row.
gapMax float 10 Maximum random spacing (m) between plots along a row.
rowGapMin float 6 Minimum random alley/street width (m) between rows.
rowGapMax float 10 Maximum random alley/street width (m) between rows.

lastPopulated is hidden in the Inspector and managed by the tool.

Gizmo colors

The component draws an always-visible wire cube over the BoxCollider bounds in local space:

State Color
Empty (not yet populated) Cyan — RGB (0.2, 0.9, 1.0)
Populated (lastPopulated set) Green — RGB (0.3, 1.0, 0.4)

When selected, a translucent solid fill (8 % alpha of the same color) is drawn behind the wire cube.


9. Archetype reference

Archetype Typical height Massing models Parapet Facade styles Roof
Tower 7–16 floors Slab / Setback / Podium / L-plan (seeded, tall footprints only) Concrete parapet OfficeDark, OfficeLit, Ribbon, Mullion Flat gravel + roof clutter (HVAC boxes, bulkheads)
Shop 1–2 floors Slab only Dark fascia strip Punched, OfficeDark Flat gravel
Apartment 3–8 floors Slab only Concrete parapet (0.7 m) Punched, Balcony, OfficeDark Flat gravel
House 1–2 floors Slab only None (parapet fields ignored) Punched (biased), OfficeDark Pitched shingle roof (32–40° pitch), eaves, optional chimney

Massing applies only to Tower when floors ≥ 7, cellsX ≥ 6, and cellsZ ≥ 5. All other combinations produce a single Slab regardless of archetype.

Geometric relief (window recession, 0.12 m inset depth): OfficeDark, OfficeLit, and Balcony styles. Ribbon, Mullion, and Punched stay flush.

House pitched roof: pitch is a pure function of seed (32 + |seed| % 9 degrees, range 32–40°). The ridge runs along the longer horizontal axis. A chimney appears with 70 % probability; its position and slope side are seeded.


10. Advanced fields

Expand the Advanced foldout in the main panel.

Field Range Default Notes
Cell Width (m) 2 – 5 3.0 Meters per window cell. Drives both width and depth: Width = cellsX × cellWidth.
Floor Height (m) 2.4 – 5 3.2 Height of all floors above the ground floor.
Ground Floor Height (m) 2.8 – 6 4.0 Taller ground floor for storefronts.
Parapet Height (m) 0.2 – 2 0.9 Outer parapet wall height. Ignored for House.
Parapet Thickness (m) 0.15 – 1 0.35 Inward thickness of the parapet cap. Ignored for House.

The archetype presets set sensible defaults (e.g., Shop sets ground floor height to 4.2 m, parapet height to 1.0 m; House sets floor height to 2.8 m, ground floor height to 3.0 m).


11. Regenerate All

The footer Regenerate All button rebuilds every generated prefab in place — mesh and prefab assets are overwritten at their existing paths so GUIDs (and therefore all existing scene references) are preserved.

Use this after upgrading the package to pick up geometry or UV improvements without losing scene placements.

A confirmation dialog is shown before the operation starts. The operation cannot be undone.


12. Fix Materials (Active Pipeline)

The footer Fix Materials button rebuilds all four facade materials (BCG_Building_Facade_A/B/C/D.mat) — plus the demo-ground material — for the currently active render pipeline, overwriting them in place (GUID-stable).

Both pipelines set _Smoothness / _Glossiness to 0.12 and enable emission from the matching BCG_Facade_Emission_{A..D}.png atlas. Running Fix Materials also refreshes the footer material-health badge to green (§2).

Night Lights

The Night Lights panel (just above the footer, visible in every mode) sets a single global window-glow look for all buildings. It tints the shared facade materials, so the one-material / one-draw-call-per-building guarantee is preserved. The panel is a collapsible foldout, collapsed by default, whose header shows the current state (Off / Dusk / Night / Custom):

The setting is stored per-user and is honoured by Fix Materials and pipeline switches, so your night look survives a material rebuild. Slider / colour edits mark the four materials dirty (persisted on the next project save); the preset buttons save immediately.


13. Bake UVs (Existing)

The footer Bake UVs (Existing) button adds lightmap UVs and GI contribution to buildings that were already generated — without rebuilding their geometry.

By default, generation skips the per-building lightmap-UV unwrap (the Bake Lightmap UVs toggle below the tab body is off), because city-filler background buildings rarely contribute to a baked GI bake and the unwrap is the single biggest per-building cost. If you later decide some or all of those buildings should be lit by baked GI, use this footer button instead of regenerating everything:

The per-building flag changes can be reverted with Undo. The mesh-asset UV write is an asset modification and cannot be undone (the same as Regenerate All).


14. Save As Prefab Assets

The Save As Prefab Assets toggle (default on) controls whether the four "keep" spawn paths — Single, Variation Row, Street Scatter, and window-driven Populate Zones — write a GUID-stable mesh and prefab asset to Generated/ for each building, or place it in the scene without touching the project on disk.

Setting Behaviour
On (default) Each building is saved as a reusable prefab + mesh asset under Generated/, then instantiated into the scene. Identical to previous behaviour.
Off Buildings are placed directly in the scene with no assets written. Generated/ is not touched. Useful for one-off city-filler geometry where you do not need reusable prefab assets.

When to turn it off — if you are filling a large open-world scene with background geometry that you never need to re-use or re-seed, turning this off keeps Generated/ clean and avoids accumulating hundreds of mesh assets for buildings you will never reference again.

Save-the-scene caveat — scene-only buildings live in the scene file, not in any asset. A domain reload triggered by a script recompile or an editor restart will destroy un-saved scene objects. Save the scene immediately after generating scene-only buildings, or they will be lost.

Note: the Preview In Scene button always builds a no-asset throwaway instance regardless of this toggle — it is an audition view, not a keep path.

This toggle is persisted in EditorPrefs and applies per-user. Changing it has no effect on buildings already in the scene; it only affects the next generation.


15. Pipeline notes

Buildings look pink (magenta) when the facade material references a shader that is not included in the active pipeline. This happens if you:

The footer status badge flags this state (… · materials need Fix, amber dot), and the Scene tab flags each affected building with a Pipeline mismatch warning (§7).

Fix: open Tools > BoneCracker Games > Building Generator > Building Generator and click Fix Materials in the footer. All four material assets are rebuilt for whichever pipeline is currently active; existing prefab references survive the rebuild because the material GUIDs do not change.

Mesh geometry and UV layout are pipeline-agnostic; only the facade materials are pipeline-coupled.


16. Managing generated output

Every building the generator places carries a hidden, data-only BCG_BuildingMarker component — kept out of the Add-Component menu and the Inspector. It records the building's archetype, variant, seed, and footprint, and lets the tool find, select, and clean up generated output. The Scene tab (§7) is the browsable view of everything that carries this marker.

Automatic clip-avoidance

All four placement workflows (Single building, Variation Row, Street Scatter, Populate Zones) avoid overlapping existing generated buildings. Before each building is placed, its footprint is tested against every BCG_BuildingMarker already in the scene; if the intended spot would clip one, the building is moved to the nearest free spot via an outward ring search. A building that fits where intended is left exactly there, so layouts are unchanged in open areas. The console logs how many buildings were relocated.

Select All / Destroy All

Two buttons in the window footer act on every generated building in the open scene:

(For finer control — filtering, isolating, or deleting only part of the scene — use the Scene tab's bulk actions, §7.)

Clean Unused Assets

Destroy All removes buildings from the scene; Clean Unused… reclaims the asset files they leave behind on disk. Every building generated with Save As Prefab Assets on writes a mesh (and prefab) under Assets/BCG/BuildingGen/Generated/. Over time, regenerating or deleting buildings can leave mesh/prefab assets that no scene uses any more. The Clean Unused… footer button finds and removes them safely:

  1. Click Clean Unused… in the footer. You'll be prompted to save any unsaved scenes first (so the scan sees the current state).
  2. The tool scans every scene in your project — open and closed — and lists the generated meshes and prefabs that no scene references, with the total disk space you can reclaim.
  3. Review the list (everything is checked by default; use Select None / the per-item checkboxes to keep anything), then click Delete Selected and confirm.

Safe by design: any mesh or prefab used by a building placed in any scene — including the demo scene — is kept. A prefab kept only in your Project window but never placed in a scene is treated as unused; uncheck it in the list if you want to keep it. Deletion is permanent (not undoable), which is why the preview and confirm steps are there. Facade and ground materials are never touched.


17. Package contents

The following folders are shipped with the asset:

Folder Contents
Assets/BCG/BuildingGen/Editor/ Generator window (incl. the Scene inventory tab), mesh builder, zone populator, zone inspector, anti-clipping placement guard, scene-inventory + asset-cleanup cores, onboarding, editor skin
Assets/BCG/BuildingGen/Runtime/ BCG_BuildingZone (district marker), BCG_BuildingMarker (per-building tag), BCG_BuildingArchetype (enum), BuildingGen_Version
Assets/BCG/BuildingGen/Textures/ BCG_Facade_Albedo_{A,B,C,D}.png and BCG_Facade_Emission_{A,B,C,D}.png
Assets/BCG/BuildingGen/Demo/ BuildingGen_Demo.unity sample scene
Assets/BCG/BuildingGen/Documentation/ This guide and BuildingGen_AtlasLayout.md

The following are not shipped: