As I have mentioned the technique for procedural generation is based on the paper
Procedural Modeling of Buildings and the very basics are nicely explained in the post on procworld so please have a look.
The key thoughts for our method, that are really important to grab before moving on, are top-down description of building structure and reusing of once defined elements.
The top-down descriptions means that you start the description from the most general object and you define complete structure by using special actions and other increasingly more specific objects. So to conclude top-down term is just the good old divide complex problems into simple ones.
For example if you wished to describe a simple tower-like structure (see the picture below)
you would say that the tower consists of a roof and the rest of the building - lets call it a tower body. Then you could say the roof is a cone and that tower body is a cylinder. VoilĂ ! We have a little ugly tower.
The top-down description of a simple tower.
Tower
├── TowerBody
│ └── cylinder
└── Roof
└── cone
The other essential thought is reusing. If you are describing a building you often find patterns - elements of a building that are not only common between different buildings, but they are often shared among different parts of the same building. Such pattern can be a brick wall - you describe the layout of bricks just once and reuse it many times for different structures. This complies the principle used in software engineering, Don't Repeat Yourself (DRY).
The tool that employs both top-down and reusing principles is called a formal grammar. Formal grammars are quite a topic in informatics and I won't try to go to any detail about it at least for now. I hope we can go with a simple notion that grammars are kind of rewriting system that basically consists of a set of objects and on operation defined on those objects - we'll call the operation a rule.
Now let's see some examples. There are 3 numbered grammar rules with translation for human beings:-) and just for curious ones the actual rules that were used for generation of the tower in the picture - just to outline some pesky implementation details.
- Tower -> split(TowerBody, Roof)
- "devide scope between tower body and roof"
- Rule('Tower', "split('Z', ['2','1'], ['TowerBody', 'Roof'])" )
- TowerBody ->cylinder
- "display TowerBody as cylinder".
- Rule('TowerBody', "I('ngon', {'n':12})")
- Roof -> cone
- "display Roof as cone"
- Rule('Roof', "I('cone', {'n':36})")
![]() |
| Tower |
I think it's enough for today. Next time we are going to have a closer look on how the implementation of grammar works.
![]() | |
| A bit more complex tower |






