Procedural Dungeons
| DISCLAIMER |
|---|
| The following features are only available in Mythic Dungeons 2.0 dev builds!! |
With Mythic Dungeons 2.0.0+, it is now possible to create procedurally generated dungeons. This article will explain how they work.
To make a procedural dungeon, create a new dungeon with the following command. /md create <your dungeon name> procedural
Watch the guide video here!
Rooms
Generated dungeons are created from a collection of admin-defined rooms. These rooms are like puzzle pieces, and are configured with connectors that link them up to other rooms. They must be built and configured in the dungeon editor.
Rooms have their own unique settings, such as a weight value to raise or lower the likelihood of the room being used, a minimum and maximum number of times the room will generate in the dungeon, and how deep into the dungeon it will generate. Learn more about rooms here!
Rooms are saved in a rooms folder inside your dungeon, and consist of a YAML file and a structure file.
Rooms belong to the dungeon they were built in. There is currently no way to reference a room from another dungeon.

Connectors
Rooms are configured with a set of connectors. These connectors are what the dungeon generator will use to attach rooms together, lining them up. Connectors MUST be placed at the edge of a room, but you can have as many as you want, including multiple connectors on the same side of the room. This is incredibly powerful for creating dungeons with multiple floors.
Connectors have options for what other rooms are allowed to connect to them, which can ALSO be further customized with a "weight" value to raise and lower the likelihood of a room being chosen at this connector.
Connector Doors
Connectors can further be customized with connector doors. These are groups of blocks that can be placed and removed by various dungeon functions and mechanics. This allows full control over progression through your dungeon's rooms. It also lets you create fancier-looking walls to block off connectors that don't have rooms on the other side of them!
NOTE: The "entrance" into a room will ALWAYS be left open. This is to create consistency with room doors. If you want to prevent players from advancing, you should close doors other than the entrance. Here's a visual to explain it.

Configuration
Generated dungeons come with a new generation.yml file that contains various settings on how the dungeon will be generated. This includes layout modes, which are generation style presets (such as Minecrafty vs branching), as well as options for those layouts. This file is also where you configure the minimum and maximum number of rooms.
Surrounding Block
The surrounding block in the generator config is the block that will surround your rooms. This is handy for quickly closing off connectors you don't want open with a solid block, and basically surrounds each room with a "box" of the specified block. It has to be a valid block material, or the generator warns and falls back to STONE.
Timeout and build height
Generation runs off the main thread, and the whole process is bounded by Generator.Timeout (in seconds, default 5) in Mythic Dungeons' own config.yml, not in generation.yml. A finished layout is also shifted vertically as a whole so that it lands inside the world's build height; a layout whose total top-to-bottom span is taller than the world's build range is thrown away and retried.
Branching Layout
A branch is a series of rooms generated linearly together, creating a linear path. Within a single branch, a room only uses two connectors, one to enter it and one to continue out of it. This layout generates a primary branch (lets call it the "trunk"), and then attempts to generate additional branches out of the unused connectors of rooms that are already placed, so a room can end up with more than two connectors in use once a branch sprouts from it. You can further customize branching behavior by tweaking how many branches can generate, how many rooms each branch can have, and what rooms a branch is allowed to use.
In this example, the stonebrick rooms make up the trunk, and the deepslate brick rooms make up a branch.

In the below example, you can see a dungeon with no branches. Note that there are no rooms with more than two connectors in use.

Straightness
Straightness is a property of branches that lets you determine how likely the rooms will generate in a straight line. If this value is set to 1.0 (100%), it will try to always generate rooms in a straight line unless it encounters a room without any valid connectors for a straight path.
In the below example, you can see that the dungeon generates in a perfectly straight line until it encounters the red bend room.

Branch Rules
Rooms with only one connector are only ever placed at the end of a branch, since they cannot be built through. Give a room at least two connectors if you want it to appear in the middle of a path.
Minecrafty Layout
Minecrafty layouts generate dungeons in a similar way to Minecraft's Strongholds. This generation tends to be much more chaotic and is easy to get lost in. For every connector in a room, the generator will try to generate a room connected to it. When using this layout mode, connectors have a "chance" option that decides how likely they will generate a new room. (Default is 50%.)

Additional Notes
- Rooms generate rotated in one of four orientations (0, 90, 180 and 270 degrees). There is no mirroring.
- Blocks, biomes and builder-placed entities inside the room bounds are all captured and replayed on generation.
- Dungeon functions are stored inside rooms instead of a
functions.yml. - All dungeon functions are fully supported, and are preserved when generating a room.
- Procedural dungeons cannot use a lobby; it is force-disabled.
- A dungeon needs at least two rooms with connectors before it can generate anything. A room with no connectors logs a warning, since nothing can ever be attached to it, though it can still be picked as the starting room.
- A room never generates directly next to another copy of itself unless the connector it would attach through has that room in its own Allowed Rooms list.
- Use
/md testdoor <door name>and/md testalldoorsinside a running dungeon to test connector doors.