Skip to content
Source
Sign inSign up
samwillis/jerry

feat: add lemmings mode. #1

Openthruflo(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/1/headopened

Summary

Adds Jerry menu → Marchers Rescue, a falling-walker puzzle played on the real desktop. It uses generic names and its own artwork.

  • A hatch at the top centre of the screen releases 20 marchers per level. They walk along windows, turn at walls, fall, and are lost if they fall too far or drop off the bottom of the screen.
  • The exit door sits on an exposed window top, away from the hatch, and moves with its window.
  • Windows as material. Each window is a hollow room with a solid 28 pt title band, 6 pt walls and a 6 pt bottom rim. The frontmost window at a point decides what is there.
  • Moving windows. Tunnels, blast holes and bricks are stored relative to their window. Marchers ride the window they stand on. Moving a window carries all of it along, and Jerry re-plans for the new layout.
  • Skills. Climber, floater, bomber, blocker, builder, basher, miner and digger, with per-level stock.
  • Jerry solves it.
    • MarcherPlanner is a receding-horizon search over the same deterministic MarcherPhysics the level uses. It tries each skill now or at sampled moments along the baseline path, retrying with an umbrella first where a task would end in a fatal fall.
    • Each outcome is scored for the marcher and for a probe follower dropped from the hatch, so tunnels, bridges and blockers that help the whole line win.
    • Marchers already working keep working inside the simulation, so unfinished tunnels count.
  • Physical reach. Jerry only signals marchers within 420 pt of his hand. MarcherCoach walks, abseils, parachutes or grapples him towards the next planned skill using the existing route graph. He points and throws a skill token. Manual control still works; he keeps signalling whatever is in reach.
  • App side.
    • Planning runs off the main actor in a detached task, from a value snapshot. Stale results are discarded by session.
    • Idle exploration is suspended while the mode runs.
    • The level pauses and hides during AI tasks.
    • The menu item is flat, so the menu stays within two levels.
  • Docs. New docs/MARCHERS_MODE.md covers the rules, solver and known limits. README, AGENTS.md and the manual checklist are updated.

Validation

  • swift test --package-path Packages/ExpeditionCore: 196 tests pass, including 23 new MarcherTests.
    • Run on Linux with Swift 6.0.3, since that is what the container had.
    • The new tests cover material and occlusion, carves and bricks following windows, every skill, exit placement and scripted rescues.
    • Scripted rescues: an umbrella drop (at least 9 of 10 saved), a bridged gap (at least 8 of 10), a blocker turnaround (at least 8 of 10), digging through a full-width window (at least 4 of 6), and a mid-level window move (at least 5 of 8).
    • They also cover background planning and the reach limit.
  • Planning cost on a crowded 12-window desktop: mean about 1.3 ms in Release (4.6 ms worst) and about 50 ms in Debug (up to about 250 ms worst). The Debug cost is why the app plans off the main thread.
  • Not done: the macOS app (AppKit/SpriteKit code and project file) has not been compiled or run, because only Linux was available.
    • An independent static review found no compile problems. Its integration fixes are in the second commit.
    • Please run ./scripts/build.sh and the new "Marchers Rescue" section of docs/MANUAL_TESTS.md on a Mac before merging.

Known limits

  • The planner reasons about one marcher and one skill at a time, plus an umbrella, on static terrain. It can waste skills and can miss solutions that need several coordinated moves.
  • Blockers are released only by the end-of-level detonation.
  • The window-room model ignores real window shapes and transparency.

Generated by Claude Code

  1. Nothing happened in this round.

Sign in to join this conversation.