Debug overlay: draw the paths of moving pawns #82

Closed
opened 2026-09-07 20:56:32 +01:00 by liamjd · 0 comments
Owner

Milestone: Pawns and pathfinding

Part of milestone #4. Depends on #80 and #95.

#95 (debug scatter) is what makes pawns move in-scene, so it has to land first or there is nothing to draw. It replaced #81, which was the original source of movement here.

When the debug panel is open, draw the remaining path of every moving pawn so navigation can be checked by eye. The existing DebugLayer is a CanvasLayer of labels; path lines are world geometry, so this is a separate node in the 3D scene toggled by the same GameState.debug_mode_changed signal.

Design:

  • A PathOverlay extends MeshInstance3D using an ImmediateMesh with an unshaded, no-depth-test material, redrawn each frame from Pawns.all() and each view's remaining_path().
  • Lines sit slightly above the terrain surface so they are not z-fought by the tiles; one colour per pawn or a single colour, either is fine.
  • Consumed waypoints drop off the line as the pawn passes them.
  • Hidden, and not redrawn, when debug mode is off.

AC:

  • Headed check: two pawns moving to different destinations show two distinct lines that shorten as they walk; toggling debug mode hides and shows them. Screenshot attached to the PR. #95's scatter command is the way to set this up.
Milestone: Pawns and pathfinding Part of milestone #4. Depends on #80 and #95. #95 (debug scatter) is what makes pawns move in-scene, so it has to land first or there is nothing to draw. It replaced #81, which was the original source of movement here. When the debug panel is open, draw the remaining path of every moving pawn so navigation can be checked by eye. The existing `DebugLayer` is a `CanvasLayer` of labels; path lines are world geometry, so this is a separate node in the 3D scene toggled by the same `GameState.debug_mode_changed` signal. Design: - A `PathOverlay extends MeshInstance3D` using an `ImmediateMesh` with an unshaded, no-depth-test material, redrawn each frame from `Pawns.all()` and each view's `remaining_path()`. - Lines sit slightly above the terrain surface so they are not z-fought by the tiles; one colour per pawn or a single colour, either is fine. - Consumed waypoints drop off the line as the pawn passes them. - Hidden, and not redrawn, when debug mode is off. AC: - Headed check: two pawns moving to different destinations show two distinct lines that shorten as they walk; toggling debug mode hides and shows them. Screenshot attached to the PR. #95's scatter command is the way to set this up.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder#82
No description provided.