Tutorial:Creating Dungeons from Scratch: Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
No edit summary
Imbion (talk | contribs)
m Imbion moved page User:Imbion/Sandbox/How 2 Dungeon to Creating Dungeons from Scratch: Moving complete guide to its offical home
(No difference)

Revision as of 16:30, 8 August 2025

This article is a manual on how to create a dungeon with its appropriate generation steps from scratch, without using other dungeons as a template.

Notes About The Guide

If I do not include details about how to configure particular steps, assume that you are free to customize them based on what options you'd like for you dungeon. The specific steps are what is required as a baseline in order to configure everything with the default settings for PMDO. If you would like to learn more about the options available, please check out the pages on those steps.

Format Note: Most steps have priorities that they want set typically to certain values. I will be noting those priorities beside the step's name like [1], to avoid repetition.

Dungeon Initialization

In PMDO, all dungeons are defined as a Zone. Each Zone has its own configurations, which more information about can be found on their page.

Inside each zone, you can create a new segment. These segments are essentially different dungeons, with their own unique floor generation and rules.

To start creating your dungeon, go to segments and press add.

There's two main parts of the segment editor: Floors and Zone Steps'. Floors contain the generation parameters for each floors, while Zone Steps contain generation parameters for the entire segment. Let's start with configuring the Zone Steps.

Segment Zone Steps

Zone Steps are generation steps that we want to apply to all floors present inside the segment. This includes tasks that apply to all dungeons, and tasks that need to consider all floors in the segment to function.

For example, the step that is responsible for showing the floor name is found here, as in most cases the name is always shown in the same format. There is a way to put that step solely within the floor itself, but that leads to some problems - i.e. If I want to change the dungeon name, I have to change the name in ALL floors.

Most Zone Steps do similarly have floor step equivalents, but we put them as Zone Steps instead because it's easier to work with. If you would like to customize it by floor, that's possible by using their floor step equivalent; But that should not be used unless you have a specific reason to do so.

Essential Steps

The Show Floor Name [-6] zone step is responsible for doing the title drop of the floor name. You can put the name within the Name field, using the placeholder {0} for the floor number.

If you plan on allowing rescues in your dungeon, the Handle Rescues [2.1] step will be required.

Spawn Tables

We can add Money, Item, NPC, and Effect Tile spawn tables to Zone Steps. This is where all of the information about those things will be kept, which the Floor Steps will later reference.

The names of each spawn table are, respectively: Money Spawn Zone Step [1], Item Spawn Zone Step [1.1], Team Spawn Zone Step [1.2], and Tile Spawn Zone Step [1.3]. Each will allow you to add individual entries to them, giving them a weight that modifies their percent chance of spawning and a range of floors they can appear on.

Sanity Check: When editing the Team Spawn Zone Step, make sure you add a team size of at least 1 that covers all floors! If you don't, nothing will be able to spawn and you will have no idea why.

Spawn & Spread

Some features consider the entire segment. For example, in many longer dungeons, it's guaranteed that certain essential items like apples will spawn within a given range of floors. This is specifically to make sure that players who get unlucky and get no apple spawns can still complete the dungeon.

The step responsible for this, Spread Step Zone Step [6.1], can spread features across the dungeon in general. It can perform almost any floor step spread across the floors based on its spread plan.

Spreading Items

If we just want a certain item to appear like in those dungeons, you select the Spawn List for your Spawns. Then, you add the Random Spawn Step, specing the spawn as a Picker Spawner with args <List Map Gen Context, Map Item> to spawn an item. Then, adding to the To Spawn list, you select the Present Picker with args <Map Item> and pick the item you'd like to appear.

Finally, to spread it across floors, in Spread Plan, you select Spread Plan Spaced, giving it the range and spacing you'd like it to have.

Other Features

We can also allow other features to appear with spread steps. These are a little bit more advanced to configure, but the list of features includes: Monster Houses, Item Houses, Move Tutors, and Mysteriosity. For more information, see Spread Step Zone Step and Spread Houses.

Generation Type Dependant Steps

There are two primary floor generation methods that see the most use in PMDO: Grid Floor Gen and Room Floor Gen. This article will focus primarily on those methods. The steps required in each method are different - as such, when creating a floor, the first thing you should do is decide what generation method should be utilized by the floor.

Grid Floor Gen creates a more classic dungeon where rooms are kept in different cells, while Room Floor Gen instead generates its rooms and hallways from a starting point, disregarding any cell structure.

If you want a floor to be a specific map, Load Gen will be utilized instead.

Although more uncommon, Chance Floor Gen and Stairs Floor Gen are also present.

Note: Most fields for rooms and halls use the Spawn List<> type for their spawn tables.

Grid Floor Gen

Grid Floor Generation generates the dungeon using a grid based system, creating cells of a specified size and placing a grid of them with specified dimensions.

Initialization

Grids are initialized using Init Grid Plan Step [-5], where the inital dimensions of the grid are set up.

Room & Hall Generation

Once the grid is initialized, we must generate rooms on the floor with a grid path step [-4]. This is a family of different generation steps that will put the floor together in different ways. The most common path step is Grid Path Branch, which creates a "standard" dungeon of rooms generating in cells with halls connecting them. It should be noted that which grid path step you select modifies the character of your floor quite a bit, and as such you should consider which one to use carefully.

Modifying Rooms After Generation

