Procedural Prefab Generation part 5
More work on the native prefabs and overall plugin code, but back to content-creation mode, to test and extend the procedural prefab placement work.
Visualisation presets per zone
So far, for showing the native generator results from the native visualiser, I've been using some basic tileset with a grey floor and a grey wall. This is basic and functional, but does not help with identifying where one zone ends and another one begins, e.g. when does a forest change into a cavern or a dungeon. Forest to cavern is even harder as they would both use the same generator, parameterised differently. So, to make slightly prettier generator images and aid visualisation, I've added support for zone/room visualisation presets, which is a set of optional overrides for floor/wall/liquid/door tiles. If one is not specified, the parent one is used: E.g. a "wilderness lodge area" without wall/floor tiles specified would use the tiles of the zone it is spawned it, and that could be a forest, grassland, or whatever other preset I end up making.
Sparse feature placement
I have this system mentioned here to generate sparsely distributed entities such as treasure, encounters, lock/key puzzles etc. It would be nice if this is also included in the visualisation aids, so that I know what's going on while still in native plugin land. I remembered the HoMM 3 map editor and how it had some 3D-ish sphere-based icons that described the content, such as "Level 4 creature" so I did something similar: I found some sphere from wikipedia, made it purple to stick out like a sore thumb and wrote some scripts to auto-generate icons for things like "encounter", "treasure", "level entry" etc. It works fine!
I've also added some gui controls to interactively add/edit sparse feature placement in the maps, and this works like a charm too, for basic testing at least. All hail Dear ImGui, such a great tool.
Beast cave area
Having sparse features again functional and part of the native visualiser/editor, time to move on to create more prefab areas! The goal is to create several scenarios/areas, and through that exercise, identify how I need to extend the prefab placement generator to be able to generate far more areas. So after the "wilderness lodge", next to tackle is the "beast cave".
That is a very small cave map, that is littered with skulls, both outside and inside, and some beast-related encounter would be placed around there. This is comprised of 2 zone presets: an "inverted dungeon without rooms" which is my approach for an open area, and an embedded mini-cavern map. Both of these zones have prefab placement presets that distribute a number of floor decorations (bones) randomly. And that's it! Laziest map preset in existence. Here is an image, although JSON does not contain the encounter spawning information as I added that at runtime.
Bug Squashing
- I fixed last week's issue with missing prefab contents when placed in a dungeon.
- Also fixed a couple more bugs in the dungeon generator and expanded a bit the visualisation capabilities: the screenshot capturing granularity is now greater, so that we can see the state of the generator after each processing step more clearly.
- I fixed some badly written (and possibly buggy) code on determining if placing a blocking tile could potentially block passage, based on immediate neighbourhood.
Next week, prison time!