M4: fog: explored bitmap, vision cut-out and player markers #70
Notifications
Due Date
No due date set.
Blocks
Depends on
#76 M4: finish — e2e audit, measurement and archive
SirStone/FFF_vtt_frozen
#64 M4: sector-limited circle-segment ray test
SirStone/FFF_vtt_frozen
#65 M4: session cache, explored bitmap and lock-free tile gate
SirStone/FFF_vtt_frozen
#69 M4: map tiles, grid and pan/zoom
SirStone/FFF_vtt_frozen
Reference: SirStone/FFF_vtt_frozen#70
Reference in New Issue
Block a user
Part of #63
Goal
Three-state fog from
explored+vision, updated only for new cells and new polygons; markers above fog; GM no fog.Acceptance criteria
deldevbox run testgreen on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at".User stories covered
Proven at
fog/marker layer, reducer fog slice; e2e
Notes
Implemented on main (
2d9548c).What landed
client/src/slices/fog.ts: pure fog slice forexplored(full RLE + cell diffs),visionpolygons andmarkerset/del;helloresets it with every other slice.client/src/render/modules/fog.ts: one cell-resolution RGBA canvas holds explored (never-seen alpha 1.0, explored 0.6); the sprite texture is that canvas with the vision polygon union cut out viadestination-out(recomposed only on explored/vision frames). Cell diffs mutate only the new bytes and upload the dirty rect. Markers are sprites above the fog; GM hides the layer.Mechanism note — spec #63 decision 9 leaves the Pixi object to the build. A Graphics stencil mask was measured first and cost ~350 ms of the phone-class viewport-fill budget on the e2e's software renderer (fill 1049 ms vs 665 ms pre-fog), so the cut-out is baked into the fog canvas instead (fill 574–695 ms, at/below the pre-fog baseline). Edge granularity is the cell grid the server already uses.
Perf (e2e emulation: 412x869, dpr 2.625, 4x CPU, 4096 px map = 16 384 cells, 50 tokens)
Gates (sequential, green on the pushed commit)
devbox run test: 159/159devbox run client-test: 148/148devbox run e2e: 22/22