Debug scatter command to prove navigation in the real scene #95
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#95
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?
Part of milestone #4. Depends on #80. Replaces #81.
Milestone #4 needs a proof that navigation works in the real game, not a control scheme. #81 proposed right-click move orders for that, but its own body conceded the point: direct move orders are not a shipping feature. Building the input arbitration, the selection highlight and a red-flash tween for a mechanic that gets deleted is a poor trade.
tools/probe_pawn_terrace.gd(#80) already settled the part that was genuinely in doubt — the pawn rides terraces rather than cutting through them, and A* routes over a one-level riser. What it deliberately does not exercise is everything abovePawnView:Pawns.move_to()— the facade that callsfind_path(), flipsstatetoMOVINGand syncscell/statefrom the view's signals. The probe callsview.follow()directly.set_process(false)and hand-stepped deltas.Pawnsas a parent that is not at the origin.find_path()returning empty.A debug scatter command covers all four for a fraction of the work, and builds nothing that has to be torn out later.
Design
GameState.debug_modeis on, alongside the existingsystem_debugtoggle ingame.gd. No selection, no picker, no dependency on #78.IDLINGgetsPawns.move_to(id, map.random_walkable_position(rng)). Pawns already moving are left alone, so the command is safe to spam.random_walkable_position()draws from_main_region, so destinations are reachable by construction and the happy path is deterministic-ish. Unreachability is therefore not proven by this command; see below.id, from cell, to cell, whethermove_toreturned false) so a failure is legible without a UI.PawnView, keeping the view ignorant of pathfinding — the same separation #81 called for and #75 will rely on.Not in scope
move_to()already returnsfalse, and the print above is enough until something real needs to surface it.AC
statereadsMOVINGwhile walking and returns toIDLINGon arrival, and itscelltracks the walk rather than updating only at the end — visible in the debug panel.Note on unreachable destinations
random_walkable_position()only returns tiles on the main landmass, so this command cannot produce an empty path. Thefind_path()-returns-empty branch ofPawns.move_to()stays covered by unit tests only. That is a deliberate gap: forcing it in-game means either a separate island or a destination beyonddestination_snap_radius, and neither is worth a bespoke debug affordance. Worth revisiting if #83 (re-path when a building cuts a path) makes blocked routes common.liamjd referenced this issue2026-09-13 17:53:11 +01:00