Entrance arrow sinks below the water on a submerged doorstep #132
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?
The entrance arrow drawn during building placement sinks below the water when the doorstep cell is submerged.
Cause
PlacementControllerpositions the arrow withmap.cell_to_world(doorstep_cell), andcell_to_world()useslevel_at(), which for a water tile is the seabed._paint_cells()draws water at the datum, so the arrow ends up under the visible surface by however deep the seabed is.#46 (PR #131) added
TerrainGrid.drawn_level_at()for exactly this and moved the tile highlight and ghost height onto it. The arrow was left out because it goes throughcell_to_world(), which has other callers.Why not just change
cell_to_world()Its other callers mostly want the terrain itself, not the visible surface:
find_path()andrandom_walkable_position()interrain_grid.gd, pluspawns.gd:205: pawn movement. Water is unwalkable, so these never see a water cell today, but changing them should be a deliberate choice rather than a side effect.BuildingSite(building_site.gd:31), toast camera targets (toast_message.gd) andtools/screenshot_entrance_arrow.gd.Changing
cell_to_world()might turn out to be correct, since its doc comment says "sitting exactly on its top face", and for water the visible top face is the datum. But that decision should cover every caller, not just be made for the sake of the arrow.Options
PlacementController, keep X/Z fromcell_to_world()and take Y fromsurface_y(drawn_level_at(doorstep_cell))(converted to global). Mirror the change intools/screenshot_entrance_arrow.gd.cell_to_world()usedrawn_level_at()and review every caller above.level_at()stays the query for terrain reasoning.Acceptance criteria
arrow_hover_heightabove the visible water surface.cell_to_world()over a forced-submerged cell, using the_levelstechnique fromtest_terrain_drawn_level.gd.