Random_genesis

- Islamic architecture

The idea is to hierarchically construct buildings by instantiating pre-modelled, 3D pieces.
A Markov-chain-like grammar can be used to procedurally design a tree of objects, where the leaves are simple solid shapes.
Keeping the models as bare-bone as possible will allow the algorithm to scale in complexity, while simultaneously drastically reducing the costs of the modelling process.

I have chosen to look at islamic architecture for inspiration. I guess it looks more organic and less "planned" than other kinds of monumental art, so that even a randomised group of buildings will look alright.

Not a game, not a complicated algorithm, just a toy.

"Prototype" (May 2018)

>Previous update


It has been a while, but I managed to put toghether a working prototype. The complexes it generates are crude but sensible.
I followed a bottom-up approach, starting from individual, simple elements such as the parts of a column, and building up hierarchically more complex pieces up to entire buildings.
In the end most of the time and effort was spent modeling pieces in Blender and adjusting them to be instantiated dynamically. Not only the system has to define the number, position, and type of individual pieces procedurally, but also their proportions.

First, a dedicated component generates the layout of the individual buildings that will be part of the complex (see previous update), the output of this phase defines what kind of building goes where, and the main parameters of its generation.
Then each building is constructed hierarchically: a main empty GameObject instantiates other GameObjects following a tree-like pattern, in which the internal nodes are empty GOs with scripts attached, that follow simple markov chains to, in turn, instantiate more elements.
The leaves of the tree are of course actual 3D parts, instantiated with the appropriate position, rotation and scale.

For instance, the generation of a decoration at the top of a dome is launched by the instantiation of an empty GO, contaning a script with the simple markov chain shown here.
Each node in the chain corresponds, in this case, to the instantiation of a 3D element: a rod, an orb, or a crescent.


Some of these elements (in this case, the crescent) are picked from a pool of 3D assets. These randomised elements need to remain consistent among different buildings. To ensure this, a "lazy randomisation" system is used, via a singleton class that picks the asset at random when it is requested for the first time, and keeps it stored.
This way, for instance, different buildings will have columns and arches sharing the same style and proportions.

Each node of the chain either spawns an empty GO, or a "lazy random" 3D asset.
This causes the resulting architectural element to be dynamic in structure, shape, and proportions.
This decoration was generated by a random walk on the markov chain above on the path [R, O, O, O, C].


The final results are varied enough, while remainig sensible. The following GIF shows 80 finished complexes: they were not selected, modified or filtered in any way.


Although crude and lacking complexity, the prototype can generate some interesting designs.

In some cases the RNG makes it so that only a small number of buildings are generated, and if they are also small in size the complex ends up being very compact.
In some cases this feels very cramped,
like the case shown on the right of the picture.


I especially liked some minimalist designs like the one to the left of the picture, or the one currently used as logo of this website.

Of course the RNG can also cause the opposite extreme effect, where many, larger buildings are generated.

Here are shown two different outcomes: a very large, plain-looking succession of flat-roofed buildings and courtyards, and what is basically a bunch of domes clumped toghether in a big pile.
This last one has some
"Aghia Sophia flavour" to it.


The system is however definity still a prototype. The code is in dire need of cleaning and refactoring (and this is also why i'm not making it public as some have asked), especially those parts that have to do with the logic behind the tree of GameObjects need to be streamlined to make the addition of new architectural elements a simpler matter. However, this prototype has the value of showing that the approach currently being followed can prove effective in generating architecture, without the need for a set of complex, a-priori, rules.


Most of the architectural elements built by the prototype are currently too plain and uninteresting, such as the domed building shown here.
Streamlining the process of recursive instantiation of parts will make it possible to add much complexity.