GameRules
The constants and rules of **The House That Knows You** — the one module every part of the game reads, so two systems written in different sessions agree on what a room is called, how loud a sprint is, how long a torch battery lasts and which ending the player earned.
game.GameRules
The constants and rules of The House That Knows You — the one module every part of the game reads, so two systems written in different sessions agree on what a room is called, how loud a sprint is, how long a torch battery lasts and which ending the player earned.
It holds no behaviour and no entities: pure data plus a handful of pure functions. Require it and read it; never write to it.
local RULES = require("game.GameRules")
What is in it
ART_DIRECTION— the one sentence every generation prompt reuses word for word, andREFERENCES— the pictures the game is judged against.PALETTE— that sentence as numbers, for the interface and for materials.HOUSE— the wall height, the wall thickness, the doorway size, the room module, the storey height and the player's own dimensions. Every prop in the game is sized against these.AREAS/AREA_BY_ID— the twelve areas, each with its floor, its nominal centre on the ground plan and the item that unlocks it.OBJECTIVES— the twelve-step chain, in order, each naming the area it happens in and the item it needs.ITEMS,REQUIRED_CLUES,CLUE_COUNT_FOR_TRUTH— what can be picked up, and what the ending is decided on.ENDINGSandselectEnding(cluesFound, secretRoomOpened)— the three endings and the rule that picks one, stated once so the interface and the systems cannot disagree.SURVIVAL— speeds, stamina, health, torch battery, interaction ranges.DIFFICULTY— easy, normal, nightmare. These change the monster's persistence, reach and the supply density only; all three run the same monster logic.MONSTERSandMONSTER_STATES— THE RESIDENT and THE BROODMOTHER, and the states both run: patrol, investigate, chase, search, attack, recover.NOISE— the interface between what a player does and what a monster hears. A system emits a noise id; the monster AI turns it into a reach. Nothing else may write a raw radius.SPIDERS— the baby-spider event: five presses, six seconds, the slow-motion tutorial, the prompts, the damage.ENDLESS/endlessDifficultyFor(floor)— Endless Nightmare, and a floor number that never stops climbing.MODES,MAX_PLAYERS,DATA— the game modes and the keys shared state lives under.
Who calls it
Every slice: the house builder, both monsters, the survival systems, the interface and the audio director. Every component that runs in play reads its numbers from here rather than carrying its own copy.
Scoped to this part · feeds back into the world's score.