A look at the new Procedural Dungeon Generator
Added 2021-02-21 16:43:35 +0000 UTCWhile I still haven't figured out where to take the main story next, I've been working on overhauling the old procedural dungeon generator. The old one tried to assign a coordinate system and then placing the assets itself. The new one will use "set pieces" where you create dungeon template rooms, with placeholders for treasures, doors, and levers.

2 New asset types will be added to the devtools:
- DungeonTemplate
- DungeonRoom
DungeonTemplate will let you select any set pieces you want to use in your dungeon, and what encounters should be viable. Note that right now only one type of encounter will be selected for the dungeon. So the dungeon above can be either an ogre, tentacles, demon, or skeletal dungeon. This means that all encounters generated will stem from one of these. So you couldn't have a dungeon where some encounters are tentacle encounters, and some encounters are ogre encounters. However, you can create custom encounters where you fight a mix of ogres and tentacles in the same battle.

DungeonRooms are template rooms that are picked at random when the dungeon is generated.
In a room template, you'll place static props that will always occur in this room, such as shelves, barrels, tables etc. But you'll also place variable props like doors, treasures, and levers. These will be selected by the generator. You can add many locations if you want the spawn locations of these to be varied. Doors are automatically picked by their orientation. So in your room template you'll want at least:
- 4 NPC badges
- 2+ treasure dummies
- 4 doors (one rotated in each of the 4 directions.
- A ladder, and a trap door.
- 2+ levers
You can have as many room templates as you want in a dungeon, the more the merrier!
Here's an example of the room above where one door has been generated, one treasure, and two NPCs.

Before I can release these for public testing, I need to figure out a way to add these to the game.
Previously this was done through the bounty board in the port. But I think it could be fun to scatter these dungeons throughout the world and add random NPCs or bounty boards that can offer a different quest for the dungeon each playthrough.
Let me know your thoughts!