ReviewOS

stacks/the-settlers-iii-remake

Choose legally movable troops for military AI orders

#195
Closed chris opened this 8 days ago ·
8 days ago

The completed ordinary two-economy seed-2 match at 08d4eff3b50eb295e68324c2b453551cf829defb retains a tick-45120 move-soldiers refusal: Each garrison keeps its last soldier. Additional ordinary seed-1 and seed-5 matches at tick 80000 retain five and 102 executed refusals respectively, despite clean conservation and no enqueue errors.

The military policy falls back to all owned soldiers when no ready outside soldier exists. Scouting sorts that list by ID and chooses its first member, which can be a tower's sole guard while a second garrison can legally supply a troop. Attack/defense fallbacks can also request orders when every selected troop must stay inside. The engine's final-guard enforcement is correct and must remain unchanged.

A public-policy scenario with one sole tower guard and a two-person castle reproduces the actual refusal without editing state. Four focused cases currently produce one pass and three failures: spare-garrison selection, only-guard restraint and restored-policy execution fail; the existing preference for a ready outside troop passes. The red evidence is retained locally with the task.

Acceptance:

  • Derive movable owned troops from the allowed player view and retain a final guard in each garrison.
  • Prefer ready outside troops as before; use legally movable fallback troops rather than an immovable lowest-ID guard.
  • Do not emit attack, defense or scout moves guaranteed to fail solely because all available soldiers are final guards.
  • Preserve the engine's guard rule, ordinary command path, difficulty cadence, resource accounting and restored decision determinism. No unit relocation, grants or simulation-rule changes.
  • Cover a usable second garrison, only-guard garrisons, ready outside preference, attack/defense paths and restore at the public policy/session seam.
  • Repeat ordinary match and actual web regression checks, retain other unfinished-seed bottlenecks, and verify exact pushed-main CI before closing this scoped correction.

Related broader issues: #74, #76 and #4. This is engineering policy against the implemented rules, not original Gold AI qualification.

8 days ago

The source correction now derives movable troops from the allowed player view, preserving one deterministic guard per military garrison and excluding soldiers inside other workplaces. Ready outside troops retain their preference. Scout, attack and defense paths avoid issuing a military order when all troops must stay inside. The engine's final-guard rule and simulation/profile identity are unchanged.

Six focused public policy/session regressions pass with 78 assertions, including a usable second garrison, only-guard restraint, outside-ready preference, restore, attack and defense. The full suite passes 289 tests with 22930 assertions. The order type now retains its required command name; unsafe numeric test fields are checked at runtime. Typecheck and the focused 31-test recovery/military suite pass after that cleanup.

A repeated ordinary two-policy seed-2 match ends at tick 45321, player 2 winning, checksum 8c15b1eb. Complete execution tracing, rather than only enqueue checks or retained history, records zero failed commands on seeds 2, 1 and 3, with clean conservation. Seeds 1 and 3 remain unfinished at tick 80000. Seed 5 and the fresh complete browser run are still in progress. No grants, direct state edits, special clocks or relaxed browser deadlines.

The prior construction/neutral-resource change is already on main as 08d4eff3b50eb295e68324c2b453551cf829defb; its exact CI is still running. This military correction is isolated on codex/settlers-movable-troops and will be published after its own remaining gates.

8 days ago

Published as https://github.com/stacksjs/the-settlers-iii-remake/commit/f4624f26385ef2235ead57616528ef1747e2f528, authored and committed as Chris Breuer without coauthors through a normal fast-forward push to main.

The policy derives movable troops from its allowed own-player view, retains one deterministic guard per military garrison, excludes soldiers inside other workplaces and preserves ready-outside preference, attack threshold and cadence. Scout, attack and defense wait when none can leave. Engine guard/ownership rules and profile 0.10.0 are unchanged.

Six focused public command/restore regressions pass with 78 assertions. The full 289-test suite passes with 22930 assertions; after the typed order contract and checked numeric test-field cleanup, the 31-test recovery/military focus passes and typecheck is clean. The type-only source change emits identical JavaScript.

Exact main CI is green: https://github.com/stacksjs/the-settlers-iii-remake/actions/runs/40228342655. Its original diagnostic artifact ID12611549804, 19648bytes, SHA256 f12a6f33cf3bf56bcbcb755b04a2310ee3e6009a1507aaf7e0f3ad6d2d48a272, matches GitHub's digest and passes every ZIP CRC. All385browsersteps in ten suites succeed with empty console-error, failed-request and collection-error arrays, including the full ordinary-4x battle, save and actual reload.

Complete per-tick command tracing records zero military refusals on seeds2,1,3,5. Seed2finishes at45321, player2wins, checksum 8c15b1eb; the other three remain unfinished80000. Seed5has one early non-military duplicate-demolition refusal, tracked separately in #196. That error had disappeared from bounded final history and is retained explicitly. Broader #74/#76 remain open; this does not establish Gold behavior, human victory or native presentation.

Committed receipt: docs/roadmap/receipts/ai-movable-troops-2026-10-25.json. Closing only this military-selection correction after its exact source and browser gates.

Sign in to comment on this issue.