mwg API
    Preparing search index...

    Interface DungeonOptions

    Rooms joined by corridors.

    Written here rather than taken from rot.js for one reason: the seed. mwg's generator is the framework's own, so a seed produces the same dungeon on every machine and can be saved with the game. Borrowing a generator would mean borrowing its RNG too, and then two independent streams decide what the level looks like.

    The rooms are kept on the level afterwards, because everything else a game wants to do (put the stairs far from the entrance, spawn a monster where the player is not, place treasure in a dead end) is a question about rooms, not about cells.

    interface DungeonOptions {
        builders?: readonly RoomBuilder[];
        extraCorridors?: number;
        floor?: number;
        height: number;
        hooks?: DungeonGenerationHooks;
        kinds?: TerrainKind[];
        maxRoomSize?: number;
        minRoomSize?: number;
        rooms?: number;
        wall?: number;
        width: number;
    }
    Index
    builders?: readonly RoomBuilder[]

    Room interiors to compose the floor from, picked per room by weight and size fit.

    Omit it and every room is a plain filled rectangle, exactly as before builders existed; a room no listed builder fits falls back to that same plain rectangle rather than being left as solid rock, since it has already been placed and joined by a corridor.

    extraCorridors?: number

    How often an extra corridor joins two rooms that are already connected.

    At 0 the dungeon is a tree: exactly one route between any two rooms, which reads as a maze and makes retreating impossible. A few loops is what makes a level feel like a place rather than a puzzle.

    floor?: number
    height: number

    Regional generation callbacks, fired as the pipeline reaches each stage - the seam a game hangs hand-placed rooms, branch entrances, wells, plants, statues, chasms, doors and traps from, without forking the generator itself. mwg calls these; it never decides what a game does inside one.

    kinds?: TerrainKind[]

    extra terrain kinds beyond wall/floor, appended after them - a game's own trap or door ids

    maxRoomSize?: number
    minRoomSize?: number
    rooms?: number

    how many rooms to attempt; fewer will be placed if they do not fit

    wall?: number

    the terrain ids to write; both must exist in the kinds passed to the Level

    width: number