Purpose and starting point
Use the house actor's Self Details, not a generated mesh instance. Open /Game/Lambeer/World/Maps/L_PCG_BuildingPreview/L_PCG_BuildingPreview and select an existing house, or place /Game/Lambeer/World/Environment/Procedural/BP_PCG_ModularHouse. The actor uses PCG_ModularHouse as its normal Building Graph. Search a control name in Details when needed; clear the search to see all categories again.
- Choose
Footprint Source, set the outline or width/depth, and setNumber of Floors. - Configure ground-floor exterior
Doors, windows and a stair if there is more than one floor. - Choose automatic rooms or closed
Room Guides; then set the roof and materials. - Run
Regenerate Building(or leaveAuto Regenerateon), readValidation StatusandGenerated Room Summary, and save the level.
Coordinates and angles are house-local. Floor 0 is the ground floor, Floor 1 is 320 cm above it, and Floor 2 is 640 cm above it. The fixed Floor To Floor Cm value is read-only. Changing an actor's world position does not change its local room/door/stair values.
Current vs proposed: all controls described on this page exist in the current source. The house bakes visible geometry in the Editor; it does not regenerate when PIE begins. Structural house destruction/locks are later work. Finish tiles have their own gameplay removal/replacement and persistence rules in FEAT-BUILDING.
Layout and footprint
| Details control | Meaning and use | Example |
|---|---|---|
Footprint Source | Rectangle uses Layout Width/Depth. Spline uses the closed FootprintSpline component; Width/Depth do not reshape that spline. | Choose Rectangle for a 10 × 8 m box; choose Spline for an L outline. |
Layout → Width Metres / Depth Metres | Whole-metre exterior size in Rectangle mode. The Editor work guard accepts 6–100 m on each axis. Local Y=0 is the front edge. | 10 and 8 create a 10 × 8 m rectangle. |
Layout → Number of Floors | 1–3 floors, 320 cm apart. Upper floors reserve a stair opening; exterior entrances stay on floor 0. The serialized C++ field is Storeys. | Set 2 for ground and upper floors; 1 has no stair. |
FootprintSpline component | In Spline mode, select the component and edit its closed points in the viewport. Segments must be straight, planar, noncrossing and at least 50 cm long. Keep local Z=0. The spline supports 3–64 points within its Editor work envelope. | Move points to draw the L; then inspect Validation Status. |
Make Footprint Linear And Planar | Explicitly sets current footprint points to linear and local Z=0. It does not redesign their XY outline. | Use after an imported point becomes curved or changes height. |
Reset Footprint To Rectangle | Replaces the spline's points with a rectangle based on current Width/Depth, then regenerates. This is a deliberate replacement of the edited spline. | Use only when discarding an L outline is intended. |
Footprint Point Import + Apply Footprint Points | Advanced actor-local point buffer. Editing the array alone does nothing; Apply writes all spline positions/rotations/scales together. Normal viewport edits do not read or overwrite the buffer. | For a scripted outline, enter its points and click Apply once. |
Slab edge: the bottom structural slab extends to the exterior wall edge, including concave L corners. Decorative floor finishes stop at the interior wall face.
Exterior openings and stairs
| Details control | Meaning and use | Example |
|---|---|---|
Doors array → Edge | One entry per ground-floor exterior entrance; an empty array means none. Rectangle edges are 0 front, 1 right, 2 back, 3 left. Spline edge N runs from footprint point N to the next point. | Edge 0 puts a door on the rectangle's front wall. |
Doors → Offset Cm | Start of the 100 × 200 cm frame measured along the selected edge. -1 centres it. A Rectangle explicit offset must use 25 cm increments and leave 100 cm at each corner; openings cannot overlap. | Offset Cm = -1 centres a single front entrance. |
Layout → Windows | Enables fixed 100 × 150 cm windows with a 75 cm sill. Automatic positions avoid exterior corners, doors, interior room boundaries and stair clearance. A Window Guide requires this to remain enabled. | Turn off temporarily to inspect a window-free wall layout. |
Layout → Window Every Metres | Automatic repeat interval, at least 2 m. If any Window Guide exists in guided mode, marked windows replace automatic windows across the house. | 3 is the class default; use markers for exact positions. |
Layout → Door Leaves Open Outwards | Places static exterior leaves outside the wall to free interior circulation. Leaves stay open; this is not an interactive door control. | Enable for a narrow interior approach. |
Layout → Stair X Metres / Stair Y Metres | Preferred stair start in Rectangle mode, measured from the local front-left corner. The full stair, approach and upper landing must fit inside the walls. | 1 / 3 is the class default; a tight plan may need relocation. |
Spline Stair Location Cm / Spline Stair Yaw Degrees | Preferred actor-local XY and rotation in Spline mode. For the legacy L stair, the upper exit is toward its local +X. Yaw rotates the whole stair and clearance. | Move/rotate these rather than changing the house outline when the stair blocks a passage. |
Layout → Compact Stair | Use the 225 × 350 cm U stair with two clear 100 cm flights. Multi-floor room planning requires this mode so circulation can be checked. | Enable when Number of Floors = 2 and Generate Rooms is on. |
Layout → Auto Place Compact Stair | When Compact Stair is on, search bounded contained positions around the preferred XY/yaw and keep a connected viable candidate. Turn off to require the exact preferred pose. | Enable for a tight L; inspect the generated result and room summary afterward. |
Each generated doorway uses a separate 100 × 200 cm frame and a fitted open leaf. The Door Start Metre and Spline Entrance fields are visible legacy migration values; use the Doors array for current editing.
Automatic room program
With Use Room Guides off, enable Layout → Rooms → Generate Rooms to generate partitions, separate doors and connected circulation. The search uses rectangular private rooms and is bounded; a reduced result means the tested candidates could not fit the target under current constraints, not that no possible architectural plan exists.
| Details control | Meaning and use | Example |
|---|---|---|
Generate Rooms | On: plan rooms. Off: leave the interior open except for the structural stair and exterior openings. | Enable on a 10 × 8 m two-floor rectangle. |
Bedrooms / Bathrooms | House-wide target counts. Class defaults are 3 bedrooms and 1 bathroom. The program always retains a ground-floor bathroom and combined kitchen/living area. | Request 3 / 1; read actual counts after generation. |
Ground Floor Bedrooms | Preferred number of bedrooms downstairs; remaining target bedrooms are distributed to upper floors. Does not override room minima or circulation. | 1 requests one downstairs and two upstairs in a two-floor house. |
Allow Fewer Rooms | On: keep kitchen/living and at least one bathroom, then reduce bedrooms if needed, without shrinking minimums or corridor width. Off: require exact requested counts or report failure. | In the saved two-floor L, target 3 bedrooms produces 1 upstairs bedroom under the current bounded search. |
Minimum Bedroom Area / Minimum Bedroom Side Cm | Clear room area and shortest-side minimum after walls and reserved circulation. Defaults: 9 m² and 240 cm. | A narrow 2.2 m clear bedroom fails the 240 cm side setting. |
Minimum Bathroom Area / Minimum Kitchen Living Area | Clear minimum areas. Defaults: 3 m² and 12 m². The latter is combined kitchen/living, not two separate rooms. | Raise the kitchen/living minimum only if a larger common area is needed. |
Corridor Width Cm | Required connected walking width; default and minimum 100 cm. Room area excludes the reserved corridor. | Keep 100 to retain the validated minimum route width. |
Read the result: Generated Room Summary lists the target and actual bedroom/bathroom counts per floor. It reports the ground-floor kitchen/living area and configured circulation width. Validation Status reports whether generation was valid.
Guided rooms, doors and windows
Use this mode when you want to draw the rooms rather than have the system choose them. Enable Use Room Guides on the house. This automatically requests room generation; the automatic Bedroom/Bathroom numbers become informational targets and never remove your authored guides.
| House or guide control | Meaning and use |
|---|---|
Use Room Guides | Use the linked closed room splines in place of automatically chosen rectangular rooms. At least one ground-floor Bathroom and one ground-floor KitchenLiving guide are required. |
Add Room Guide / Room Guides | Add creates and links an editor-only child. The new default 325 × 325 cm outline is only a starting shape: select its RoomSpline component and draw the actual closed room wall-centre polygon. The array lists linked guides; their House must reference this actor. |
Room guide Room Type / Floor | Types: Bedroom, Bathroom, KitchenLiving, Corridor. Floor is zero-based (0–2 and must exist in Number of Floors). Room polygons need straight, noncrossing edges; adjacent rooms share an exact edge rather than overlap. |
Make Linear And Set Floor Height | On a room guide, explicitly straightens all points and sets house-local Z to Floor × 320 cm. It preserves XY size. Use after changing Floor or importing curved/nonplanar points; then regenerate. |
Add Door Guide / Add Window Guide / Opening Guides | Create linked editor-only markers. Set each marker's Opening Type and Floor, then move it to the opening centre on the corresponding wall centre line at house-local Z = Floor × 320 cm. New markers start at the house origin and need placement before regeneration. |
Opening Guide Snap Opening To Nearest Valid Wall / Snap Status | Place a Door or Window Guide near the intended wall, then click Snap. Doors search same-floor room walls and ground-floor exterior walls; windows search exterior walls on their selected floor. The fixed-size opening and complete house must validate. Only this marker moves and rotates to align its arrow with the wall; Undo restores its transform, then regenerate. |
Auto Snap Invalid Opening Guides | On by default: if Regenerate fails on an opening marker, search nearby valid positions for the invalid Door/Window Guides. Move and rotate them only when the entire house validates; report the count in Validation Status and each result in Snap Status. Room/footprint splines stay where you drew them. Off preserves every marker exactly and reports the validation error. |
Auto Connect Room Guides | On: add missing connecting doors when valid. Off: require explicit Door Guides for all needed room connections. This is separate from snapping existing guides. |
Guide Regenerate House | Generate the linked house from a selected room/opening guide. Equivalent to the house's Regenerate Building. |
- Draw closed room outlines along wall centre lines. An exterior room line follows the exterior wall centre, 12.5 cm inward from the outer footprint; clear dimensions are smaller after the 25 cm wall. Leave common circulation or draw Corridor guides. Two rooms may share one wall when their boundary segments coincide exactly, with no interior overlap; the generator emits that wall once.
- Give each room a type and floor. For an upper room, set Floor 1 and click
Make Linear And Set Floor Heightto place it at local Z=320 cm. - Place Door Guides where rooms meet the common space or another room, and Window Guides near exterior walls.
Snap Opening To Nearest Valid Wallaligns either type explicitly;Auto Snap Invalid Opening Guidesretries failed regeneration automatically. Check the result: the nearest valid wall can be a different side when a marker is closer to it. A ground-floor exterior Door Guide replaces the exteriorDoorslist for generation. - If any Window Guide exists, automatic windows are suppressed on every floor and only marked windows are used. Keep
Windowsenabled. Corners, partition junctions, doors and stairs still need a valid full-size opening; if none fits, generation retains the previous house and reports the error without moving markers. - After reshaping a house, set
Footprint Source = Spline; editing FootprintSpline while Rectangle is selected does not change the house. RunMake Footprint Linear And Planarif a dragged point changes height, thenRegenerate Building. Spline gable roofs also needFit Roof Wings To Footprintas a starting design. Read Validation Status and Generated Room Summary before saving the map.
PCG_GuidedRooms_Example in the preview map is a one-floor guided house with an edited five-point footprint, three closed room guides (Bedroom, Bathroom, KitchenLiving) and four opening markers. Footprint Source is Spline and Auto Connect Room Guides is off. Select it and edit a child guide to learn the workflow without changing the other houses.Roof, finish layers and materials
| Details control | Meaning and use |
|---|---|
Layout → Roof / Roof Pitch | Choose Gable or Flat. Gable pitch defaults to 30° and must be greater than 0° and less than 90°. Ridge height follows actual opposing walls. |
Roof Overhang Cm | Horizontal distance past each exterior wall face; default 50 cm. Rectangle uses 25 cm increments. A tight spline recess can make the offset cross itself; reduce overhang or widen the recess. |
Spline Roof Wings / Fit Roof Wings To Footprint | In Spline mode, each wing's Centre Cm and Yaw Degrees select a ridge direction (0° along local +X). Add/edit wings for an L/cross-gable. Fit is an explicit refit: it may replace your current wing arrangement. Legacy Ridge Length/Width are read-only history; actual walls set the eaves and ridge rise. |
Layout → Floor Finish / Ceiling Finish / Exterior Wall Finish | Enable separate 1 cm decorative layers. Floor Finish is the walking top of slabs; Ceiling Finish faces rooms below; Exterior Wall Finish covers exterior walls and gables around openings. They are separate from structural Floor/Ceiling/Wall. Exterior Wall Finish defaults off in the class; the saved preview houses may override it. |
Initial Floor / Ceiling / Exterior Wall Finish Tier | Initial Wood/Brick/Concrete gameplay tier for authored finish tiles. This is distinct from visual material choice. House Instance Id is a read-only identity for saved authored finish deltas; duplication creates a new ID. |
Building → Inspection: reveal the interior without regeneration
Hide Roof hides the roof sheets, both gable materials, attic louvers and top ceiling. Hide Floor 1, Hide Floor 2 and Hide Floor 3 independently hide the corresponding storey's walls, partitions, openings, floor slab and finishes; an inter-floor slab, its upper Floor Finish and its lower Ceiling Finish hide together with the upper floor. A stair belongs to the floor where it starts. Uncheck a box to reveal the same baked pieces again. These checkboxes change Editor visibility only: they do not rebuild PCG, change the piece count, alter collision or remove finish records. PIE restores the complete house regardless of inspection checkboxes. Floor 2/3 controls have no visible effect when that storey does not exist.
Example: on a two-floor L house, enable Hide Roof and Hide Floor 2 to inspect the ground-floor rooms from above. Uncheck Hide Floor 2 to inspect the upper floor with its roof still hidden; finally uncheck Hide Roof.
Building → Materials: choose the surface, then assign its MI
Assign a Material Instance in the named house field. Empty means use the existing mesh material or the fallback shown below. Material fields change appearance; finish tier fields control gameplay tier. Generated procedural surface component slots show role names instead of anonymous Element 0–3; use the house fields as the primary setting.
| Material field | Applies to / empty-field behavior |
|---|---|
Wall Material | Structural and room-facing wall surface. Empty uses the mesh's authored material. |
Exterior Wall Finish Material | Separate outside decoration; empty follows Wall Material. |
Floor Material | Structural slabs, including the ground perimeter; empty uses the mesh material. |
Ceiling Material | Structural room-facing slab undersides/top ceiling; empty follows Floor Material. |
Floor Finish Material | Decorative walking surface; empty follows Floor Material. |
Ceiling Finish Material | Decorative room ceiling; empty follows Ceiling Material, then Floor Material. |
Roof Material | Roof covering; empty uses the mesh's authored material. |
Upper Gable Material | Upper half of gable; empty follows Wall Material. |
Attic Vent Material | Attic louver frame and blades; empty preserves their mesh material. |
Door Frame Material / Door Material | Separate fixed frame and fitted static leaf; empty preserves each mesh material. |
Stair Material | Stair module; empty preserves its mesh material. |
Example: set Wall Material to an interior plaster MI, enable Exterior Wall Finish and assign Exterior Wall Finish Material to a brick MI. The room-facing wall and the visible outside then use different materials. Set Floor Finish Material to tile and Ceiling Finish Material to painted plaster to separate the two faces of a floor slab.
Generation, output and recovery
| Control or result | What it does |
|---|---|
Building Graph | Normally PCG_ModularHouse. If missing, assign it before generating. You do not need to edit the graph to change a house through Details. |
Auto Regenerate | On by default: rebuild after committed layout/material Details changes and completed actor moves in the Editor. Inspection checkboxes only update visibility. Guide spline/marker edits still need an explicit Regenerate action. |
Regenerate Building | Validate settings and update baked surfaces and PCG mesh instances. Use after guide edits, spline edits or changes made while Auto Regenerate is off. |
Clear Generated Building | Remove this house's generated visuals. Regenerate Building restores them from the current settings. |
Validation Status | Read-only explanation of valid output or the first blocking configuration error. Invalid guides/room programs preserve the last usable generated house; fix the reported input and regenerate. |
Generated Room Summary | Read-only actual room counts. In guided mode it reports authored rooms; automatic count targets are informational. |
Planned Piece Count | Read-only count of generated mesh instances plus grouped procedural surface sections. It is not a count of player-demolishable gameplay pieces. |
Common validation messages and what to check
- Stair clearance: move/rotate the preferred stair or use Compact Stair with Auto Place. Check both its lower approach and upper exit.
- Closed/linear/planar guide: select the room guide, set Floor, click Make Linear And Set Floor Height, inspect points and regenerate.
- Room too small or overlapping: enlarge its clear area or move the wall-centre polygon; adjacent rooms may share an edge but cannot overlap.
- No door connection: add a Door Guide on a valid shared wall or enable Auto Connect Room Guides.
- Window Guide conflict: auto snap tries a nearby exterior position; if the complete layout still fails, move the marker away from corners, other openings, partition junctions and stair clearance.
- Roof-only warning: structure can remain valid while the roof is omitted; inspect pitch/overhang/wing centres and regenerate after correction.
- Missing Building Graph: restore
PCG_ModularHousein Building → Generation.
Three worked setups
1. A two-floor rectangular house with automatic rooms
- Choose Rectangle, Width 10, Depth 8, Number of Floors 2. Add one Door with Edge 0 and Offset -1.
- Turn on Compact Stair, Auto Place Compact Stair, Generate Rooms, Windows and Allow Fewer Rooms. Request Bedrooms 3, Bathrooms 1, Ground Floor Bedrooms 1. Keep the default 9 m² bedroom, 3 m² bathroom, 12 m² kitchen/living and 100 cm corridor minimums.
- Regenerate. The saved rectangle example reports one bedroom/bathroom downstairs and two bedrooms upstairs. Check the actual summary after any edit; it can change if the footprint, stair or minimums change.
2. An L footprint with a chosen roof direction
- Choose Spline and edit
FootprintSplineinto a closed L. Keep linear points at local Z=0. Set Number of Floors to 2. - Choose a valid ground-floor Door edge and start offset. Turn on Compact Stair and Auto Place. Set the preferred Spline Stair Location/Yaw, then regenerate and read the status and actual room counts.
- Use Fit Roof Wings To Footprint as an initial guide, then edit each wing Centre/Yaw to keep the desired cross-gable direction. Set Roof Pitch 30° and Roof Overhang 50 cm; regenerate after changing the wings.
The saved two-floor L retains its original footprint, entrance and stair preference; the bounded automatic search currently produces one upstairs bedroom plus a downstairs bathroom and kitchen/living area against a target of three bedrooms.
3. A house with rooms drawn by hand
- Start from
PCG_GuidedRooms_Exampleor another house. Enable Use Room Guides. Add closed KitchenLiving, Bathroom and Bedroom guides on Floor 0. Draw their wall-centre lines without overlap and leave common circulation. - For explicit placement, turn off Auto Connect Room Guides and put Door Guides at each needed wall opening. Add a Window Guide at a safe exterior wall centre; this replaces automatic windows house-wide.
- Regenerate from the house or any guide. Read Validation Status, correct the exact offending guide/marker if needed, then save the map.
Source, persistence and verification
Source of truth for controls: Source/Lambeer/Building/PCG/LambeerPCGBuilding.h/.cpp, LambeerPCGRoomGuide.h/.cpp, LambeerPCGBuildingLayout.cpp, LambeerPCGSplineLayout.cpp, LambeerPCGRoomPlan.cpp and LambeerPCGGuidedRooms.cpp. FEAT-BUILDING remains the canonical design/decision record; this page explains its Editor controls.
Room and opening guides are editor-only. Save the level after a valid generation. Baked house geometry is used at runtime; individual authored finish tiles use stable house/tile identities and the existing world persistence path. Structural house HP, locks and demolition are outside this authoring guide. The bounded room/stair searches are Editor work, not a runtime performance budget.
Verification: latest Editor and Game builds, 39 PCG/Building/Persistence automated tests, four preview-house geometry probes and save/reload checks pass as recorded in the validation record. Only the owner may start PIE. Walking every route, using stairs and checking multiplayer finish removal/rejoin in PIE remain owner acceptance checks.
Implementation state: current controls are implemented; no new controls are proposed on this page. If a Details field or result differs after later code changes, verify the current source and update this guide with FEAT-BUILDING.