Log inGet started
World

Fencing with Fences

Branchmain
Branchesmain
Commitc0197a6317

README.md

garden

The grounds the Hedgerow Assizes are fought in, and the boundary fence that is the health bar.

local Garden = require("garden")

Garden.build(style)      -- rebuild the static arena under "duel_arena"
Garden.fence(line)       -- rebuild the boundary under "duel_fence"
Garden.style()           -- the style standing in the world right now
Garden.styleLabel(name)  -- what a style's grounds are called
Garden.STYLES            -- { "assize", "pettifer", "wickham", "ashcombe" }

Styles

One rite, four grounds. assize is the neutral ground the game opens on; the other three are the neighbours'. Every style is the same ground plan wearing a different palette, skyline and furniture — the lawn, the piste, the gateways and the dark band a fencer's shoulders are read against never move.

stylegroundsreads as
assizethe neutral groundclipped topiary, urns, brick perimeter
pettiferLower Marsh Cottageblossom hedge, orchard, bee skeps, cottages beyond the gates
wickhamThe Limescool clipped yew, pennants, bollards and chain, poplars
ashcombeAshcombe Halldark ancient topiary and a peacock, stone terrace, the Hall at both ends

style is sticky. DuelMatch and GardenDressing both rebuild the arena with no argument, and a garden that reverted every restart would be no garden at all — so a name sets it and a later build() keeps it. An unknown name falls back to the standing style rather than erroring. To go back to the neutral ground, name it: Garden.build("assize").

The lawn is the score

Garden.fence(line) draws the ground the fence has taken as the history of the bout rather than as one pale rectangle:

  • everything more than four posts back is settled turf, mown and grown in;
  • the four most recent bays are laid one to a post and brighten toward the line;
  • every one of those posts still shows its spoil ring — earth turned when it went in, greening over with each bay it falls behind;
  • the leading edge is cut in three steps, because a lawn does not change hands along a ruler;
  • the paling stops 0.42 m short of the line so the boundary post stands clear of it, with the two fencers straddling it.

Rules this module keeps

  • Nothing it makes reaches scene.json. Every entity is setTemporary(true) on the line after it spawns; both builders despawn what they find first.
  • Flat things are shelved. Every horizontal surface has its own height in M.Y, 10 mm apart, and each is a 20 mm slab whose TOP sits on its shelf. Two flat slabs that overlap in depth z-fight, and a z-fight across a lawn reads as a diagonal seam drawn on the grass.
  • Nothing stands at fencer height inside the reading zone. Every prop a style adds is behind the mid hedge or beyond a gateway. The eye must find the gap between the two fencers before it finds anything else.
  • The garden has edges. A perimeter wall on the three open sides and a treeline beyond them, because without them the turf runs to the horizon in every direction and the walled garden is not walled.

Adding a style

Add an entry to STYLE and its name to M.STYLES. A style is a palette plus three functions — skyline, furniture and beyond — and nothing else in the module needs to know about it.