Flash a pawn red when its move command fails #102
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!102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "100-flash-pawn-on-failed-move"
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 #100, and finishes the half of #83's design that was left undone.What changed
PawnView.flash(colour, duration)— tints the capsule and fades it back overFLASH_DURATION(0.4s), then clears itself and emitsflash_finished.is_flashing()reports the state. A second flash while one is running restarts it rather than stacking a second tween on the same material.Pawns.move_to()flashes the view whenfind_path()comes back empty.tools/screenshot_pawn_flash.gd— the headed probe.Two decisions worth reviewing
The flash lives in
move_to(), not inrepath_pawns(). The ticket asked for a call at each failing caller. One rule inmove_to()'s empty-path branch covers the sealed re-path, a direct unreachable command, and whatever #78's picker ends up calling, without any of them having to remember. The earlierreturn falses are deliberately left silent: they are programming errors or a registry with no views, where there is no view to flash.The tint is a
material_override.pawn.tscn'sCapsuleMeshand itsStandardMaterial3Dare sub-resources shared by every instance of the scene, so tinting throughmesh.materialwould flash every pawn on the map.test_a_flash_leaves_the_shared_mesh_material_alonepins that, and the probe checks it on screen.The
Tweenalso makes the flash wall-clock without opting out of anything, which is what the ticket wanted: a pause freezes the walk, not the feedback.test_a_flash_runs_while_the_game_clock_is_pausedcovers it.Verification
Full GUT suite: 395 passing, 1 pre-existing pending (
test_what_a_cancelled_child_should_do_to_its_parent_is_undecided, tracked as #85). No orphans.Eight new tests — six in
test_pawn_view.gdfor the flash itself, two intest_pawn_repath.gdfor the trigger:flash_finishedonceGameClockis pausedHeaded probe, all checks passed on the real
game.tscn:Caveat on the design, not the code
Red on an already-red pawn is weak feedback. The pawn's normal albedo is a terracotta
(0.70, 0.33, 0.25); the flash is(0.90, 0.15, 0.15). Side by side intmp/pawn_flash_2_flashing.pngandtmp/pawn_flash_3_after.pngthe difference is clearly there — brighter and more saturated — but it reads as "the pawn got a bit more vivid", not as an alarm, and at map zoom it would be easy to miss entirely. It is measurable (red-minus-green 0.47 → 0.70), which is why the probe can assert it, but measurable is not the same as noticeable.Worth considering as a follow-up: a brighter non-red colour, a repeated pulse rather than a single fade, or pairing it with the #57 toast so the flash is corroboration rather than the whole message. Left as specified for now.
🤖 Generated with Claude Code