#543 — Optimized zone_id extraction in game_state.gd from O(N) tile scan to O(1) dictionary lookup. Builds _tile_by_coord from member visible_tiles (covers both test-mode and live-server paths). 9 tests.
#540 — Migrated entity renderer from ColorRect placeholders to Sprite2D with D-019 angle sprites (-72.5deg from horizontal). self_modulate for D-033 relationship tinting, modulate.a reserved for D-015 peripheral dimming. 8-to-4 octant direction mapping, feet-anchored y-sort. 11 tests.
Build _tile_by_coord dictionary from member visible_tiles (covers both
test-mode "tiles" key and live-server "visible_tiles" key), then replace
the linear scan with a single dict lookup. Net-zero complexity: adds one
dict-set per tile in an existing iteration, removes the separate scan loop.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate entity rendering from ColorRect placeholders to Sprite2D with
rendered PNGs at -72.5° from horizontal. Key changes:
- Sprite2D.centered=false, scale=0.5 for 64px source → 32px runtime
- self_modulate for D-033 relationship tinting (modulate.a reserved
for D-015 peripheral dimming)
- 8-octant to 4-cardinal direction mapping for sprite selection
- Feet-anchored ENTITY_OFFSET_Y for correct y-sort with tilted sprites
- Facing indicator repositioned to sprite local center (32,32)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add push_error on null texture at create time, keep previous texture
on null at update time (entity stays visible mid-game). Add push_warning
on unrecognised octant in _octant_to_direction fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 tests covering _octant_to_direction (all 8 octants + 2 fallbacks)
and _entity_direction (NPC default south, player facing 3 cases).
Closes review warning on zero test coverage for direction system.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Sprint 16 client work: two tickets.
game_state.gdfrom O(N) tile scan to O(1) dictionary lookup. Builds_tile_by_coordfrom membervisible_tiles(covers both test-mode and live-server paths). 9 tests.self_modulatefor D-033 relationship tinting,modulate.areserved for D-015 peripheral dimming. 8-to-4 octant direction mapping, feet-anchored y-sort. 11 tests.Key Decisions
Test Plan
test_snapshot_zone_id.gd(S16-Z01–Z09) — zone_id lookup correctness including test-mode regression guardtest_sprite_integration.gd(S16-S01–S11) — footprint, z-sort, sprite assets, fog independencetest_color_shift.gdupdated for Sprite2D/self_modulate migrationPR #58 Review:
client→mainHoshe (Code Quality): REQUEST_CHANGES
entity_renderer.gd:156_load_sprite_texturecan returnnull— entity becomes invisible with no crash signal. Both call sites (112, 156) should guard against null.entity_renderer.gd:206-210_entity_direction+_octant_to_directionmatch table have zero test coverage.entity_renderer.gd:215-221_octant_to_directionfallback silently returns "south" — addpush_warningon default branch.game_state.gd:246-252visible_tilesscenario not tested (pre-existing quirk, higher exposure now).test_color_shift.gd:89-94test_snapshot_zone_id.gd:176-191test_sprite_integration.gd:8GDScripttype annotation.Tyre (Architecture): APPROVE
D-033/D-015 separation correct, D-066 footprint verified, z-sort correct, D-010/D-012 no violations.
entity_renderer.gd:227Texture2Dby direction string instead of callingload()on every direction change.game_state.gd:250-252_tile_by_coordwith# perfcomment for future profiling.entity_renderer.gd:206-210test_sprite_integration.gd:153-159Verdict: CHANGES REQUESTED
PR #58 Re-review:
client→mainHoshe (Code Quality): APPROVE
Both warnings resolved. Null-texture guard correctly split (push_error on create, keep previous on update). Direction mapping tests cover all 8 octants + fallbacks + NPC/player paths.
Tyre (Architecture): APPROVE
Fix commits clean. Null-guard asymmetry correct by design. No new architectural concerns.
Verdict: APPROVED
Pull request closed