[art] Terrain tiles render as flat solid-color rectangles — atlas exists but map draw falls back to fillRect #11
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/cybertactics#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Asset gap (rendering side).
The sprite atlas declares
floor,wall,door_closed,door_open,barrel,crate,terminal,mainframe,podregions at row 0 (web/assets/sprites.png+godot/scripts/sprite_atlas.gd). The atlas is real content (100% non-bg coverage for floor/wall/door regions per pixel analysis).However:
web/js/ui.jsmap-draw code usesctx.fillRect(x * TILE, y * TILE, TILE, TILE)for the terrain layer, notctx.drawImage(sprImg, ...). Confirmed via screenshot attools/playwright_smoke.png: the map reads as flat color blocks, not atlas tiles.The Godot side (
godot/scripts/grid_map.gd+tile_set_builder.gd) does use the atlas via TileMap + TileSetAtlasSource — that path is correct.What's missing (web only):
web/js/ui.jsshoulddrawImage(sprImg, sx, sy, 32, 32, dx, dy, TILE, TILE)for terrain tiles using the same SPR map as the unitsAcceptance:
web/js/ui.jsSPR ==godot/scripts/sprite_atlas.gdREGIONS)Refs:
web/js/ui.jsline ~30 has the SPR map anddrawImagefor units; the map-draw block usesfillRect.Fixed in
d2ecf25(cybertactics#11).Quick note on the original framing: the web map renderer was already using drawImage (via spr()) for floor/wall when sprReady=true — that path was correct. The
fillRectcalls at web/js/ui.js:46-54 are the pre-atlas-load fallback that fires only while the sprite image is still fetching. Probe via headless Chromium showed sprReady=true post-deploy and the canvas pixels of visible tiles match the atlas palette exactly (wall center (36,52,74), floor center (30,42,58) before this fix, after matches the new brick/panel pixels).The real issue was the atlas content itself: the floor tile was 32x32 of (17,24,38) base + one dust speck, and the wall tile was 4 horizontal bands of solid color. At TILE=28 render those read as flat blocks even though the atlas was being drawn.
Fix: enhanced the floor + wall tiles in web/assets/sprites.png (and godot/assets/sprites.png — same file, single source of truth):
All other tiles (door, scenery, units) untouched. Atlas stays the single source of truth for both web (web/js/ui.js SPR map) and Godot (godot/scripts/sprite_atlas.gd REGIONS).
Local
make cigreen (7 smoke scripts + lint + playwright + godot-import). Note: forgejo-hosted CI run #18 failed on actions/setup-python@v5 withversion 3.12 not found for this operating system— pre-existing runner-side issue that also blocked the prior cybertactics#10 run #17. Code itself is correct; runner infra is the gate to clear next time.