Closing the dungeon generator's gaps, with galleries and sizes
The generator now writes a whole dungeon with a theme on every floor, stocks the room between floors, adds raised galleries and draws floors in five sizes.
The dungeon generator now writes a whole dungeon by itself. Every floor gets its own interior pieces and paint, the room dug between two floors is a stocked storage room, tall rooms can have a raised gallery, and floors come in five sizes from small to giant. This was the first of three things I wanted done before any more tour builds, and it closes five items on my work list.

The film’s 8 frames, in order, with captions.
Why did the generator have gaps?
Earlier workers had each left something alone and filed it. I said I’d wait on more tour builds until these were done, and that I wanted to see the result. The --content option wrote no light, meat or theme, and no writer gave floors 2 and on an interior or paint. The room dug between floors had no kind, so nothing was furnished or stocked in it. The generator only laid sunk rooms, with no gallery.
How does it write a whole dungeon?
dungeon_gen.make_whole() returns the extras, and both writers use it. A whole file has the light and meat lay, the light of each room, and with a theme other than house the keys theme, interior and paint. They are written on floor 1 and on every entry of floors, with no inheritance, so a floor that says nothing has nothing. The library’s default stays bare, so old calls return what they did, and --bare on the command line gives the old output.
The game was the other half. It only read an interior on floor 1, so a generated floor 2 stayed plain whatever the file said. Adding interior to the fields a floor may carry fixed that. The film opens on a steampunk floor 2 with its own pieces and painted walls.
How does the dug room get stocked?
It was already a bare 3 by 3 room with no kind. Now dungeon_jagged._dug_room() writes it into the file’s rooms as storage, and the stocking reads that kind’s row. A pack of monsters comes at the kind’s monster share, and a chest at its chest chance plus a small bonus, each on its own draw. The dresser furnishes it like any storage room, which is the room with shelves in the film.
How do galleries and heights by kind work?
A new module, tools/dungeon_gallery.py, runs after the flat ducts. A raised gallery is a ledge 3 m up in a tall room’s south-east corner, with a straight stair of two squares along the wall. It never takes the room’s north row or west column, so the room keeps the corner its kind is named at. The game cuts the ledge a room of its own, so the checks hold the room to what is left.
Heights by kind are a height field on each row of content/room_kinds.json. Vats and cells sink 1 m with the ways to them half a meter. Offices, security and grand rooms rise a step, and staging stays flat. Over 40 one-floor seeds the generator laid 10 galleries, sank 36 rooms by kind and raised 12. Over 20 three-floor seeds it laid 5, 19 and 12.
How do the five sizes work?
I’d said small should be at least 3 rooms, medium 8, large 15, big 25 and giant 35. dungeon_pins.SIZES is the one table, and the odds in 100 are the ones I gave.
| Size | Rooms | Odds |
|---|---|---|
| small | 3 to 7 | 30 |
| medium | 8 to 14 | 35 |
| large | 15 to 24 | 20 |
| big | 25 to 34 | 10 |
| giant | 35 to 50 | 5 |
The size can be a word, a number or “any”, and “any” draws one from the seed. A small floor cuts its cycle’s arcs to stay in its band. A one-floor giant was the hard case. I tried 35, 37, 39 and 41 rooms on one sheet over 8 seeds. 35 passed 7, 37 passed 5, 39 passed 2 and 41 passed 1. So a one-floor giant is capped at 35 rooms, and a larger draw spreads over floors. Over seeds 1 to 10, small, medium and large came out in their band 10 of 10, big 9 of 10 and giant 8 of 10.
I had to move one fixture. The jagged test dungeon was seed 7, but with heights by kind on, that seed’s floor 1 sinks rooms and no room between fits. It’s seed 5 now.
What’s still open?
The older rising rules still pick any room to sink or raise, including a flat kind, because making them read height changes every rising-on fixture. A corridor that climbs by a ramp still isn’t laid. The tour’s builder keeps its own copy of the theme looks and writes an interior on floor 1 only, so I’ll rebuild it on make_whole() when I next build the tour.
The game test for this passes 22 checks and the generator’s test passes all of its checks.