ReviewOS

stacks/the-settlers-iii-remake

[S3-054] Implement garrisons, capture, and territory consequences

#56
Closed chris opened this 9 days ago ·
9 days ago

S3-054: Implement garrisons, capture, and territory consequences

Parent and ownership

Parent epic: https://github.com/stacksjs/the-settlers-iii-remake/issues/9 Source owner: stacksjs/the-settlers-iii-remake. Master roadmap: https://github.com/stacksjs/the-settlers-iii-remake/issues/4.

Problem and observable result

Staff real military buildings. Capture through individual combat. Apply ownership changes to land, goods, and units.

The current application is a browser prototype. Passing the Riverlands campaign does not establish original-game or native parity. This issue is complete only when its stated behavior has retained evidence.

Evidence and interfaces

Individual units execute deterministic commands. Recruitment, damage, ownership, offerings, promotions, and interventions use versioned faction rules and physical resources.

Pin the inspected revisions and fixture hashes in the implementation evidence. Original-game observations govern rules and timing. JSettlers is implementation evidence, not an authoritative balance specification. Unknown values remain explicitly unverified.

Acceptance criteria

  • Staff real military buildings.
  • Capture through individual combat.
  • Apply ownership changes to land, goods, and units.
  • The visible result agrees with the underlying simulation or platform state, including failure paths.
  • Tests exercise the maintained public interface and retain reproducible fixtures or execution receipts.

Test matrix

  • Capture a supplied garrison.
  • Verify border loss and interrupted civilian jobs.
  • Exercise invalid input, cancellation or interruption, and repeated execution where this interface permits them.
  • Verify determinism/conservation for simulation changes and resource ownership/disposal for platform changes.
  • Run owning-repository lint, relevant type checks and tests. Capture actual native output for native capability claims.

Scope constraints

Implement this behavior as a complete verifiable slice. Do not silently expand into adjacent tickets or substitute simplified gameplay. Keep the shared TypeScript simulation, shared stx signals, and ts-css conventions. Native gameplay and HUD must not depend on a WebView. HomeOS reuse must not introduce a kernel dependency into the game. Existing unrelated edits and authored guidance must be preserved.

Blocked by

Upstream release and adoption

Application behavior belongs here. If a reproduction identifies a framework defect, repair and release its owning source first, update Stacks where affected, then install the verified packages here.

No node_modules edits, copied runtimes, generated-source string patches, fabricated globals, successful no-op implementations, or skipped release gates. Push tested conventional commits as Chris to the owning origin/main without coauthor trailers or force pushes.

Completion evidence

  • Implementation commits and relevant upstream issue links.
  • Exact checks and results, fixture hashes, and screenshots/native execution evidence where applicable.
  • Published package versions, downstream lockfile identity, and release receipts when affected.
  • Remaining limitations stated explicitly. Partial work does not close this issue.
9 days ago

Completed in 36af2f0 and b3d7457.

  • Staffing real military buildings: idle soldiers walk to towers and castles with free places, infantry and bowmen separately (small tower 1 + 2, castle 5 + 6, reference occupyer entries). Original maps keep their per-building garrisons. Bowmen on the walls shoot from the building.
  • Capture through individual combat: attackers at the door draw defenders out one at a time (infantry first); with nobody left inside, the building changes hands and the conqueror moves in. Each garrison keeps its last soldier when the owner sends troops out.
  • Ownership consequences: stacks in the captured building pass to the winner and are recorded as lost/gained in both ledgers (the audit and conservation oracle include them). Land in the building's reach goes to the nearest covering active military building. Buildings left on lost land are destroyed without refund: jobs cancelled, workers released, goods dropped. Loser soldiers heading to the captured garrison stand down.

Test (garrisons and capture): a supplied enemy castle with a swordsman, stored planks and a woodcutter at work. Two attackers take it; the test checks deaths, lost/gained planks, stack ownership, tile ownership, the destroyed woodcutter hut, the released woodcutter keeping his axe with no cargo, events, the conqueror inside, a clean audit and a save/restore with an identical checksum. Tampered soldier saves are refused. Verified in the browser on the original T1 tutorial map (9 swordsmen, 2 pikemen, 6 bowmen, tower garrison) with the send-soldiers order.

Sign in to comment on this issue.