Finally, prefabs are working properly! Here are some examples:


In these examples, the layout is as follows:

  • Generate the outdoors area, depending on the biome
  • Generate the indoors area as a dungeon using a set of prefab rooms
  • Generate a boss area, which is a prefab zone

For the prefab rooms, I made a few quickly, but still they can demonstrate what’s possible. The rooms can use explicit tilesets or the “dungeon default” whatever that is. They support explicit placement of creatures, objects or decals/decoration (e.g. cobwebs or carpet). They might allow additional procedurally placed sparse features (encounters, objects) or not: for example in a pretty packed boss room, we might not want to randomly spawn a bookshelf. Same apply to “zones” (via sharing much of the code) which are larger versions of rooms and they can be instantiated only once in a level, for example 3 zones being “outdoors”, “dungeon” and “boss lair”. Some zone type that I still want to add is “open” zones, for example an outdoors clearing with some ruins, treasures and monsters, that is well integrated with the rest of the map.

Prefab rooms can be configured so some are rarer than others, and some can be spawned just once or multiple times in the same level. What’s not implemented yet is context-specific room choices: for example, if we have a “crypt” map of sorts, we want lots of grave-related areas and rooms, but we shouldn’t find those in a wizard’s tower. Next step is to add such info to zones/rooms so that the created maps look more cohesive and can showcase certain styles.

Here’s a video showing a dungeon run like the above, only problem is that I forgot the boss room door open and it was empty by the time I got there…