Repository navigation
Conversation
f72b395 to
23eb0d1
Compare
The Teleportation hub fill scatters 2-4 fixed-destination teleport traps across a room's whole floor. Because each destination is fixed at generation, an unlucky room can end up with traps on every tile in front of its only doorway, all teleporting to the far side of the level, leaving no trap-free way through the room. Level connectivity is built assuming every room is freely passable and is never rechecked after traps are placed, so this slips through. Place the traps on the room's interior only, never the perimeter "gutter" of floor tiles next to a wall. A clear gutter always leaves a trap-free walk around the room's edge between every door. The trap count is capped at the number of interior tiles, so small rooms place fewer traps and a room with no interior places none. Tested in a local wizard-mode build with THEMERMFILL forcing the hub onto every room: traps land only on interior tiles and every doorway stays walkable. Claude assisted with getting the selection-API Lua right.
23eb0d1 to
91797ec
Compare
|
I believe one can have this weaker set of constraints instead:
I think this works for non-rectangular rooms as well, with the modification that such rooms have more than four corners. |
|
interesting. yes, i think that as long as traps don't bisect a room in the wrong way it wouldn't cause this problem. But also I think: clustering the teleportation hubs in the center of the room "looks more intentional," which might be a nice effect. I imagine it might be the layout a dungeon architect might pick it if really designing a hub. |
|
A more general fix would be to avoid placing traps in themed rooms next to doors, as is the case in ordinary rooms. The reason this isn't done already is that whereas ordinary rooms wait to fill their contents until after doors and corridors generate in the level, themed rooms generate them immediately. Maybe some type of post-door-creation fixup where rooms are scanned for traps (and blocking terrain, like trees) orthogonally adjacent to a door, and thence shuffled off to some other available space in the room? Or make it so that the room filling functions get defined, but not actually executed, until after doors and corridors appear? |
A fix for #1640.
The Teleportation hub fill scatters 2-4 "fixed-destination" teleport traps across a room's whole floor. An unlucky room can end up with traps on every tile in front of its only doorway, all teleporting to the far side of the level, leaving no trap-free way through the room. (See #1640 for an example. Level connectivity is built assuming every room is freely passable, so a bad arrangement of fixed-teleport traps can make the level impassable.)
The change places the traps on the room's interior only, never the perimeter "gutter" of floor tiles next to a wall. A clear gutter always leaves a trap-free walk around the room's edge between every door. The trap count is capped at the number of interior tiles, so small rooms place fewer traps and a room with no interior places none.