Building#

Drag a Building actor into your level, adjust the spline to draw the floor outline of a building, and click on Generate Building. In the Building Configuration section of your building, you can change: materials, number of floors, floor size, windows sizes, distance between windows, windows meshes, roof parameters, etc. If you want a curved building, make sure that your spline has curves (select all spline points, and select Curve as a point type), and increase the number of Wall Divisions in the Building Configuration.

Building Configuration#

The building is built from a Building Configuration which defines its structure. The configuration is organized into several sections:

Structure: Choose between Building Without Inside (a simple solid block, best for performance) and Building With Floors And Empty Inside (a hollow building with separate floors and internal walls). You can set the wall thicknesses, the number of floors (or let it be auto-computed from OSM data), and add extra wall height above and below the floors.

Levels: A building is composed of a sequence of levels (floors), each with its own height and thickness. You define the available levels in the Levels Map (a dictionary of LevelDescription objects), then specify their order and repetition with the Levels Expression. See below for the grammar.

Wall Segments: Within each level, the walls are composed of wall segments that are placed along the building spline. Wall segments can be solid walls or holes (for windows and doors). You define the available wall segments in the Wall Segments Map of each level, then specify their order along the spline with the Wall Segments Expression. By default, wall segments repeat for each segment between corners; set bResetWallSegmentsOnCorners to false to apply the same pattern to the whole building.

Material Expressions: Materials are referenced by name using expressions. For instance, {Brick:3, Stone:1} will choose Brick 75% of the time and Stone 25% of the time. Wall segments can also override materials per face (interior/exterior, above/below holes).

Roof: Choose from None, Flat, Point, Inner Spline, Hip, or Gable roofs. Hip and Gable roofs are computed using a straight skeleton algorithm, which automatically creates complex roof shapes from the building footprint.

Level Expression Grammar#

The Levels Expression and Wall Segments Expression use a simple grammar:

  • Space-separated names are concatenated in order.

  • * repeats the preceding element zero or more times.

  • + repeats the preceding element one or more times.

  • {A:n, B:m} randomly chooses between A and B with relative weights (here, A appears n/(n+m) of the time).

  • Name:N repeats the element exactly N times.

Example: GroundLevel OtherLevel* means one ground floor followed by zero or more OtherLevel floors. Example: {LevelA:4, LevelB:1} randomly picks LevelA (80%) or LevelB (20%) for each occurrence. Example: GroundLevel {LevelA:3, LevelB:1}+ means one ground floor followed by one or more randomly chosen LevelA or LevelB levels.

Building Configuration Settings#

Building > Structure

  • Building Geometry (EBuildingGeometry, default Building Without Inside): Choose whether you want geometry inside your building, and holes for windows

    • Building Without Inside: Simple block without any geometry inside (best performance)

    • Building With Floors And Empty Inside: Simple block with an empty inside

  • External Wall Thickness (double, default 10): The thickness of the external walls

  • Internal Wall Thickness (double, default 1): The thickness of the internal walls

  • Build Floor Tiles (bool, default true): Build floor tiles.

  • Auto Compute Num Floors (bool, default true): If true (this takes precedence over NumFloors or UseRandomNumFloors) and if the Asset User Data contains a levels value, the number of floors is set to this value. If it contains a height value, the number of floors is set to the height in meters divided by 3 meters.

  • Levels Tag (FString, default "building_levels")

  • Height Tag (FString, default "height")

  • Use Random Num Floors (bool, default false): Random number of floors

  • Num Floors (int, default 5): The number of floors (including ground level)

  • Min Num Floors (int, default 4): Minimum number of floors

  • Max Num Floors (int, default 8): Maximum number of floors

  • Wall Subdivisions (int, default 0): The number of subdivisions in a wall (increase it if you want round buildings)

  • Auto Pad Wall Bottom (bool, default true): If true, then the next time the Building is generated, ExtraWallBottom is set to the difference between the maximum and minimum Z coordinates of the splines points, to which we add PadBottom.

  • Extra Wall Bottom (int, default 0): Wall height below the first floor

  • Pad Bottom (int, default 0): Wall height below the first floor

  • Extra Wall Top (int, default 20): Wall height above the last floor

  • Auto Generate U Vs Floors (bool, default true): Compute UVs using box projection for floors

  • Auto Generate X Atlas Mesh U Vs (bool, default false): Recompute UVs using AutoGenerateXAtlasMeshUVs for full building (slow operation)

  • Enable Complex Collision (bool, default false)

Building > Materials

  • Materials (TMap<FString, TObjectPtr<UMaterialInterface>>)

  • Interior Material Expr (FString)

  • Exterior Material Expr (FString)

Building > Levels

  • Cache Levels Within Building (bool, default true): if false, then the same level can be generated in different ways due to randomization in the wall segments if true, then all occurrences of a given level in the building will be identical

  • Levels Map (TMap<FString, TObjectPtr<ULevelDescription>>)

  • Levels Expression (FString, default "GroundLevel OtherLevel*"): an expression using the level names above, with space for concatenation, star (*) for repetition {A:2, B:3, C:5} for random choice

Building > Roof

  • Roof Kind (ERoofKind, default Flat): Build roof

    • None

    • Flat

    • Point

    • Inner Spline

    • Hip

    • Gable

  • Outer Roof Distance (double, default 100): The length of the roof that goes outside the building (overhang)

  • Inner Roof Distance (double, default 50): The distance from the walls to the inner/top part of the roof

  • Roof Thickness (double, default 5): Roof thickness

  • Roof Height (double, default 250): The distance from the top of the walls to the top of the roof

  • Roof Angle (double, default 30): The angle of roof faces in °, 0° means fully horizontal, and 90° fully vertical

  • Roof Material Expr (FString)

  • Under Roof Material Expr (FString)

  • Gable Material Expr (FString)

Building > Push Out Of Collision

  • Attempt To Push Out Of Collision (bool, default true): Will attempt to push the building in 8 horizontal directions for a number of steps to prevent collisions.

  • Push Max Steps (int, default 10)

  • Push Step Size (int, default 200)

  • Pusher Tag (FName, default "can-push-buildings")

  • Show Push Debug (bool, default false)

  • Reproject Spline On Landscape After Push (bool, default false)

  • Reprojection Actor Selection (FActorSelection)

Building > Conversions

  • Convert To Static Mesh (bool, default false): Convert to static mesh after the building is generated.

  • Enable Nanite (bool, default true): Enable Nanite when converting building to static mesh.

  • Building Receive Decals (bool, default false): Whether the generated building can receive decals.

  • Convert To Volume (bool, default false): Convert to volume after the building is generated.

Building Settings#

Building

  • Spawned Actors Path (FName): Folder used to spawn the volume. This setting is unused when generating from a combination or from blueprints.

  • Generate When Modified (bool, default false): Automatically regenerate the building when a property is modified.

  • Building Configuration (UBuildingConfiguration)

  • Spline Component (USplineComponent)

  • Empty Scene Component (USceneComponent)

  • Static Mesh Component (UStaticMeshComponent)

  • Dynamic Mesh Component (UDynamicMeshComponent)

  • Base Clockwise Spline Component (USplineComponent): same as SplineComponent, but all points have the same Z coordinate as the lowest point, and there are subdivisions (depending on the WallSubdivions property of the BuildingConfiguration) and the points are clockwise (when seen from above in Unreal, which isn’t the same as clockwise in TPolygon2 because of inverted Y-axis)