Birdoggydog's Builds

Keeping furniture ways clear of the meat on the walls

The last failing dungeon walk turned out to be the test's fault, but it led to measuring furniture ways from the meat's face instead of the wall.

The last of the six failing generated-dungeon walks was the cold store, and I’d blamed the wrong thing. It wasn’t the meat. The test’s walker was walking straight into a pocket between crates. The furniture dresser now keeps its ways clear from the meat’s face anyway, and that moves almost nothing.

27 seconds in the cold store. The party crawls out of a duct, the crates ahead are too close to the meat to pass, and the party walks west round them to the far door.
Eight first-person frames of a vat room covered in red meat on the walls and ceiling. The party leaves a duct, faces a pocket between crates and meat, walks west around the crates and goes through a door.

The film’s frames in order, with the captions it was recorded with.

Why did the cold store walk fail?

Last time I reverted my first fix, which treated all grown meat as rock. It passed the walk but cut one floor’s furniture from 488 pieces to 306. This time I looked at the failing square first. The party comes out of a flat duct into the vat room and the walker headed north, middle of one square to the middle of the next. That led it into a gap of 0.87 m between the crates and the meat on the east wall. The party needs 0.8 m plus a 0.1 m margin, so it got stuck. A 1 m way ran west around the crates the whole time.

So the walker got fixed first. It remembers where the party stood before it stepped into the room. If no path out works, first with a way as wide as the party and then with a 1.5 m one, it walks back there and plans again. The second plan goes west around the crates, and the cold store walk passes.

How should furniture treat the meat?

I still had to decide what the dresser does with meat. On 18 October I decided it’s ok for one end of a tunnel to be blocked as long as other routes through the dungeon still work. For furniture, I think it’s fine to have the meat grow clipped over it so it looks like it grew over the top. Otherwise the furniture ends up in weird positions in the room that don’t make sense.

That became two things. The first is a check over 37 crawl mouths. A mouth shut by furniture or meat is allowed only where every room is still reached another way. Right now none are shut off from a room.

The second is how the dresser measures ways. It lays furniture on a fine grid of cells, and it already kept a way as wide as the party between the pieces and the wall, measured to the wall’s face. Now it asks the meat code how far the growth on each wall of a square stands into it, rounds that up to whole cells and marks those cells. No body stands on a marked cell, so the ways are as wide as promised from the meat’s face. A piece can still stand there with its back to the wall, and the meat grows over it. Only free-standing furniture that would narrow the way slides off.

I measured a few candidates on the Breakout Site’s first floor, which has 53 rooms:

Way the dresser treats meatPiecesResult
Ignore it48853 rooms
Measure ways from the meat’s face48853 rooms
Treat meat as rock30670 bare rooms in the themes test
One cell of meat at 0.4 m47246 thin rooms

One cell at 0.8 m, and ways only, changed nothing. I kept measuring from the face.

How much furniture moves?

I counted it so I’d know. On the Breakout Site’s first floor, 3 of 488 pieces moved: baskets and a painting. Across the 15 floors of generated dungeons, 348 of about 12,936 pieces (2.7%) shift, in 37 meat rooms. Pieces against a wall went from 168 to 169, and pieces out in the room stayed at 41. The usual change is a cutting-room table sliding 0.5 m off a meat wall. The cold store’s vat room keeps all 62 of its pieces.

The worker’s subset of 35 tests passed. A flag, keep_from_meat, turns the new measuring off so tests can compare against the old layout. Four older dungeons still carry a crawl step that nothing checks, and I’ve filed that.