Wall wire format, schema and migration #49
Notifications
Due Date
No due date set.
Depends on
#44 Low walls: sight and movement
SirStone/FFF_vtt_frozen
#45 Thick walls: sight and movement
SirStone/FFF_vtt_frozen
#46 Secret and locked doors
SirStone/FFF_vtt_frozen
#47 Windows and one-way walls
SirStone/FFF_vtt_frozen
#48 Terrain walls
SirStone/FFF_vtt_frozen
#50 Door geometry: thick doors and door push
SirStone/FFF_vtt_frozen
Reference: SirStone/FFF_vtt_frozen#49
Reference in New Issue
Block a user
Part of #38
Question
What fields, units and defaults go on the wire and in the database, how are existing zero-width walls upgraded, and what changes in wall.add/wall.update/door.set?
Already fixed by 5.8 (#42) and 5.7 (#41) — do not re-decide
blocks_sight,blocks_movement,sight_dir(both|left|right),door,open,secret,locked: typed, validated fields with server-side defaults, not entries inflags.kindis not stored and not accepted as input; it is a derived read-only label on thewall/wallsframes (wall,door,secret_door,locked_door,terrain,one_way, elsecustom).wall.add/wall.updateaccept either apresetname or raw switches, never both;wall.updateis absolute, not additive;door.setis unchanged.open/secret/lockedrequiredoor; a secret door is closed and two-way; a non-door stores all three false.height,eye_height), not wall fields (5.7).Question (narrowed)
Columns on
wall, or one validated restrictions object: which and why? Exact field names and defaults on the wire. How do existing rows migrate (kind=wall|door,open, emptyflags-> the switch set, withdoor:truemeaning the door preset)? What does the M6 UVTT importer default to, given the format expresses only sight lines plusclosed(#40)? Doeswall.update'spresetgo through the same expand-and-validate path as raw switches?Input from #44 (DESIGN 5.9, decided)
gmprops the GM already receives. Decide whether the GM's numbers are computed server-side or in the client (M4) if any GM frame is needed.gmprops (5.7); see-over adds no wall field, so this card's field list is unchanged.Input from #47 (DESIGN 5.8, 5.10, decided)
window:preset:"window"expands toblocks_sight:false,blocks_movement:true,door:true,open:false,secret:false,locked:false(an opening see-through door). The fixed window is not a preset and needs no name: it storesblocks_sight:false,blocks_movement:true,door:falseand deriveskind:"terrain".kindlist is nowwall,door,secret_door,locked_door,terrain,one_way,window, elsecustom.sight_dirother than"both"requiresblocks_sight:true(invalidotherwise), in addition to the secret-door two-way rule.sight_dirwording is fixed:leftis the(-dy, dx)normal ofa -> band names the blind side;leftandrightboth deriveone_way.Input from #48 (DESIGN 5.8, 3.1, 10.3, decided 2026-11-16)
preset:"wall"|"door"|"window"|"one_way".secret_doorandlocked_doorare removed as wire preset names;secret/lockedare raw door switches (editor checkboxes). Thewindowpreset expands toblocks_sight:false, blocks_movement:true, door:true, open:false, sight_dir:"both", player_marker:true; the fixed window is the same switches withdoor:falseand has no preset name of its own.kindis by shape, not exact preset match:window(blocks_sight:false+blocks_movement:true, door either), elseone_way(blocks_sight:true,sight_dir != "both"), elsedoor(blocks_sight+blocks_movement+door), elsewall(blocks_sight+blocks_movement, no door,sight_dir:"both"), elsecustom.secret/lockednever change the label. A secret door still requiresopen:false,sight_dir:"both"and both block switches on (a secret window would show itself); a locked window is allowed.player_marker(bool, defaultfalse; thewindowpreset setstrue) and new optional GM-onlylabel(1..64 code points, the 6.5 text rule, absent/nullclears). Both are typed wall fields, never inflags, andwall.updatepatches them absolutely.marker(dotless server noun): it carries a player's marker — an anchor point and the player's opaque per-player marker id, nothing else (no kind, open/closed, direction, label, thickness, height, wall id or switch). Full set on connect/resync, diff afterwards, plus the removal spelling. This card decides the fields, the removal form, and the storage (persisted per player like explored; amarker_seen(player, wall)row is the suggested shape). Retract on GM wall remove,player_markeroff, wall no longer a window, or geometry change; a moved wall re-earns its marker only when re-seen. A new wall's marker is sent once any point of its visible extent enters a player's polygon (5.8).player_marker:falseand nolabel; they behave exactly as today and send no marker. No other migration change: windows and one-way still ride the switch fields.labelandplayer_markerjointools/leakcheck.nim'sBannedAlwayskey scan (WALLDATA); the marker gets theMARKER_EARLY/MARKER_EXTRA/MARKER_OFFfault classes and the independence rules of DESIGN 10.3.Open from #41: what height do existing tokens/characters get at migration (height is required)?
Input from #43 (prototype, pictures + findings) — suggestion passed on, this card owns the decision.
wall.*/door.set), then run the fan over that list. Filtering per query instead costs +0.15 ms per polygon at 5k walls — 2.8× the sparse baseline, ≈ 0.9 ms for a 6-token party, i.e. the whole per-move budget.blocks_sighton, open door off, one-way only for the blocked side;terrain(blocks_sight:false) costs literally zero geometry (identical polygon and explored set).Input from #50 (DESIGN 5.4, 5.5, 5.8, 5.10, decided 2026-11-17; commit
2a160fb)a,b,thicknessandpositionas any wall (5.10). A door stores no leaf geometry of its own, and opening/closing changes onlyopen. So this card's field list, payload shape, columns-vs-one-object choice and validation are untouched by doors.preset:"door"/"window"expand to the switch set as already fixed (#47/#48);thicknessandpositioncome from the GM/editor (last-used thickness, 5.10) and must not be implied or reset by a preset. Awall.addmay combine a preset with explicitthickness/position.thickness: 0, position: "center"(#45). That is also what makes an existing door's close push byte-for-byte identical to today's, so there is no door-specific migration and no door-specific default.wall.add/wall.updatepayload carries the thick body, and a GMdoor.seton it changes onlyopen.openitself; the push (#50) adds no intent and no field — it is the existing server-originated token position change.Push geometry, the zero-thickness regression gate and the four new mutations are in DESIGN 5.5 and 10.3, not this card's.
Resolved — DESIGN v0.29, commit
287859d(not pushed)Owner-fixed (2026-11-17):
heightis a proper typed wall field: metres, optional,> 0and<= 100, absent/null= full height; GM-only, carried on the GMwall/wallsframes, never on a player frame (BannedAlways). Resolves the 5.7/5.8/6.1/8 contradiction consistently: 5.7's "no dedicated column and no wire field" is narrowed with a dated tag to tokens and characters (they haveprops; a wall has none), 5.8's "no behaviour inflags" holds, and 6.1's frames gainheight.height: 1.8 minprops_gm, filled in code only when absent;eye_heightis not written, so #41's 93 % rule is unchanged. #41's deferred question is closed.thickness 0,position center,blocks_sight/blocks_movement1,sight_dir both,player_marker0,label/heightNULL,secret/locked0;kind='door'->door=1with the sameopen,kind='wall'->door=0. No real data exists pre-M4, so correctness = fixture/history hygiene + byte-identical behaviour gates (5.8 player frames, #50 zero-thickness push).Delegated picks (FIXED, owner-delegated):
scene,entitykeep interpreted data in columns;flags/props_*are for data the server never reads), CHECKs can reject an impossible switch set (open on a non-door, one-way window), andloadScenestays a typed row read with no second parse/validate path. 5.8's "one object" is the domain/wire object; the columns are its storage.Migrationentry gains adatahook (inside the step's transaction) for the height backfill; the legacykindcolumn is dropped by a table rebuild, sincekindbecomes an output-only derived label. Rebuild overALTER TABLE ... DROP COLUMNbecause the step must dropkindand add nine NOT NULL CHECKed columns atomically, and SQLite refuses to drop a column named in a CHECK.flagsstays, for non-behaviour data only; no switch or geometry lives there.wall.add/wall.updatetakethickness,position,height,labelpluspresetXOR raw switches. A preset replaces the whole switch set and never implies geometry; raw switches on update patch only what is present;height:null/label:nullclear;wall.updateremains absolute;door.setis unchanged; add, update and the M6 importer share one expand-and-validate path.protogoes to 2 with a 6.2 changelog line: an old client's{"kind":"door"}would otherwise be ignored and silently create a solid wall.walls/wall):id, a, b, thickness, position, height, kind, blocks_sight, blocks_movement, sight_dir, player_marker, door, open, secret, locked, label, flags;heightandlabelare always present (nullwhen unset);kindis derived only.marker:{full:bool, set:[{id, pos}], del:[id]}, theencounteredspelling.posis the drawn midpoint in integer px (rounded once);idis an opaque per-player 12-character string from the token alphabet (no counter column, no reuse question, never the wall id); the full set goes afterexploredin the 6.3 player order; the GM receives no marker frames (a player's markers are their own memory, like explored); emission requiresplayer_marker:trueand the wall derivingwindow; storage ismarker_seenwith cascade on the player and on the wall (composite FK), while the other retractions are a deliberate delete in the update path.label/heightNULL: both are written as SQL literals (NULLwhen absent) by one helper, because db_connector cannot bind NULL and neither''nor0is a legal value (so no sentinel, unlikeencountered.actual_name).sight_dir both,player_markerfalse, no label/height; a portal isdoor:true, open = not closed. Recorded in DESIGN 6.1/8; no ticket.BannedAlwaysgains every wall field name (thickness,position,height,blocks_sight,blocks_movement,sight_dir,player_marker,door,open,secret,locked,label);markerjoins the allowed server types; the marker oracle's shape is fixed. TheMARKER_*classes stay as recorded in #48.tests/tdb.nimLatestVersion 7 -> 8 and the step count;tools/persistence.test.mjsschema_version assertion plus a new schema-7 fixture; the listed server modules and test/fixture files in DESIGN 10.3.Docs: DESIGN.md v0.29 (§3.1, §4.4 step 8, 5.7, 5.8, 5.9, 5.10, 6.1, 6.2, 6.3, 8, 10.3, dated §14 entry), GLOSSARY.md (
Height,Wall,Player marker, newMarker id). Commit287859d.