More work on procedural placement of things this week, plus some refactor, although I was quite distracted by Diablo IV open beta during the weekend (good distraction!)

Altar areas

Altar area specification is rather simple. It's a small 9x9 empty area (blobby shape) with an altar in the middle, the occasional bones/blood and statues, placed in one of several patterns, around it. There's not much more to be said, and it works as intended! Later on, variations will be created, for abandoned altars, altars with a cult around, and so on.

Altar example 1
Altar example 1
Altar example 2
Altar example 2
Altar example 3
Altar example 3

Mines

One of the map archetypes that I want to have is mines. Precious metals are a thing in Sigil of Kings and can be used to improve a city's wealth and to construct equipment from them, with special properties. So, naturally, there should be mines and adventures related to mines. And what is a characteristic of a map in a mine? Mine cart rails of course! This was an excuse to write an algorithm to calculate the track tiles, which was not more complicated than using the walkable areas as a binary mask and run a skeletonization process. The final result was connected just along the diagonals and was a bit too excessive, so I had to make a few edits to make it a bit better looking. The result is not too bad I think! It's going to be more challenging to create the art for autotiled tracks, even if it's really 2 tiles (straight and 90 degree turn) with overlays/reflections/rotations.

Mines map
Mines map

Misc

  • I just found an excuse to use std::variant for generic dictionaries and I quite like it! Previously, prefab placement algorithms had custom state which was stored as a class hierarchy, but now the state data are just stored as a variant dictionary.
  • I've been doing a lot of thinking about how the prefab placement code can be used later on to augment existing placement algorithms with quest-specific information. I've settled currently that the placement element name (reminder: a procedural placement configuration generates a number of named elements, each specifying algorithm and properties) will be used as a lookup in C# to instantiate whatever it needs however it needs. For example, for some quest to slay the legendary beast "Blood Fang", I'll be instantiating a "Beast Cave" and I instantiate for the "beast" element the "Blood Fang" creature.