feat(m4): cap map images at Full HD and shrink on import (#85)

The owner fixed the map cap at 1920 px on the long side and 1080 px on the
short side (either orientation). fff-vtt import now shrinks a larger source
with ImageMagick Lanczos before tiling (alpha kept, proportions preserved,
no upscaling), prints `scaled WxH -> WxH`, and records the shrunk w/h; a
source at or below the cap is untouched, so the pixel-identity tests still
hold. A scene row already above the cap is not rewritten: the server logs
`map_above_cap` at startup and serve prints the re-import advice.

Docs: ADR-0023, DESIGN 3.3/5.3/8/11.1/13/14, TESTING 5.3/13, README,
HANDOFF-M4, client README. The M4 phone gate and the fogbench measurement
now use the Full HD maximum; the 16384 px / 262144-cell bench and test rows
stay as labelled server stress references. import-scale now proves a 16384²
input is shrunk to 1080x1080 (289 tiles at 64 px) quickly and bounded.

Part of #63, #85. #77 is blocked by this issue.
This commit is contained in:
2026-11-21 22:16:08 +01:00
parent 30b35592c7
commit 43947d1197
22 changed files with 515 additions and 193 deletions
+6 -8
View File
@@ -1,10 +1,8 @@
/home/davide/Projects/GDR/FFF_vtt-m76/server/worldmap.nim(18, 44) Warning: imported and not used: 'faults' [UnusedImport]
/home/davide/Projects/GDR/FFF_vtt-m76/server/vision.nim(31, 43) Warning: imported and not used: 'faults' [UnusedImport]
== M4 fog bench: 16384 px map, cell 32 (512x512 cells), 50 tokens, 4979 walls ==
server vision refresh, one player (1 polygon, radius 300, ~5k walls): n=500 avg=0.054ms worst=0.132ms
== M4 fog bench: Full HD map 1920x1080, cell 32 (60x34 cells), 50 tokens, 1875 walls ==
server vision refresh, one player (1 polygon, radius 300, 5k-wall generator clipped to the scene): n=500 avg=0.055ms worst=0.448ms
player egress frames with 50 visible tokens: 52 frames, "vision","explored","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token","token"
player egress pass, 50 visible tokens (fresh Known): n=300 avg=0.089ms worst=0.167ms
player egress pass, warm Known (no changes): n=2000 avg=0.094ms worst=0.261ms
explored snapshot size: 316 cells on the 16384 px map
TARGET move path: refresh + 50-token egress 0.143 ms vs <= 16.7 ms (one 60 fps frame): PASS
player egress pass, 50 visible tokens (fresh Known): n=300 avg=0.201ms worst=1.673ms
player egress pass, warm Known (no changes): n=2000 avg=0.187ms worst=2.278ms
explored snapshot size: 318 cells on the Full HD map
TARGET move path: refresh + 50-token egress 0.256 ms vs <= 16.7 ms (one 60 fps frame): PASS
(sink 20800)