Manor Works: manorKit, Multi-Floor Haunted Manor Builder with Styles, Decay, Stairs, Furniture, Hiding Places and Light Fittings
- ..
- .metadata17 B
- Creak.component
- Knockable.component
- Mansion.component
- Piece.component
- README.md40.3 KB
- api.module
- build.module
- decays.module
- finish.shader
- finishes.module
- fittings.module
- furniture.module
- gallery.scene
- guides
- layout.module
- manorKit.guide
- manorKitTests.testSuite
- package.yaml2.2 KB
- plans.module
- rooms.module
- stairs.module
- styles.module
- textures
README.md
manorKit
Version 1.1.3 (Manor.VERSION). Formerly named mansionKit (same package guid, renamed in 1.1.0; see "Upgrading from 1.0").
Build a big, multi-floor haunted manor from data, for any multiplayer Zero world: a cellar, a ground floor, an upper floor and an attic joined by real stairs, every room furnished by its type and every surface wearing a real-scale textured finish, with hiding places, flickering light fittings, doors that open and lock, creaky floorboards and knockable vases that guards and monsters hear, a nav map over every floor, baked global illumination on request, and anchors that tell your game where to put the spawn, the exits, the loot, the guard routes, the notes, the scares, the ghost's lair and the checkpoints.
local Manor = require("manorKit.api") -- `Mansion` is the same table: Manor.Mansion == Manor
Every big choice is one field:
style: eight architectures (Gothic Revival, Georgian, Tudor timber-framed, Art Deco, Victorian Italianate, Baroque, Palladian, Nordic timber manor). Each changes the wall panelling and mouldings, windows, doors, stairs and balusters, floors, the palette, the exterior, the roof pitch, the textured finishes and the furniture (leg turning, ornament, woods, fabrics; the nordic manor has tiled stoves for fireplaces).decay: five states: pristine, worn, abandoned (dust sheets, cobwebs, peeling paper, stray candles), ruined (holes in walls, ceilings and floors, rubble, broken furniture, fallen beams, boarded and shattered windows), storm (shattered windows, branches blown in, a fallen beam, rain puddles, torn sodden paper, tarpaulins, the power out, floors wet and glossy).stairs: the main staircase kind:straight,lTurn(quarter landing),uReturn(half landing, dog-leg),spiral,imperial(grand double). Each plan has its own default.finish:textured(default: world-scale PBR boards, flags, plaster, damask, brick, velvet ... tinted by the palette, aged by the decay) orflat(the colour-only look of 1.0).plan:cottage(6 rooms, a test house on four floors),manor(25 rooms on four floors),hall(29 rooms on an H-plan with corridors and a conservatory),seed(a house generated fromseed), or a plan table of your own.seed: furnishing, decay and generated plans; the same seed gives the same house on every peer.
Everything is modelled in code with quick geometry: 70 pieces of furniture (four-posters, wardrobes, armoires, grand and upright pianos, grandfather clocks, fireplaces by style, a tiled stove, a pipe organ, pews, clawfoot baths, wine racks, a coal boiler, a rocking horse, a doll's house, suits of armour, dressmaker's dummies ...) plus 5 pieces of decay dressing (rubble, fallen beam, storm branch, puddle, tarpaulin), 22 room types, 9 light fittings, 11 hiding kinds, 5 staircase kinds, 37 finish slots drawn from 24 texture sets.
A walkable gallery scene ships in the package (manorKit.gallery): every style, decay, staircase kind, room type, furniture piece, hiding kind and light fitting, labelled.
Upgrading from 1.0
The package keeps its guid, so an install updates in place; only names change:
| 1.0 | 1.1 and later |
|---|---|
the old .api require (and .styles, .decays, .rooms, .furniture, .fittings, .plans, .layout, .build) | require("manorKit.api") (and the same module names under manorKit.) |
components Mansion, Creak, Knockable under the old prefix | manorKit.Mansion, manorKit.Creak, manorKit.Knockable |
| the old install folder | manorKit.package |
Every function keeps its name and arguments (build, layout, nightLighting, noise, anchors, bakeNav, ...); the table answers as Manor and Mansion alike. A house built with the same options lays out the same (the new decay and stairs dice are drawn only by the storm decay and non-straight stairs); it now wears textured finishes unless finish = "flat".
Install
Search ZeroMind for manorKit and install manorKit.package, or in the engine shell zero zeromind installAsset <manorKit package guid>. The install brings what it builds on:
| package | version | what manorKit uses it for |
|---|---|---|
| concealKit | 1.2.9 | hiding places (HidingSpot): wardrobe, under the bed, curtains, chests, the cupboard under the stairs, the clock case, the dumbwaiter, dust sheets, the fireplace |
| eerieLightsKit | 1.0.6 | every light fitting runs a LightBehavior (candle, fireplace, swinging bulb, brownout, lightning); circuits are floor names |
| interactKit | 1.6.8 | doors (Door: hinged, double, secret bookcase), key locks on the doors a plan marks locked |
| navKit | 1.5.9 | the multi-level nav map over every floor, plus a stairs link per stair |
| aiKit | 1.4.0 | creaks and smashes are AI.noises every aiKit brain (guards, monsters) hears |
First example
In a scene's scenes/main.scene/build.luau (a new world's scene already has a ground, light and player; this puts the house beside them):
local Manor = require("manorKit.api")
function content()
Manor.build({ plan = "manor", style = "gothic", decay = "abandoned", seed = 1, origin = { 0, 0, 30 } })
end
Save: the scene keeps the house's doors, hiding spots, knockable props, lights, creaky boards and ground colliders, and the house itself stands as the scene loads (in the editor too). Press play and walk in through the front door. Change style = "gothic" to "artDeco", or decay = "abandoned" to "ruined", and save: the whole house changes.
For a night look in a demo scene, add Manor.nightLighting() (a low blue moon that casts shadows through the windows, a near-black ambient and fixed exposure) and use a first-person camera with environment = "isolated". Your game usually brings its own scene setup.
The component, no code
Put manorKit.Mansion on any entity (inspector or entity.component.add("manorKit.Mansion", { plan = "cottage", style = "tudor" })). The house stands with its origin at the entity; switching plan, style, decay or seed in the inspector rebuilds it. In play every peer builds the same house from the fields and the entity's owner spawns the shared parts (doors, hiding spots, knockables). Manor.build in build.luau is the steadier choice for a multiplayer game because the shared parts are then part of the scene.
Build options
Manor.build(opts) (and the component's fields of the same names):
| option | default | meaning |
|---|---|---|
plan | "manor" | "cottage", "manor", "hall", "seed", a name added with Manor.definePlan, or a plan table |
style | "gothic" | see Styles; aliases tudor/timberFramed, artDeco/deco, victorian/italianate |
decay | "abandoned" | see Decay |
stairs | the plan's | the main staircase kind: straight, lTurn, uReturn, spiral, imperial (see Stairs) |
stairsAll | false | apply stairs to every stair, not only the main one |
finish | "textured" | "textured" or "flat" (see Finishes) |
seed | 1 | furnishing, decay and generated plans |
origin | {0,0,0} | world position of the plan's (0, 0, 0); the front faces -z |
name | "Mansion" | the root entity and the house's name in queries (filter.house) |
lights | true | light fittings |
shadows | "key" | which fittings cast live shadows: "key" (each room's main ceiling fixture, a chandelier or bare bulb; plus the moon), "all" (every fitting) or "none" (see Performance) |
doors | true | interactKit doors |
hiding | true | concealKit hiding spots |
creaks | true | creaky floorboard patches |
knockables | true | knockable vases, bottles, candlesticks |
nav | true | the navKit map (baked in play once the house stands) and stairs links |
navName | "default" | the navKit map name |
exterior | true | facade details, roof, porches, garden, fence, dead trees and graves |
lockDoors | true | key locks on doors the plan marks locked (the library's secret bookcase in the manor) |
lighting | none | "night" also adds Manor.nightLighting() |
moonWindows | 10 | how many windows get a moonlit spot light and a pool of light on the floor |
Returns { root, layout, counts = { doors, hides, lights, creaks, knocks }, name }.
Styles
| id | label | look |
|---|---|---|
gothic | Gothic Revival | lancet windows, dark carved oak to shoulder height, crimson and bottle-green damask, flagstone halls, spire newels, beamed ceilings |
georgian | Georgian | twelve-pane sashes, pale dado panelling, black and white marble hall, slim mahogany on tapered legs, brick facade with stone quoins |
tudor | Tudor (timber-framed) | black studs on white infill inside and out, leaded casements, wide elm boards, linenfold panelling, block-legged oak |
artDeco | Art Deco | stepped mouldings, brass inlay, terrazzo halls, parquet, porthole-and-bar windows, chrome canopy, black lacquer piano |
victorian | Victorian Italianate | round-headed sashes, patterned paper above a dado, deep cornices, encaustic tiles, button-back velvet, turned mahogany |
baroque | Baroque | gilded pilasters, round-arched windows, inlaid marble, red velvet and gold on cabriole legs, scrolled crests |
palladian | Palladian | Venetian (serliana) windows, pale stone and grey-green paint, full panelling, pedimented portico |
nordic | Nordic timber manor | falu-red round logs notched past the corners, white window frames, a steep (52°) dark board roof, scrubbed pine and wide weathered planks, painted grey-blue dado panelling, board-clad walls, linen and wool, a tall tiled stove (kakelugn) wherever another style has a fireplace (aliases scandinavian, log, stave) |
Manor.defineStyle(id, { base = "georgian", palette = { walls = {...} }, window = "arched", ... }) adds one; tables replace the base's, palette merges.
Decay
| id | what you see |
|---|---|
pristine | polished and lit, every chair in place |
worn | faded paper, a few cobwebs, some peeling strips, half the lamps never relit |
abandoned | dust sheets over most furniture (a sheeted sofa or piano is a hiding place), cobwebs in every corner, wallpaper peeling in strips, dust drifts, a few boarded windows, only stray candles burning |
ruined | holes through walls and ceilings, rotten holes in upper floors you can fall through, rubble, broken furniture, fallen beams, boarded and shattered windows, almost every light dead or sparking |
storm | the night after a gale: three windows in four shattered (some nailed over with a tarpaulin), branches blown in through the glass, a fallen beam here and there, rain puddles on the boards, wallpaper torn and sodden, tarpaulins over heaps, the floors wet and glossy, the power out (one light in ten), lights that do burn flickering (aliases stormDamaged, storm-damaged, gale, flooded) |
Manor.defineDecay(id, { base = "worn", sheets = 0.3, ... }) adds one (fields in decays.module).
Plans
| id | rooms | floors |
|---|---|---|
cottage | 6: coal cellar; kitchen, parlour; nursery, bedroom; attic | 4 |
manor | 25: wine cellar, boiler room, cellar passage, cold store; grand hall with the main stair, drawing room, music room, library (secret bookcase into the study), study, dining room, kitchen, scullery, pantry; gallery, master bedroom, bathroom, guest and blue bedrooms, nursery, servants' hall, chapel; attic landing, west attic, maids' rooms, lumber room | 4 |
hall | 29: an H-plan with corridors to both wings, a glass conservatory, chapel and long gallery, a library upstairs, three attics, a cellar under the kitchen wing | 4 |
seed | 18 or 26: 3 or 5 bays, a stair hall in the middle, front and back rows, a secret door when there are two bays a side | 4 |
Custom plans
A plan is a table; coordinates are metres in the house's frame (x east, z north, the front at the lowest z):
local myPlan = {
-- optional: floors = { { name = "cellar", level = -1, y = -3.0, h = 2.8 }, { name = "ground", level = 0, y = 0, h = 3.4 }, ... },
rooms = {
{ id = "hall", type = "foyer", floor = "ground", rect = { -4, 0, 4, 10 } },
{ id = "study", type = "study", floor = "ground", rect = { 4, 0, 10, 10 }, label = "Professor's study" },
{ id = "landing", type = "gallery", floor = "upper", rect = { -4, 0, 4, 10 } },
{ id = "bedroom", type = "masterBedroom", floor = "upper", rect = { 4, 0, 10, 10 } },
},
doors = {
{ "hall", "outside", side = "S", at = 0, kind = "front" }, -- side S/N/W/E, at = x (S/N) or z (W/E)
{ "hall", "study" }, -- in the middle of the wall they share
{ "landing", "bedroom", kind = "bookcase", locked = true }, -- kind: inner | double | front | servants | garden | bookcase
},
stairs = {
-- from a room on one floor to a room on the next: (x, z) is the foot, dir the way up, the stair runs rise/0.2 steps of 0.28 m
{ from = "hall", to = "landing", x = 0, z = 2.5, dir = "N", width = 1.8, main = true },
},
hatch = { room = "...", x = 0, z = 0 }, -- optional cellar hatch exit
dumbwaiter = { from = "kitchen", x = 0, z = 0 }, -- optional dumbwaiter hiding place
}
Manor.build({ plan = myPlan, style = "victorian" })
Rooms on a floor share walls where their rectangles touch; walls with nothing on the other side are outside walls and get windows. Leave 1 m clear at the foot and the head of each stair; main = true closes the stair's underside and puts the cupboard-under-the-stairs hiding place in it. A mistake is an error that names it. Manor.definePlan(name, plan) adds a plan by name; Manor.generatePlan(seed) returns a generated plan table to start from.
A stair in a plan may name its own kind = "uReturn"; a plan may name its main stair's default with stairsKind = "imperial".
Stairs
The main stair is built as one of five kinds, chosen by stairs = "<kind>" (on Manor.build or the manorKit.Mansion component), else the plan's stairsKind, else straight. Manor.stairKinds() lists them.
| kind | what it is | default for |
|---|---|---|
straight | one straight flight floor to floor | cottage, manor, seed |
lTurn | a flight to a square quarter landing, then a quarter turn and a second flight | |
uReturn | a flight to a half landing that runs across, and a second flight back beside the first (dog-leg) | |
spiral | wedge treads winding three quarters of a turn round a newel post inside a square well, with an outer handrail | |
imperial | a wide central flight to a half landing that splits into two flights returning up either side to the gallery | hall |
Each kind is fitted into the rooms it joins, mirrored when it only fits the other way, and falls back to a straight flight when it cannot fit (the layout's stair then carries wanted, the kind asked for). The stairwell is cut out of the floor above with a balustrade round it, open where each flight arrives; landings are floored, carpeted on a main stair and railed on their open sides. Players walk ramps and landing colliders (a spiral has a ramp per tread); Manor.bakeNav adds a navKit stairs link from the foot to every arrival (two for an imperial stair), so guards climb every kind. The cupboard-under-the-stairs hiding place sits under the first flight of every kind but the spiral.
Finishes
With finish = "textured" (the default) every surface slot gets a real-scale, world-projected (triplanar) PBR finish: the texture repeats every so many metres in world space, so a 17 cm board, a 70 cm flag or a 1 m damask repeat keeps its size on any wall or floor. The style palette tints it around the texture's own colour (so styles and decays still differ), each board or flag shows its own patch of the texture, boards turn their grain with their length, and the decay adds world-space grime stains, run-down streaks and settled dust on upward faces (a storm house also darkens and glosses its floors). Glass, metal, candles and cobwebs keep their own materials.
| slots | texture set (default) | from |
|---|---|---|
| floor boards, wide planks, parquet (herringbone sheet), flags, tiles, marble, terrazzo, grout | oak / weathered planks / walnut + herringbone parquet / limestone / cleft slate / white marble / polished granite / plaster | Heartwood (woodsMaterials), Bedrock (stoneMaterials), Brick and Mortar (masonryMaterials) |
| walls: plaster, wallpaper, panelling, brick, stone, boards; ceilings | plaster / manorKit damask / oak / running brick / ashlar / weathered planks / plaster | Brick and Mortar, manorKit, Heartwood, Bedrock |
| trim, mouldings, panels, beams, timber framing, stairs | oak (painted plaster for the painted styles) | Heartwood, Brick and Mortar |
| exterior wall, logs, trim, plinth, roof | ashlar, brick (Flemish), stucco, plaster, limestone, weathered planks / slate, clay pantiles | Bedrock, Brick and Mortar, Heartwood |
| furniture wood, upholstery, curtains, rugs and carpet, linen, leather, baize | walnut / mahogany / oak; velvet / silk / linen; cut-pile carpet; linen; worn leather; felt | Heartwood, Warp and Weft (fabricsMaterials) |
Manor.finishes(style?) lists the 37 slots with the set, tile size and source each uses for a style; Manor.defineFinishes(style, { wallPaper = "linen", floorBoards = { set = "walnutBoard", rough = 0.7 } }) changes them. The textures are the collections' own maps (albedo, normal, roughness/metal), none over 1024 px (512 px for most woods and fabrics, up to 1024 px for stone and masonry): one style loads 30-37 MB of GPU texture memory with mips (Manor.finishMemory(style); nordic 30, georgian 37), all eight together 42 MB, and the 24 texture sets the kit uses are 25 MB to download. Albedo is held in plausible ranges per slot (plaster and wallpaper never near-black) so baked light bounces visibly; darkness comes from the lighting. finish = "flat" gives the colour-only look of 1.0.
The textured surfaces stand as merged static Model meshes with a lightmap UV set (one per material per floor, chunked at 60 000 vertices), so they are lightmap receivers and occluders like any authored mesh. A scene's build.luau cannot capture runtime meshes and materials, so Manor.spawnFurniture there gives the flat look; place a manorKit.Piece instead (fields kind, style, decay, finish, collide), which builds its textured piece where it stands as the scene loads.
Baked lighting
The architecture is static and lightmappable, and the fittings are set up for a bake: steady fittings and the moon are mixed lights (their bounce is baked, their direct light and shadows stay live), fittings that flicker or start off are dynamic (they stay out of the bake, so eerieLightsKit can do what it likes with them).
-- once the house stands (in play, or in the editor after a build), on the peer that bakes:
local r = Manor.bakeLighting({ house = "Mansion" }) -- lightmaps + an irradiance probe volume + reflection probes
print(r.receivers, r.applied) -- Lightmap components in the house, and how many are applied
Manor.bakeLighting(opts?) wraps @builtin globalIllumination's baking.all over the house root (opts: house, scope ("scene" for the whole scene), resolution, samples, skipLightmaps, skipProbes, skipReflections). A large house's lightmap stage comes back as a background task; baking.status tells how far it is. Check a bake with Lightmap.isApplied on the receivers and a final-pass capture before and after (the lightmap capture pass is a debug view and is not the evidence).
Gallery
manorKit.gallery (open it from the scene list) is a walkable showroom: the eight styles as cottages with the five decays cycling, a two-storey pavilion per staircase kind, a row of every room type, and on the lawn every furniture piece (as manorKit.Pieces), a working hiding spot of every kind at the piece it rides, and every light fitting lit on its post, all labelled. Spawn at the west gate of the front row.
Room types
foyer, corridor, library, study, diningRoom, kitchen, scullery, pantry, drawingRoom, musicRoom, bedroom, masterBedroom, nursery, bathroom, gallery, chapel, conservatory, servantsQuarters, wineCellar, boilerRoom, attic, billiardRoom (aliases: hall, landing, cellar, parlour, larder ...). Manor.roomTypes() lists each with its furniture and lights; Manor.defineRoomType(id, { base = "study", items = { { kind = "desk" }, ... } }) adds one.
Furniture
Manor.furniture(filter?) lists the 69 pieces with their size, placement and what they offer: altar, armchair, armoire, barrel, bathtub, bed, bench, birdcage, blanketChest, boiler, bookcase, bureau, candleStand, cardTable, chair, chaiseLongue, chestOfDrawers, coalPile, coatStand, crate, crib, curtains, desk, diningTable, displayCabinet, displayCase, dollhouse, dressForm, dresser, dressingTable, dumbwaiter, fireplace, fourPoster, globe, gramophone, grandPiano, grandfatherClock, harp, ironBed, kitchenTable, lectern, mirror, nightstand, organ, painting, palm, pantryShelf, pedestal, pew, plant, portrait, range, rockingChair, rockingHorse, rug, safe, sideboard, sink, sofa, suitOfArmour, teaTable, toilet, trunk, uprightPiano, vase, wardrobe, washstand, wineRack, workbench (plus debris and fallenBeam for ruins).
Manor.spawnFurniture(kind, pos, yaw?, opts?) places one on its own (opts: style, decay, fabric hex, name, parent, collide). Manor.defineFurniture(kind, { label, w, d, h, place, tags, hide, anchor, build = function(c) ... return Group end }) adds one; the helpers in manorKit.furniture (box, put, legs4, legGeo, panel, crest ...) make your pieces match the style.
Hiding places
| kind | rides concealKit kind | where |
|---|---|---|
wardrobe | wardrobe | wardrobes and armoires |
underBed | crawlSpace | beds, four-posters, iron bedsteads |
curtain | curtain | curtains at windows |
chest | barrel | blanket chests and steamer trunks |
underStairs | wardrobe | the cupboard under the main stair |
clockCase | wardrobe | grandfather clocks |
dumbwaiter | wardrobe | the kitchen dumbwaiter |
dustSheet | foldingScreen | a sheeted sofa, piano, armchair or chaise (abandoned and ruined houses) |
fireplace | crawlSpace | fireplaces |
crates, barrel | crates, barrel | for your own placements |
They are concealKit HidingSpots with showModel = false (manorKit draws the furniture) and their own label and capacity, so they work with concealKit's hide-aware guards and need no extra setup on any peer. Manor.addHidingSpot(kind, pos, yaw?, opts?) adds one.
Light fittings
| kind | eerieLightsKit style (misbehaving) | |
|---|---|---|
chandelier | candle (brownout) | eight candles on a brass ring, casts shadows |
sconce | candle | wall bracket candle |
candelabra | candle | three branches on a table or a standing candle stand |
oilLamp | candle | brass font, glass chimney, shade |
gasLamp | steady (brownout) | wall pipe and frosted globe |
fireplaceGlow | fireplace | the fire in every fireplace and the kitchen range |
moonWindow | steady (lightning) | a cool spot leaning in through a window, with a pool of moonlight on the floor |
bareBulb | steady (swingingBulb) | cellars, kitchens, servants' rooms |
lantern | candle | hurricane lantern on a crate or hook |
The decay decides how many burn (most do not: darkness dominates) and how many misbehave. Every light is in eerieLightsKit groups mansion, its kind, its floor and its room, and on the circuit named after its floor: Lights.setGroup("mansion", "off"), Lights.circuit("upper", false), Lights.setState("Mansion_Light_3_chandelier", "flicker"). eerieLightsKit keeps only the nearest few shadow casters live. Manor.addLight(kind, pos, opts?) adds one (opts: yaw, on, misbehave, hang, standing, style, name).
Doors
interactKit Doors in every doorway (hinged, double for the front and garden doors, a secret bookcase where the plan says so), in the style's look. Doors with locked = true get a key Lock (lockDoors = false leaves them unlocked); place the key with Interact.spawnKey. Most interior doors start open, because aiKit guards walk the nav map and do not push doors. All synced: every player sees the same door.
Stealth: creaks and knocks
- Creaky floorboards (
manorKit.Creak): patches just inside doorways and across open floor, more as the house decays. Crossing one faster than aiKit'squietSpeedgroans and raisesAI.noise(pos, 7, player, "creak"). Walk slowly (or crouch) to cross quietly. Setrequire("aiKit.api").config.quietSpeed = 3in your entrypoint for the usual walk-quiet, run-loud rule. - Knockable props (
manorKit.Knockable): urns on stands, vases, bottles, candlesticks and jugs on tables and shelves. Brushing past one faster than 60 % ofquietSpeedtopples it for every player and raisesAI.noise(pos, 11, nil, "smash")where it lands. - Your own:
Manor.noise(pos, loudness, madeBy?, kind?).
Anchors
Manor.anchors(kind, filter?) answers a list of { kind, pos (vector), yaw, room, roomType, floor, level, tag, item?, points? }. filter is a string (a tag, floor, room id or room type) or { floor, level, room, roomType, tag, item, house }.
| kind | where | tags |
|---|---|---|
spawn | three spots outside on the drive, facing the front door | entrance |
exit, escape | outside each outside door, the cellar hatch, a climbable ground-floor window | frontDoor, servantsGate, gardenDoor, cellarHatch, window |
loot | display spots: tables and desks, sideboards, display cases, pedestals, safes, paintings on walls; safes behind study and bedroom portraits | surface, case, pedestal, safe, wall, wallSafe, display |
guardRoute | one closed patrol loop per floor through every room and doorway (points = list of vectors) | the floor name |
note | desks, bureaus, tables, nightstands, lecterns, bookcases for lore notes | the piece |
scare | the crib, rocking chair and horse, dummies, mirrors, the organ, the bath, room middles of scary rooms, stair heads | the piece, room, stairHead |
ghostLair | chapel altar, boiler, nursery, attics | the piece or room type |
checkpoint | per floor: inside the front door, the head of each stair, the foot of the cellar stair | the floor name |
hide, creak, knockable, door, stairs, room | every hiding spot, creak patch, knockable prop, door, stair foot and room middle | the kind |
Manor.rooms(filter?) lists rooms { id, type, label, floor, level, y, height, center, min, max, area, doors, windows }; Manor.roomAt(pos) and Manor.floorAt(pos) ("cellar", "ground", "upper", "attic" or "outside") answer where a position is. Manor.houses() lists the houses built on this peer, Manor.lights() their fittings.
API reference
local Manor = require("manorKit.api")
| call | does |
|---|---|
Manor.build(opts) | builds a house (see Build options); returns { root, layout, counts, name } |
Manor.layout(opts) | the house as plain data without building it |
Manor.styles(), decays(), stairKinds(), roomTypes(), furniture(filter?), hidingKinds(), lightKinds(), plans() | the catalogues (furniture({}) includes the decay dressing) |
Manor.finishes(style?), defineFinishes(style, overrides), finishMemory(style?) | the textured finishes per slot, changing them, their texture memory (MB) |
Manor.bakeLighting(opts?) | bakes lightmaps, a probe volume and reflection probes over the house (see Baked lighting); returns { result, receivers, applied } |
Manor.spawnFurniture(kind, pos, yaw?, opts?) | one piece of furniture as its own model; returns its entity |
Manor.addHidingSpot(kind, pos, yaw?, opts?) | a synced concealKit hiding spot; returns its entity |
Manor.addLight(kind, pos, opts?) | a light fitting (Light + LightBehavior + fixture); returns the light entity |
Manor.anchors(kind?, filter?) | anchors (see Anchors) |
Manor.rooms(filter?), roomAt(pos), floorAt(pos) | where things are |
Manor.bakeNav(house?) | (re)bakes the navKit map over the house and adds a stairs link per stair arrival |
Manor.noise(pos, loudness, madeBy?, kind?) | an aiKit noise |
Manor.nightLighting(opts?) | moon, ambient and exposure for a moonlit night (moon, ambient, exposure, parent) |
Manor.houses(), Manor.lights(house?) | what is built on this peer |
Manor.defineStyle, defineDecay, defineRoomType, defineFurniture, definePlan, generatePlan | extend the catalogues (on every peer, before the build) |
Manor.VERSION, Manor.COMPONENT, Manor.CREAK, Manor.KNOCKABLE | version and component names |
Components: manorKit.Mansion (plan, style, decay, stairs, finish, seed, lights, nav, exterior, night, lockDoors, houseName; built/origin* are set by Manor.build), manorKit.Piece (kind, style, decay, finish, collide: one furniture piece built textured where it stands), manorKit.Creak (sizeX, sizeZ, loudness, cooldown, sneakSpeed, active), manorKit.Knockable (kind, loudness, reach, bumpSpeed, floorY, resetAfter; synced fallen, fallYaw, fallenAt; methods knock(x, z), standUp()).
Multiplayer
- The house is the same on every peer. Its static geometry is not baked into the scene: the
Mansioncomponent builds it fromplan,style,decay,seedand the origin on every peer as the scene loads (the manor takes about half a second), so the scene stays small however big the house and every player stands in the same rooms. - Shared parts sync through their kits. Doors (interactKit), hiding spots (concealKit) and knockable props (manorKit, owner-decided
fallen) are synced entities. WithManor.buildthey are scene entities, owned by the room's first peer. Lights are each peer's own entities, kept in step by eerieLightsKit (state changes reach every peer). Creaks are heard by the brains wherever they run. - The nav map bakes on every peer once the house stands, like navKit's own NavMap.
Performance
The manor (25 rooms, ~300 pieces of furniture, 65 fittings, 29 doors, 48 hiding spots) draws as five quick-geometry models (one per floor, one outside) of instanced pieces. Measured in the demo world: about 17 ms a frame in the manor (p95 21 ms) in an editor client, and next to no manorKit script: one shared scan for every creak and knockable over a spatial grid, five times a second while no player is near a board or prop (about 0.01 ms a frame) and every frame only while one is (0.2-0.3 ms), the other instances asleep. eerieLightsKit keeps the nearest few shadow-casting lights live; most fittings are off. Use plan = "cottage" for small levels.
Shadowed lights. A shadow-casting point light re-renders a six-face cube shadow map every frame it is lit, so a view over many of them (a gallery overlooking the hall) pays for each. shadows = "key" (the default since 1.1.0) lets only each room's main ceiling fixture (its first chandelier or bare bulb) cast live shadows, plus the moon; sconces, candelabras, lamps, lanterns, fireplace glows and the moonlit-window spots do not (their soft light is in the baked GI when you call Manor.bakeLighting). Counted for the gothic manor plan (seed 1887, 70 fittings): 1.0.2 gave 17 fittings shadows (5 chandeliers, 9 bare bulbs, 3 fireplace glows); "key" gives 14, at most one per room; "all" gives 60 and "none" 0. Each fitting's range is also held to its room (half the room's diagonal + 2.5 m, at least 3 m, never above the fitting's own reach), so a chandelier no longer lights, or is culled against, half a floor. Use shadows = "none" on phones or when the game turns many fittings on at once.
Guides
Three guides ship in the package:
-
manorKit (
manorKit): how to use the kit, from one build call to stairs, finishes and a lighting bake. -
How to build a haunted mansion with rooms, furniture, hiding places and lights (
how-to-build-a-haunted-mansion-with-rooms-furniture-hiding-places-and-lights): every part of the kit and how to use it. -
Example: build a small haunted heist level with manorKit, heistKit and hauntKit (
example-build-a-small-haunted-heist-level-with-manorKit-heistKit-and-hauntKit): a small level from an empty world, placing loot, a ghost and the escape from the anchors.
Known limits
- The house is axis-aligned:
originmoves it, it does not turn. - aiKit guards walk the nav map and do not open doors; most interior doors start open. Closed doors do not stop a guard's path.
- Textured finishes are drawn on every peer at load as runtime meshes; a scene build (build.luau) keeps loose
Manor.spawnFurniturepieces flat (usemanorKit.Piece). - Stair links carry guards from the foot to each arrival in a straight line; on a turning stair a guard cuts across the landing.
- Rotten floor holes in
ruinedhouses are real: a player can fall to the floor below.
Version history
-
1.1.3: creaky boards and knockable props cost next to nothing while the player stands or sneaks beside them. In 1.1.2 the shared scan (
manorKit.Creakin the profiler) ran every frame whenever the player was within reach of any board or prop, reading every knockable's entity position through a fresh closure each frame (Wrenmoor Hall's dining room: 2.39 ms a frame, the top content component). Now knockable positions are read once when the grid is built (they never move; the grid is rebuilt when a board or prop is added or removed, and re-read every 10 s), the avatar is read without per-frame closures, and while the player's smoothed speed is at or below the lowest speed that can set anything off (each board's sneak speed, each prop's bump speed, defaultquietSpeedand 60 % of it) the scan skips its inner loop and looks again 0.1 s later, speed still measured from the last position. Measured in the gallery, standing on a board with 14 props in the scanned cells: 1.1.2 ran the full scan every frame at about 0.19 ms a call; 1.1.3 runs no full scan at all (0 in 12 s), only the 0.1 s speed check at about 0.10 ms a call, 8 a second. Same rules on every peer: a sneak stays quiet, a run creaks a board and topples a prop. A Knockable now marks the grid stale when it wakes. New test: a still player beside a board and a prop does no per-item work for 10 s of frames, a running one creaks the board and topples the prop. -
1.1.2: docs only. The heist example guide now uses hauntKit (
require("hauntKit.api"),Haunt.setup,Haunt.addLair,Haunt.spawn("widow", at, { route })) and is renamed toexample-build-a-small-haunted-heist-level-with-manorKit-heistKit-and-hauntKit; its heistKit step uses the current calls (Heist.addEscapeper exit anchor,Heist.addLoot({ kind, position, access })). No code changes. -
1.1.1:
Manor.bakeLightingcounts the house's lightmap receivers and the applied lightmaps through globalIllumination'sLightmap.isApplied(1.1.0 looked for aLightmapcomponent, which no engine registers, so it always answered 0 receivers). Nothing else changes. -
1.1.0: renamed to manorKit (same package guid, so installs update in place;
require("manorKit.api"), componentsmanorKit.Mansion/Creak/Knockable; every function keeps its name and the table answers asManorandMansion). Textured finishes: 37 surface slots (floors, walls, ceilings, trim, beams, stairs, carpet, exterior walls, logs, roof, furniture woods and fabrics) wear world-scale triplanar PBR finishes from Heartwood, Bedrock, Brick and Mortar and Warp and Weft (new dependencies) plus the kit's own damask, tinted by the palette and aged by the decay (grime, streaks, dust, wet floors);finish = "flat"keeps the 1.0 look; 30-37 MB of texture memory a style, 25 MB to download for all 24 sets. The textured surfaces are merged static Model meshes with lightmap UVs; steady fittings and the moon aremixedlights, flickering and failed fittingsdynamic; newManor.bakeLightingwraps globalIllumination'sbaking.all(lightmaps, probe volume, reflection probes). Nordic timber manor style (log walls notched past the corners, a 52° board roof, painted panelling, pine floors, the tiled stove that replaces the fireplace). Storm decay (shattered windows and tarpaulins, branches blown in, puddles, torn wallpaper, wet glossy floors, the power out). Staircase kinds with one setting,stairs = "straight" | "lTurn" | "uReturn" | "spiral" | "imperial", fitted to the plan, mirrored or falling back to straight, with landings, wells, railings, cupboard hiding place and a navKit stairs link per arrival; the hall's default is imperial.shadows = "key" | "all" | "none"(default"key": only each room's main ceiling fixture casts live shadows, 14 instead of 17 shadowed fittings in the gothic manor) and fitting ranges held to their room. NewmanorKit.Piececomponent,Manor.stairKinds,Manor.finishes/defineFinishes/finishMemory. A walkable gallery scene (manorKit.gallery) and the manorKit guide. Same options lay out the same house as 1.0.2 (Wrenmoor Hall's manor, gothic, abandoned, seed 1887 is unchanged). Tests for the rename, nordic, storm, every staircase kind built and nav-baked, the finishes and light mobility. Fixes #3. -
1.0.2: creaky boards and knockable props are cheap when nobody is near them. In 1.0.1 one leader instance scanned every creak and knockable on every frame (measured 0.4-0.7 ms of script a frame for 65 boards,
manorKit.Creak x65in the profiler, wherever the player was). Boards and props now sit in a 4 m spatial grid; the leader reads only the cells around this peer's player, a few times a second (every 0.2 s) while no board or prop is within reach + 2.5 m, and every frame only while one is. Every other instance sleeps for 30 s, and a leader that is removed wakes another to take over at once. Measured in the Manor Works demo (69 boards, 36 props): player away from boards about 0.1 ms a scan five times a second (about 0.01 ms a frame) and manorKit gone fromprofiler.hotspots; player standing on a board 0.2-0.3 ms a frame. Behaviour is unchanged: the same sneak, walk and run rules, the sameAI.noise(pos, 7, player, "creak")and smash noises, on every peer. New test: a board stays quiet for a sneak, creaks with its loudness when a player crosses it briskly, creaks again after its cooldown, and the scan asks to sleep while no player is near. Fixes #2. -
1.0.1: the optional kits (concealKit, interactKit, navKit, aiKit) are resolved lazily at the point of use and retried until one loads, caching only a success. In 1.0.0 they were required once at module load, so a transient failure (a cyclic require while aiKit was mid-load, in a world that installs manorKit beside stalkerKit) left the kit off for good: builds made 0 hiding places,
Manor.addHidingSpotraised "concealKit is not installed" andManor.bakeNavbaked no nav map, all silently. A kit still missing when a build or bake needs it now warns once, naming the kit and how many hiding places or doors were skipped (or that the nav map was not baked). New tests stub a failing first require and check that a later build makes its hiding places and doors,addHidingSpotworks and the nav map bakes. Fixes #1. -
1.0.0: first release. Seven styles, four decay states, three built-in plans plus seeded and custom plans, 22 room types, 69 pieces of furniture, 9 light fittings on eerieLightsKit, 11 hiding kinds on concealKit, interactKit doors with key locks and a secret bookcase, creaky boards and knockable props heard by aiKit, a navKit multi-level map with stairs links, anchors for spawn, exits, loot, guard routes, notes, scares, ghost lairs and checkpoints, two guides and a test suite. Built on concealKit 1.2.9, eerieLightsKit 1.0.6, interactKit 1.6.8, navKit 1.5.9 and aiKit 1.4.0.