Procedural Buildings PART I

Hi there once again, and welcome to another series of posts.
image courtesy of Pixabay, by LoboStudioHamburg

After a while, I will cover my current endeavour into building an adequate building generation procedural mechanism, which will be used in a more complex experiment of a procedural city generator.

The layout of this series is as follows:
  1. The overall concept and vocabulary (this post)
  2. Other similar efforts, references
  3. Design of the system and Hands-on implementation in Unity scripting (a separate post for each release will be provided, see the release plan below)
  4. Improvements and future work
In Rational Unified Process (RUP), a popular software development methodology, there are 4 main phases in each project, that are sequential, and in many cases the whole 4-phase cycle is just one of many iterations:
  1. Inception, where the idea is born
  2. Elaboration, where some plans are made and designs to prepare for the implementation
  3. Construction, where the actual programming is done, following the blueprints designed during elaboration
  4. Transition, where testing and improvements are done to finalise the implementation and prepare the production-ready results.
In the first version of this series, I will focus on Inception, as this is the current phase of this project. As I go on with implementation, I will unwrap the other phases as well, by refining and progressing my work and my results.



The overall Concept, Release plan and Vocabulary

My aim is to construct  a system that will be able to procedurally create a building, out of a set of defined parameters. I would like to target both a system to be used through the Unity editor -facilitating the building of pre-made building meshes and adding them in the scene- but also to be used dynamically during run-time servicing the needs of the game mechanics. The system should be able to accept as its input a set of parameters and a set of textures, and produce at its output a textured mesh of the building.

The aim is to use the system iteratively by a city generator. Since the city generator will call for iterative building generation, the most of the constraints (if not all) while defining the parameters for procedurally creating a building will come from the former. Since normally we first tessellate the area in blocks by passing roads and then we build in the resulted building blocks, the building surface is constrained by the building block surface. To be frank, in Greece reality has this rule inverted: we first construct the building in a lot that we own, then we pass some road(s) by its side(s). But please ignore this last comment and go on (except this is the case in your country as well, that I would like to hear about, please leave a comment).

Since this is going to be a procedural system, the main unit of any building is the level.  Multiple levels are stacked one atop another. Shops may occupy part (or all) of the zero-level, while a roof is topping the last level.

I would love to create versions of each building to be used in high and low LOD (Level Of Detail), but I am not there yet. So I am thinking that I should go for a low-resolution only output that would be easier to be rendered when I integrate the buildings in the city scene.

Furthermore, the building should be destructible/ destroyable, and this requirement sets apart the modelling of the problem from other implementations out there: I want them to be able to be ripped apart, either as a result of an explosion or of another destructible force. To this end, I think that the building should be designed with some inner structural elements, not be just a mesh of the outside walls. More on this in the design of the system, in a later post.

The release plan

During the course of my experimentation, I am going to try different algorithms and techniques to find out what works best. I will start with the simpler ones, and then go on with more complex designs.
The implementation will comprise many iterations, starting from a very simple one, ending (hopefully) to a very parametric and powerful one. So the intended release plan will be as follows (this may be updated in the future of this project):


Now I will need to start some vocabulary definitions, so that I will be concise and consistent in my descriptions later on in this series of posts. Unfortunately I am not an architect, so I will present things that I have found from a short internet research. Some building restoration and other cultural preservation sites have been a good source.

Here we go (well, the definitions can definitely be improved, but I hope that you get the meaning of it):

Vocabulary of elemental (structural) things for procedural buildings:

  • Floor: the basic element of a building, that occupies a horizontal volume of its mesh
  • Façade: the exterior surface of the building, that is visible to outside viewers
  • Ledge: the horizontal zone/area on the facade that is used as a level separator, can be visible or not
  • External wall: a vertical construction on the façade plane
  • Sash: window frame, including window glass
  • Sill: horizontal member immediately below the window assembly
  • Corner: the vertical edge where two external walls are colliding
  • Cornice: projecting member at the top of the exterior wall
  • Storefront: Front exterior wall of commercial space
  • Lintel: structural member above a storefront or a window sash
  • Roof: the top of the entire building, may be a simple textured mesh topping the external walls of the lower level or a special level with structural elements and a top mesh

Architectural elements in a building's façade (Source: Fort Madison historic preservation)
Multi-level buildings are going to be built by stacking levels, procedurally generated, one atop another. Of course, each level will be built by applying a set of constraints. An example for my buildings will be that:
  • k+1 level will have a floor surface <= to the surface of floor k
  • All corners of k+1 level, when projected downwards, will be lying inside the surface of floor k (for stability and form)

Vocabulary of texture elements for procedural buildings:

As texture elements that can be added in any floor, I consider the following:
  • Window frame and window (sash, window and sill)
  • Wall (wall block/ tile)
  • Door (main entrance and balcony doors)
  • Balcony
  • Escape stairs
  • External lamps
  • External wall tiles
Most of the main building facade elements are reused, in a often-symmetrical pattern. Examples are seen in the images below, where dotted guidelines have been drawn in order to discern some of the main elements (floors, windows, sashes):



In order to achieve an ability for diversification in the outside look of produced buildings, multiple versions of each texture element should be provided. I will try to locate good textures/photos of a good variety of these things, and the system should be expandable, letting the user defining their own. I will have also to restrict the styles of used elements in a city's buildings from the available ones, we do not want to have cities made of buildings of veeery diverse styles, that would not be nice, some kind of homogenisation is sought, at least from a distance.

Both structural and ornamental building elements should be placed with care: They should not overlap or occlude one another, and some symmetry rules should be applied. I will encode such rules, and try to make them easily modifiable by the user.

Comments