Hierarchical Realms

Something did come of the musings I described in Continents, States, Towns, Tiles - a bigger, more full program. This is what it does.



Alright, so we get the usual landmasses and oceans known from any sort of Perlin terrain, though here rendered with hexagons just like Continents, States, Towns, Tiles. Much the same, these hexagons are randomized into regions, here drawn with a black border between them. However, within each region are subregions, and really each hexigon is a sub-sub-region. All these are connected the same way: Within a hierarchy.


First we see the hexagonal tiles highlighted, then how they are divided into counties, and finally how the counties are divided into kingdoms. Each county has a certain subset of hexagons inside it, and each kingdom has a certain subset of counties, and through inheritance, an even larger subset of hexagons.

For instance, we see that the Kingdom of Acerose is composed of the counties of Hirlfries, Oughedo, Blering, Gosteree, West Seaceside, and Aceside.

Wait... Aceside within Acerose... is this a coincidince, or?

Anyway, each of those counties are composed of an untold amount of unnamed tiles. I mean, giving each tile a name would just be too messy.

However, the Tile < County < Kingdom is just one out of several hierarchies - the so-called political hierarchy.



This animation shows three different mapmodes. The neon coloured one is the population overview, where dark means low population and bright means high population - the hue is again determined by the political realm.

Then there's terrain. The terrain crosses county borders and is not really part of any strict hierarchy. However, the terrain is divided into different climactic regions. Most of the above continent is warm and humid, but not all. For instance, the southern part of the above continent, around the kingdoms of Chakey, Murko and Jeganham, is quite cold. Meanwhile the south-eastern peninusla, taken up by the kingdom of Tringlehome, is not dominated by snow, but is instead arid.

Finally, culture and religion. This cultural hierarchy is rival to the Tiles < Counties < Kingdoms hierarchy. It instead goes Tiles < Counties (sort of) < Culture < Religion. The cultures mostly follow county borders, since counties historically are drawn around groups of people. However, people never stay put, meaning that the cultures kind of spread across borders messily. Finally, while Cultures are the same size as Kingdoms, Religions are even larger entities, binding together several different cultures into continent-sized families.


The names shown above are those of the Cultures, while the Religions can be guessed from the coloration. For instance, the pink cultures, such as Nayien, Deacese, etc., are all part of the same Religion.

Generally, Religions are huge - but not always. Just like there are small Kingdoms constituted of just one or two counties, there are also rare Religions made from just a few Cultures that each might be small, too.

Let's talk about the algorithm used to create groupings and how to achieve the above-described spread of sizes.


Organic Growth

Since this project the descendant of the Continents, States, Towns, Tiles, it is also a descendant of Organic Voronoi and its model of organic growth.

Organic Voronoi is my name for an algorithm that takes an empty grid, seeds some starting regions, and then lets them grow out through their neighbouring tiles, randomly, tile by tile, until they meet other regions.


As animated above, the growth is random and quite sporadic, leading to shapes that are completely opposite of the clean lines of the eponymous Voronoi diagrams. That is the goal - to create new, random shapes that are organic rather than geometric.

Until now, I have been experimenting with three settings for the algorithm, which influence the resultant shapes:

  1. Density of seeds. In the above, only three seeds are let to fill out the full area. Obviously, fewer seeds lead to larger regions - but less obviously, larger regions tend to lead to more consistent, round regions, since the influence of randomness is averaged out over distances.
  2. Size of the starting seed. In the above animation, the seeds are big, that is, seven hexes. Especially when the seed distance is short, this leads to more consistent, round regions.
  3. Timing of seeds. Above, all three seeds are placed at the beginning, which is also how Cozy Kingdoms was generated. However, an alternative is to let new seeds appear at any point of time, which is done in this project. This leads to more diverse sizes of regions.
The third setting also has a lot of different options for how and why new seeds are added. Since the numbers of tiles per region is pretty low in this project - the median for Counties is around 10 - a one-step algorithm was developed. 

Basically, all tiles are looped through just once in a random order without any prior seeding. If they have no filled in neighbours (as is the case in the beginning), they will spawn the seed of a new region. If they have any filled in neighbour, they will become part of that region. In this way, all tiles, after just one iteration, must be filled in, either by a neighbour or by their own seed.

One last "setting" of the algorithm has to do with the shape of tiles. The shape is arbitrary - all the algorithm requires is for each tile to have a list of its neighbours. This means that the regions of tiles themselves can be used as tiles for the next layer of the same algorithm. 

Thus tiles are regionalized into Counties, Counties are regionalized into Cultures and Cultures are regionalized into Religions, all by slight variations of the same algorithm. This is the raison d'être of the Hierarchical Realms - not just to show bright coloured landmasses against a sea, but a proof of concept of this tile-region-growth algorithm.

Even the terrain is just another layer of the same algorithm.


All that is done is to apply a blurring and mutations to the colours after the regions have been generated.


Naming of Regions

What a long blog post this has been. I just want to follow up on what I hinted at all the way up at the fifth paragraph: How the regions are named and how this plays into the hierarchical setup of the map.

The names are generated as described in Town Name Generation: Putting a mutated syllable together with a suffix to generate names such as Tollyham, Prellness, Tromeupborough, Troxwick and Bridevine. Compared to other name generation algorithms, this one makes neologistic names 90% of the time, as in, there is no such thing as a Tolly, a Prell, a Tromeup, a Trox or a Bride... Okay, Bride is the 10% where it actually generates a preexisting word.

In this project, two features have been added. The first in inheritance. There is a 80% chance that when a new super-region is created, such as a Kingdom, Culture or Religion, it inherits the mutated syllable from whichever tile it spawned in.

The next feature is type-specific suffixes. Tromeupborough is a fine name for a town, but it could never be the name for a country or a culture. Instead, the base syllable is inherited and put together with a new suffix.

Thus, cultures and religions might be named:
  • Tollyham > Tollylish culture > Tollyam religion
  • Prellness > Prellench culture > Prelldom religion
  • Tromeupborough > Tromeupch culture > Tromeupity religion
  • Troxwick > Troxman culutre > Troxaism religion
  • Bridevine > Brideian culture > Brideoism religion
  • Slavaville > Slavawegian culture > Slavao religion
  • Kushome > Kusenian culture > Kusa religion
  • Rerobourne > Reroien culture > Reroslim religion
  • Boyipford > Boyipcian culture > Boyip-theism religion
Now, remember each county does not have its own culture. Rather, a whole subcontinent might have a culture named after a small county nestled in the western mountains - or opposite, a county named after the culture of the whole.


Potential of the System

This project was inspired by grand strategy games such as Europa Universalis, and more specifically, by a dream I had of making my own procedural grand strategy game with internal politics as focus. Here, the quirky maps of culture might be important since there might be cultural minorities in your county vying for freedom from oppression by the majority culture, or vying from military support for your rival which instead has their culture as majority.

The division of Kingdoms into Counties also mirrors grand strategy games, as well as the feudal system. That the system reaches all the way down into the base tiles can allow for sub-county border changes after minor nonmilitary disputes are settled.

Basically, it's this whole barrel of dreams that basically will not be fulfilled right now. At least, the project is quite robust.

Comments