A tool that when given a basic ‘block out’ shape, and a named set of building components, can generate detailed buildings.
The building generator is a Gamedev tool. Here is a high level summary to explain what the tool is capable of.
Modules represent building components; windows, doors, ledges etc
Modules sit on the YZ plane, front lower right corner at origin (see image)
As a rough guide, I start with a wall module of about 4x4 units (ie 4 pigheads)
Module primitives need a @name attribute to be identified, eg ‘wall’
The gamdev building generator utility is a single node to set module dimensions and @name for you.
Flat of wall on YZ plane, front lower right corner at origin.
Block out geo
Should sit on the ground plane
Prefers right-angle geometry (but not essential)
Prefers non-twisting not overly complex shapes (but still creates interesting useful shapes if you try)
A ‘building’, with panel for size comparison.
A simple building
Behold a building that would make the finest architect weep with jealousy (don’t worry, we’ll work up a better one after covering the basics):
This was generated from this blockout shape:
How? Read on!
After going through the getting started section, you may want to explore this example file which shows the Building Generator being used with Pre-Made building modules. The example demonstrates Facade Pattern Syntax, Handplaced Overrides and Volumetric Overrides to show you how to maximize the ability to art-direct your generated building. The modules have been extracted from "Poste Model", courtesy of maito78.
Here I’ve made a 30x10x30 box, and connected it to the building generator sop with all the options disabled. The walls get divided into panels. Changing ‘full floor height’ changes the size of the panels:
Connecting the panel to the second input and setting the name (‘wall’ in my case), the placeholder panels are replaced with the hero panel:
The logic here is simple in theory, but tricky to implement; panels are packed into each wall, trying to leave an even gap on the left and right sides, and for that gap to be as small as possible. Be thankful the gamedev team have worked out this logic for you. ;)
Enabling ledges in the secondary section will do as expected, with small placeholder flat panels that can be swapped with named modules later:
Corner ‘caps’ can be added for bonus detail:
To set these up is similar to a basic wall panel. Corners need a left and right panel defined. The left corner is defined like a basic panel, in fact lining it up against the base panel makes it clear to see the relationship; for these corners I want the corner to sit over the wall, so it has its lower right back corner at the origin. This piece is named corner_L. To make this panel available to the building generator, it and the original wall panel are connected to a merge sop, which is then connected to the second input of the building generator.
The right corner will be aligned from its lower left back corner, looking like its been mirrored across the x-axis:
Knowing that the origin is used as the alignment point, this means we can angle the face sitting on the XY axis to make a clean corner chamfer:
To handle convex as well as concave corners, we’ll need 2 more corner pieces with their XY face angled the other way (I’ve named them corner_l_cvex and corner_r_cvex):
Adding those to the concave corner parameters gives us clean corners in all cases:
Building generator utility node
So far the pig panel has just sized itself to fit into the building, but what if we had explicit measurements to conform to? Also, we have to make sure to add @name to every panel. Feels like someone should make an HDA to do these things.
Guess what? They have! The building generator utility node covers both these needs (and a few more). I replace the name sop with the utility node, specify the name there (using $OS so I can be lazy), and specify the width and height of this panel (2x2), so it won’t be resized in unexpected ways.
In this example I’ve modelled 2 panels, window01 and window02. The default setup uses window1 for all panels, and I’ve turned off corners and ledges for now:
At this point I want to use window02 for the first and second floors. The customisation/floor overrides section allows this. When I create a new entry under the floor overrides, the settings from the primary and secondary parameters are copied, ready for me to modify. Here I swap window01 for window02, and can see the first floor gets updated:
This process can be repeated and customized for each floor.
Hand placed overrides
If you have hero facades or sides to your building, you can place them where required in world-space. The building generator can be made aware of this, and won’t try and put modules in that region..This is done via the building generator utility node hand placed overrides tab. Here I place this exquisitely modelled section where it needs to be in the world, then with the building utility node updated the center and size sections. These values represent a bounding box to tell the building generator “Don’t put any modules here.”. When connected to the 3rd input of the building generator, this will clip out the panel sections and use this hand placed override instead:
As well as hand-placed overrides, you can define bounding boxes, and tell the generator ‘in this region, use these settings instead’. Here I’ve defined another section called door01, and place a box covering the entrance where I want doors to go. The box is connected to the building generator utility’s 4th input, and those panels are replaced:
To make the roof I:
split off the top section (all the primitives in the building get useful attributes like floorIndex, and several handy groups)
group the top face,
bevel and inset it,
merge with the rest of the building.
Building 2 - kitbashing from an existing model
Here’s a more presentable result, this time using elements from an already modelled building.
Most of the work was in finding a model, prepping the modules was pretty straightforward. Here’s the 3 obj’s I started with, aligned and stacked:
This obj was massive, so I used the gamedev align tools to first get them down to a unit size at the origin, then scaled up to be about 15 units across:
From here its a pretty easy task to isolate to each module I want. Here I show isolating one of the ground floor modules. The workflow is:
Use the 9 hotkey group lister to select the ground floor, split it
Select a window panel, split it
Axis align tool to move it to the origin, aligned to the YZ plane
Building utility to name and set its dimensions (which I get from looking in the geometry spreadsheet)
Working this way I can quickly define 3 modules for wall_floor, wall_mid, wall_top:
Feeding all this to the building generator sop, this time I was careful to match the floor heights to those I got from the geometry spreadsheet, that way everything behaved:
At this stage I tried a cheeky bevel on one corner of the blockout geo, it still behaves as you’d hope:
Look a little closer, there’s some gaps, why? It’s because I’ve been a little sloppy with the module alignment, the corner at the origin should match up between all 3 modules. I’ve used the axis align sop to push the max-X value to the origin, but these 3 modules have different ledges, so they get shifted to different depths. A transform sop for each module will fix this (make sure to apply this before the utility sop!):