Building Construction Tool Blueprint

This is the most complex tool in this project and it is based on the Building Modular Piece Blueprint. Basically, it spawns several “Building Modular Pieces” and sets the parameters of each one in order to create a building. The positioning of these pieces is based on an algorithm made in the Blueprint.

To generate a building, you should have in the scene a Controller Modular Building (Blueprint instance) and the “Building Construction tool” (Utility Widget) opened in the editor.

Generating Modular Building

Building Construction Tool

Right-click on Building Construction Tool (/Blueprint/Building) and select “Run Editor Utility Widget”:

The UI of Building Construction Tool:

Controller Modular Building

Drag and drop “B_ControllerModularBuilding” in the scene (…/Blueprint/Building). Each building will have a Controller that will help you to generate and edit the building. If you’ll have the “Preview” checkbox true, the Controller will appear as a preview building which will help you to see how the final building will look like. The controller will be hidden in the game.

To generate the building, there are many parameters on the “B_ControllerModularBuiling” that can be changed, depending on the style you want to achieve.

After you set the parameters, select the controller of the building and press “Generate” (from Building Construction Tool UI).

If the result is not satisfactory, you can change the parameters and press "Generate" again until the desired result is achieved.

Tip: You can activate game mode by pressing “G” and this can help you to see better how the building looks without the editor UI and Modular Building Controllers.

You can also have a non-rectangular building like this but it can appear some small gaps depending on the angle that should be "fill" manually with other models:

Interior Category

Video Link - Generate Buildings with the interior: https://youtu.be/HtZGLKDppIU

For each floor of a building, you can check the "Floors Interior" parameter to have the interior. For example, if you check the "0", the ground floor will have interior.

If you check "All floors have interiors", it will check all the checkboxes from "Floors interior"

It is ok to have some buildings with interiors, but I don’t recommend having interiors for all the buildings from a scene because if they’ll have furniture and other props, it will be hard to optimize the scene overall.

Roof/Floor Blueprint

Example of roof/floor with “Generate Sides” off/on:

The floors will be generated for the floors that have interior.

“Recalculate The Spline” will make the angles equal to 90 degrees and snap the points (grid 10 units).

The shape can be adjusted if you modify the spline, this could be useful if the building has interior and you want to change the shape of the floor to add basic stairs:

Door Blueprint

The player can press the E key to open/close the door.

Double door works only if the door doesn’t have “Frame” mesh:

If a modular piece blueprint has an interior and a door in the hierarchy, the type/material can be changed from the modular piece parameter (door category).

Shape and Dimensions

The default shape is rectangular and you can adjust the dimensions of the building by changing the “Dimension 1” and “Dimension 2”.

If “Custom Shape” is true, you can edit the spline of the controller to have a custom shape.

It is preferable to have only right angles (90°), because the corner will use modular corner pieces.

If not, it can have some gaps at the corners that don’t have 90°:

How to edit the custom shape

After checking the “Custom Shape” checkbox, you can move any point of the spline, or add more. If you want to add a new point, you can select a point, hold ALT and move the point to a new position.

It is recommended to enable the “Preview” mode of the building when you are editing.

If you want to transform in a shape with only right angles, you can press on “Recalculate spline - Right Angles”.

Press on “Recalculate the spline” and the spline will be recalculated to have all points snapped on the grid and each angle will be a right angle (90°):

After that, you can set the parameters of the Modular Building Controller and generate a new building in the desired shape:

Another example of a building having a custom shape:

Ground Floor

If “Ground Floor” is checked, the building will have a ground floor. The “Ground Floor Variation” parameter will determine which modular pieces will be used to create the ground floor of the building.

Both parameters should be set before generation.

Facades And Sections

Each element from “Sections – Number Of Floors” determines how many floors each section will have.

Examples of buildings with different sections and number of floors:

You can visualize the sections when you use the preview mode.

Facades:

This array should have as many elements as the number of facades of the building.

Each facade can be front/back:

The pattern type of each facade can be:

  1. Windows - all the modular pieces will be “windows” type

  2. Simple - all the modular pieces will be “simple” type

  3. Alternative Even - the modular pieces will be an alternative pattern: one “windows”, one “simple”

  4. Alternative Odd - the modular pieces will be an alternative pattern: one “simple”, one “window”

You can see the type of each facade in the preview mode.

Example Front-Windows and Front-Alternative odd. Preview vs Generated Building

Example Back-Simple and Back-Alternative Even. Preview vs Generated Building

The occluded facade helps when you have another building next to it, and that wall is not visible. This is very good for optimization reasons, to not have any objects that will never be seen.

Example Back-Simple and Back-Alternative Even Occluded (Number of non-occluded floors=3). Preview vs Generated Building:

If a building has a custom shape, the facades of the walls connected by a concave corner should be both "front" or "back".

Basic Parameters

The building type parameter determines which modular pieces will be used for the entire building and its features. This parameter should be set before generation.

The “Height Floors” determines the height in meters of the upper floors:

You should regenerate the building to apply the correct height. Example of Height Floors 3m-3.3m:

Building Rules Style

You can set “BuildingRulesStyle” to determine which Building Rules Style will be used.

For example, you can have only the buildings for the downtown area in the "BuildingStyle 1" and buildings for the suburb area in the "BuildingStyle 2", etc.

Downtown buildings (Building Rules Style=1) vs Suburbs buildings (Building Rules Style=2)

Materials Category

Each of these parameters changes a specific material type for each building.

Colors – Materials

  • Yellow – Front pieces material

  • Cyan – Back pieces material

  • Orange – Ground Floor material

  • Black – Windows’ frames

  • Green – Ornaments material

  • Grey – Concrete material

  • Red – Window material (for Shop)

  • White – Window material

  • Blue – Air Conditioner material

These parameters can be set after generation and the building will update in real time.

Example of changing the "Front" material parameter:

Random Parameters

To completely change the style of the building, the user can use the "Random" Category.

Select which settings you want to be enabled (below the “Randomize” checkbox), then when press “Generate” using the Construction Building Tool, the specific parameters will be randomized.

If you want to randomize only the materials after generation, you can press on the “Randomize Seed” checkbox when you have the “Materials” and/or “Custom Materials” true. (The “Enable Random” should be checked)

Random Category:

Example of random buildings (with preserved length/type:

Other

If “Force Only One Length” is checked, the generated building will have the modular pieces with a length equal to “Force Only One Length Value”.

If “Force Only One Type” is checked, the generated building will have the modular pieces with the type equal to “Force Only One Type Value”.

Example of buildings:

When the “Preview” is true, a low poly building will be created for better visualization. Also, when it’s true, the Modular Building Pieces of the building will be hidden. This will increase your performance in the editor’s viewport but don’t forget to disable it when you’ll start the play mode. Using this mode, you’ll be able to see in real-time the sections of the building and the facades type.

Example Front-Windows and Front-Alternative odd.

Example Back-Simple and Back-Alternative Even.

Example Back-Simple and Back-Alternative Even Occluded (Number of non-occluded floors=3).

Performance Mode can be activated from Building Construction Tool UI and turn all the buildings from the level to preview mode to increase the performance in editor:

Preserve Length and Type

If the “Preserve length/type” is true, the length and type of the pieces will be preserved after the regeneration of the building. It will not work properly if you changed the dimensions/shape or the type of the building.

Selection of modular floors in the generated buildings

The Building Construction Tool (Utility Widget) has 5 buttons for selecting specific modular pieces from already generated buildings. They make it easy to edit specific pieces after generation. To use these buttons, you must first select a modular piece depending on what you want to select.

Buttons:

  1. Building - selects all the modular pieces of the building and the rooftop

  2. Floor - selects the floor of the selected modular piece

  3. Column - selects the column of the selected modular piece (above and under that piece)

  4. All Floors - selects all modular pieces on the upper floors (all modular pieces except the ground floor pieces)

  5. Ground Floor - selects all modular pieces from the ground floor

Last updated