the dungeon algorithm

This page is dedicated to a technical breakdown of the dungeon algorithm used in Pokémon Mystery Dungeon: Explorers of Sky. I highly recommend reading the Terminology section of the dungeon-mystery documentation first, as these terms will appear throughout this explanation. If you're familiar with the internals, this explanation is specifically within the GenerateFloor (NA: 0233A6D8) function and will not include a discussion of Fixed Rooms, only the general algorithm.

overview

The Explorers of Sky dungeon grid is a 56x32 map of squares, which we individually refer to as Tiles. Each tile has various characteristics, whether they be the type of terrain (floor, wall, water, etc.), the presence of an item, and state information such as being a tile within a monster house.

These tiles can then be organized into regions we call Grid Cells, a rectangular area with ownership of all of the Tiles contained within. Dungeons can be thought of as having a grid size; this refers to the dimensions of grid cells like 2x2, 3x4, and so on. These can range anywhere from a 1x1 (think a one room monster house) to at most 6x4.

links