Debug overlay: draw the paths of moving pawns #97
No reviewers
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder!97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "82-debug-path-overlay"
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?
Closes #82
Adds
DebugPathOverlay: aMeshInstance3DbesidePawnsingame.tscnthat rebuilds anImmediateMesheach frame from everyMOVINGpawn'sremaining_path(), toggled byGameState.debug_mode_changedalongside the existingDebugLayer.Ribbons, not lines
The issue proposed
PRIMITIVE_LINES. That turned out to be unusable: Godot 4 exposes no width for 3D line primitives, so a path is one physical pixel at any zoom and is all but invisible under an orthographic camera. Each segment is now two triangles, its corners pushed half a width perpendicular to the direction of travel — in the ground plane only, so the ribbon climbs a terrace without banking over on the step. Width is a ratio oftile_size(path_width_ratio, default0.08), following the same reasoning asPlacementController's arrow.Two smaller decisions worth flagging:
PawnViewfloats its origin half a body up so the capsule sits on the terrain, while waypoints sit on the surface; mixing the two conventions ramps the first quad down from the pawn's middle while the rest lie flat.surface_end()errors if no vertices were added, and every segment can be skipped whenmove_to()resolves to the tile the pawn already stands on — reachable viadebug_scatter_pawns, sincerandom_walkable_position()can return the pawn's own cell.Verification
Headed capture via
tools/screenshot_path_overlay.gd(screenshots attached). Three frames: trails at full length, the same trails after ~4s of walking, and debug mode off.One surface per moving pawn and none for the idle one; waypoint counts falling as they walk; the toggle stopping both drawing and processing.
surfacesstaying at 2 after the toggle is the distinction the issue asked for — hidden and not redrawn, rather than cleared.GUT suite green: 342 passing, 1 pre-existing pending, unchanged from baseline. The overlay itself has no unit coverage — it is render-only, and
gl_compatibilitydraws nothing headless.Deletes
tools/probe_pawn_terrace.gdIt has been dead since #95 put
pawn_view.gdonGameClock, and nothing reported it. A-sscript is compiled before the autoloads are registered, so itsvar _view: PawnViewforcedpawn_view.gdto compile too early and fail onIdentifier not found: GameClock. It then fails soft: the script stays broken, the probe spawns a scriptless node, and it produces a plausible but wrong image rather than stopping. It was markedTHROWAWAY - delete after useand #80 is closed.The new capture script sidesteps the same trap by naming no project types at all — documented in its header and now in CLAUDE.md, since the existing note framed this as a
get_node()lookup workaround rather than a compile-order failure. Worth knowing that a green suite cannot catch this class of breakage: GUT's runner never names a project type, so it is structurally immune.Caveats and things left undone
no_depth_test = truemeans there is no depth comparison to lose, so it makes no visible difference today. It becomes load-bearing if depth testing is ever turned back on.no_depth_testdraws paths over everything, hills and buildings included. Right for a debug overlay, but it means the overlay cannot be used to judge occlusion — only route shape. Worth revisiting once buildings sit on these routes.game.gd::_reset_stub_pawns()seeds its ownRandomNumberGenerator.new()from entropy, so the routes differ between runs.wincredoverride had never been applied here, which is why pushing hit the #1408 OAuth failure again.🤖 Generated with Claude Code
https://claude.ai/code/session_01H1i49KZ7HMn2uFk3PdTsav