Once everything has been generated, there are a few post generation changes we can force to happen.

Connect Grid Branch Step [-4.1] will connect adjacent rooms together with halls.

Combine Grid Room Step [-4.2] based on the parameters you give it will merge cells into one single room.

Set Grid Defaults Step [-4.3] transforms a random percentage of the rooms into "dummy" 1x1 hallways. These halls will still be connected to, but will have no rooms, resulting in creating these long hallways.

Completing Generation

After all of the other generation steps, we finalize the rooms based on all of our generation steps. This is done with the Draw Grid To Floor Step [-3].

Room Floor Gen

Room Floor Generation does not use a cell system, and instead merely generated the dungeon in the space it is given.

Initialization

The initial settings of this generation type are initalized using the Init Floor Plan Step [-3], which sets the dimensions of the floor.

Room & Hall Generation

Rooms and hallways are defined in the Floor Path Branch [-2] step. This determines each possible room and hall, and their chance of appearing.

Load Steps

Since we're loading a pre-existing map as the floor, there is only one step we need: The Mapped Room Step [-7]. This loads everything on that map into the floor.

Stairs Floor Steps

Stairs Floor Generation is usually not used in PMDO, since it's pretty hard to work with. I won't include much information about it here, since it's usecases are so uncommon.

Chance Floor Gen

Chance Floor Generation allows you to select a random, different generation schema that is selected based on a random chance. It can be used to make floors completely vary depending on chance. You simply add different floors and configure them like you would for any other floor.

Shared Steps For Grid & Room Gen

These steps are required for both Grid and Room gen.

We want to finalize our generated floor plans. We do this using Draw Floor To Tile Step [-1], which actually draws everything that has been generated to the floor. We also generate unbreakable tiles around the whole floor using Unbreakable Border Step [0.1].

Finally, we should make sure to place the start and end point down, so our player has somewhere to spawn and somewhere to exit. This is done with the Floor Stairs Step [2].

General Floor Steps

These steps are universal and not exclusive to certain generation types.

Essential Steps

The Map Data Step [-6] sets all of the basic data of the floor up. Note that the typical Time Limit is 15000 for most dungeons.

The Mob Spawn Settings Step [1.2] sets up basic settings for mob respawns. Note that the separate Priority field here should be set to 15. Then, you should select Respawn From Eligible Event in the Respawn field, configuring Max Foes and Respawn Time to your liking.

Post-Room Terrain Steps

These steps make additional modifications to the terrain.

Perlin Water Step [3] will spawn the specified terrain in valid areas (depending on its filters) using perlin noise, spreading it randomly.

Similarly, Blob Water Step [3] spawns the specified terrain in valid areas, but in the style of blobs.

Since perlin noise can be rather messy sometimes, there are a few steps that are used to clean it up. The Drop Diagonal Block Step [3.1] and Erase Isolated Step [3.2] are used to fill in adjacent diagonal tiles and remove isolated ones respectively.

Texture Steps

There are two different texturing steps that are available.

Map Texture Step [4] is for maps that only have floor, walls, and one other secondary tile.

Map Dict Texture Step [4] is for maps that have extra tiles, such as floors that have grass, or floors with lava and water.

Spawning Steps

Spawning steps may be used in a variety of ways. This section will include the methods that are standard across most dungeons.

Note that, unless specified otherwise, the Spawn field will be set as Context Spawner<,>. Then, you select the amount range of how much will spawn. This allows it to reference the tables we set up in the Zone Steps.

It is also typical to just add RoomFilterConnectivity: Main to the Filters, but this may change depending where you would like things to spawn.

Wonder Tiles

Wonder tiles are currently spawned in a bit of a unconventional way, as we don't want them to be included within the pool of traps.

Selecting the Spaced Room Spawn Step [5], choose the args <Map Gen Context, Effect Tile. Then, to spawn them, select the Picker Spawner<,>, with the Looped Rand picker and the Spawn List spawner. Add the Wonder Tile to this.

Finally, choose how many wonder tiles you'd like to spawn. In the Amount Spawner, select Rand Range and set the range to what you'd like the range of Wonder Tile amounts to be.

Traps

Traps are spawned using the Random Room Spawn Step [5]. Choose the args <Map Gen Context, Effect Tile. Set Success Percent to 100, so that way all the traps specified in the range will spawn.

Money

Money is typically spawned in dead end rooms, which uses the Terminal Spawn Step [6]. Set the args to <Map Gen Context, Money Spawn>.

Items

Items are set to spawn depending how far they are from the player's position by default. This is done with the Due Spawn Step (6.1). Set Success Percent to 25, which is the chance that items will be more likely to spawn depending on the distance from the player.

Initial Mob Spawning

We want the map to start with some mobs being spawned on it, using the Place Random Mobs Step [6.2]. Set Spawn to the Team Context Spawaner to use the tables, and then select the amount of mobs we'd like to spawn. Modify Clump Factor depending on how much you want mobs to clump - Smaller values means they spread out more evenly, while larger means they clump together more.

Other Steps

These are steps that are useful to know about for certain tasks, but not necessarily universal.

Default Map Status Step [-6] sets default weather in the dungeon.

Terrain Spawn Step [6.1] is often used to spawn items in certain tiles, such as tall grass or walls.

Detect Isolated Stairs Step [7] is a debug step, but is useful to remember to include as it'll notify you if your stairs ever end up isolated.