Endless
The house of **Endless Nightmare**, as data. No geometry, no entities: `plan(floor, seed)` answers what is on a floor and `EndlessDirector` builds it.
game.house.Endless
The house of Endless Nightmare, as data. No geometry, no entities: plan(floor, seed) answers what is on a floor and EndlessDirector builds it.
local Endless = require("game.house.Endless")
local plan = Endless.plan(3, seed)
plan.cells -- every room on the floor, by key
plan.stairs -- the room that leads deeper
plan.difficulty -- from GameRules.endlessDifficultyFor(floor)
plan(floor, seed)— rooms, the doors between them, what each room is, where the supplies are, and which room is the way down. A pure function of (seed, floor), so two peers build the same house from two numbers and nobody sends a layout across the wire, and so a run can be repeated exactly.cellRect(gx, gz)— a room's interior rectangle in world space.cellAt(x, z)— which grid cell a world position is in.openingsFor(cell, rect)— the doorway each side of a cell needs, in the form the wall builder takes.ORIGIN— where the arena sits (2000 m out), well clear of the story house, so a run of one never stands inside the other. The systems slice moves the player here when a run starts.
Connectivity is by construction: a room is only ever added beside a room that already exists, and a loop is occasionally closed so the house can be circled rather than only retraced. There is no sealed pocket, no door that opens onto a wall, and no supply in an unreachable room — they cannot be generated.
Rooms are reusable shapes, not new geometry: a cell is a rectangle with a
doorway per neighbour, exactly the shape the twelve hand-built areas use, so the
generator and the story house cannot drift apart. There is no final floor;
plan answers for any number.
Scoped to this part · feeds back into the world's score.