Birdoggydog's Builds

Keeping the rooms I draw and laying them again in generated floors

A store of the rooms drawn on the phone designer, a generator mode that lays them back, and one table of floor sizes.

The dungeon generator in Blobber can now lay rooms I drew myself. Every room I draw on the phone designer with a note naming its kind goes into a store, and when the generator wants a plain room of that kind it may use mine. This follows the generator’s first post, which grew floors round drawn squares.

44 seconds: the sheet I drew, the store’s two rooms, a second sheet written only in words, the floor with my rooms in amber, and the party walking into my vat hall in the game.

How does a drawn room get into the store?

The importer already defines a room as a rectangle of open squares of one height, and dungeon_rooms.py uses that same finder, so the store and the importer agree. A room’s kind is read from a note inside it that names one first (“LAB. …”); a room with no kind is skipped, because nothing would ever ask for it. Per room the store keeps its kind, size, tiles, heights and the things inside, with their positions. It leaves out doors, keys, the entrance, lifts, exits, covers and anything with lock or opens, since those tie the room to something elsewhere.

Only my own drawing is harvested: a described sheet, or one with no draftNote, no generator block and no thing marked by: "claude". A floor the generator drafted is never harvested. Harvesting a sheet again replaces its rooms, and the page round trip does it for each sheet just before it grows it.

python tools/dungeon_rooms.py harvest --sheet <file.json>
python tools/dungeon_rooms.py list

In the film the store ends up with two rooms, a VAT of 6 by 6 and a STORAGE of 5 by 4.

How does the generator lay a stored room?

The generator has a templates parameter with three values. rules is the library default and never uses the store. store is what the designer page uses: where the rules would lay a plain room (no role, not tall, no size asked) of a kind the store holds, a stored one goes in half the time (STORE_CHANCE = 0.5). always is set by the words “use my rooms”. A stored room is used at most once a floor, and a sheet never gets its own rooms back. When no stored room is left, no random number is drawn, so a floor made without a store comes out exactly as it did before.

A stored room becomes a normal room description carrying a template. sheet_draw.stamp() paints its squares over the room’s rectangle and sets its things down where I drew them, with its own note on a free square. The stocking pass then treats it like a pinned room: nothing of its own goes inside, and its things count against the floor’s budgets.

Eight film frames. Orange grids on a dark background show a drawn sheet and the store's two rooms, then a grey floor plan with two orange rooms laid in it, then first-person views of a grey metal hall holding two pale creatures.

Contact sheet of the film: the drawn sheet, the store, a sheet in words only, the floor with my rooms in amber, and the vat hall in the game.

Why did the size words need one table?

The page and the generator each had their own idea of what “large” meant. Both now read one table in dungeon_pins.py: small 3 to 7 rooms, medium 8 to 14, large 15 to 24, big 25 to 34, giant 35 to 50. “Tiny” reads as small and “huge” as giant. A word’s room count comes from size_in(name, seed), a uniform pick inside the band from random.Random seeded with the word and the sheet’s seed, so the same sheet always gets the same count.

One sheet cannot hold a giant floor. I tried 40 rooms on four seeds and none produced a floor, while 35 passed on every seed I tried. A count is capped at 35 (MOST_ON_A_SHEET) until floors can be split across sheets, which is filed as S1167.

What are the numbers?

The work was 19 files changed, 980 lines added and 35 removed. dungeon_rooms_test has 39 checks and none fail, and the other dungeon tool tests still pass.