Hi there once again, and welcome to another series of posts.
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:
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 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):
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:
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.
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:
- The overall concept and vocabulary (this post)
- Other similar efforts, references
- 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)
- Improvements and future work
- Inception, where the idea is born
- Elaboration, where some plans are made and designs to prepare for the implementation
- Construction, where the actual programming is done, following the blueprints designed during elaboration
- Transition, where testing and improvements are done to finalise the implementation and prepare the production-ready 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):
- R0.1 - starting with a fixed 2D outline at the ground level, extrude vertical walls to form the geometry of one level only;
- R0.2 - improve R0.1 by applying a simple iterative algorithm to produce a more complex geometry of the building level, mostly suitable for the outline of the building's ground footprint-base;
- R0.3 - continue from R0.1 and apply a basic L-system: segment the façade in vertical and horizontal sections (like columns and rows) and texture with images coming from an atlas;
- R0.4 - improve R0.1 by producing a parametric outline based on an L-system
- R0.5 - extend the L-System to counter for multiple levels, and build the whole building geometry
- R0.6 - improve geometry with structural elements needed in order to render the building destroyable
- R0.7 - define building classes (types) and build rule sets for each one
- R0.8 - produce the interior of a level, mainly interior walls (and possibly doors and basic furniture)
- R0.9 - make overall improvements
- R1.0 - produce materials and textures for nightly lit buildings
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) |
- 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
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