fix(client): address PR #54 review — 7 items across Hoshe and Tyre
Critical: DIALOGUE_MAX_WIDTH 1200 → 640 to match D-076 spec. tile_renderer: clarify z = server floor level, not scene z_index. Add z-filter unit test (tiles at z!=0 must be skipped). Camera test: is_equal → distance check for float safety, convergence test frames 40 → 120 for robustness at lower smoothing speeds. Teleport: remove redundant first snap in _teleport_transition (the camera block in _process handles it via _teleport_in_progress flag). entity_renderer: document y-sort bottom-anchor migration path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ const TILE_SIZE: int = Constants.TILE_SIZE
|
||||
const ENTITY_WIDTH: int = 24
|
||||
const ENTITY_HEIGHT: int = 32
|
||||
const ENTITY_OFFSET_X: float = (TILE_SIZE - ENTITY_WIDTH) / 2.0 # center horizontally
|
||||
const ENTITY_OFFSET_Y: float = (TILE_SIZE - ENTITY_HEIGHT) / 2.0 # center vertically (bottom-aligned for y-sort would use TILE_SIZE - ENTITY_HEIGHT, but center is correct for placeholder)
|
||||
const ENTITY_OFFSET_Y: float = (TILE_SIZE - ENTITY_HEIGHT) / 2.0 # center vertically for placeholder. Migration: when real sprites land, switch to bottom-anchor (TILE_SIZE - ENTITY_HEIGHT) for correct y-sort ordering.
|
||||
|
||||
# Lerp speed — framerate-independent exponential smoothing.
|
||||
# At 12.0: ~70% there after 0.1s, ~95% after 0.25s.
|
||||
|
||||
@@ -64,8 +64,10 @@ func _setup_tileset() -> void:
|
||||
|
||||
# Update tiles from snapshot data
|
||||
# tiles: Array of {x: int, y: int, z: int, type: String}
|
||||
# Only renders z=0 tiles (ground floor). z=1 (FloorObjects) and z>1 (upper floors)
|
||||
# are handled by separate nodes — skipped here until those layers are implemented.
|
||||
# z here is the server-side FLOOR LEVEL (0 = ground, 1 = first floor, etc.),
|
||||
# NOT the Godot scene z_index (which controls render order within a floor).
|
||||
# This node only renders floor-level 0. Higher floor levels will be handled
|
||||
# by separate TileMapLayer nodes when multi-floor rendering is implemented.
|
||||
func update_tiles(tiles: Array) -> void:
|
||||
if not _initialized:
|
||||
return
|
||||
@@ -76,8 +78,8 @@ func update_tiles(tiles: Array) -> void:
|
||||
if not tile_data.has("x") or not tile_data.has("y") or not tile_data.has("type"):
|
||||
continue
|
||||
|
||||
# Multi-layer support: FloorTiles only renders z=0 (ground floor).
|
||||
# z=1 → FloorObjects node, z=2 → YSortGroup furniture (future layers).
|
||||
# Floor-level filter: only render tiles at floor level 0 (ground).
|
||||
# Floor level 1+ tiles are for upper floors (future multi-floor nodes).
|
||||
var tile_z: int = tile_data.get("z", 0)
|
||||
if tile_z != 0:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user