ReviewOS

stacks/the-settlers-iii-remake

Prefer surveyed matching deposits when suggesting mine sites

#212
Closed chris opened this 7 days ago ·
7 days ago

The browser's building chooser can suggest a mine outside the reach of a known matching deposit. It currently searches for legal ground; only harvest buildings receive a resource-aware preference. The computer policy already requires matching survey signs for mines.

Observed in an ordinary seed 1 rival playthrough: the suggested iron mine at (31,76) completed and immediately reported an exhausted deposit without producing iron ore. No clock, save, session or AI state was injected into that browser match.

A separate authored public-session reproduction establishes the selector defect without depending on that playthrough: after a real geologist surveys iron at (48,40) and leaves the site, a mine at that deposit is legal. findBuildingSite instead returns (45,36), outside the profile's extraction radius of 2. The nearer recommendation has no iron in range. The selector leaves the checksum unchanged.

Acceptance:

  • Prefer legal mine sites that can serve the player's own live positive matching survey signs, using the actual extraction geometry. Preserve deterministic search order among equally suitable sites.
  • Use only public player knowledge. Hidden deposits, foreign signs, expired signs and wrong minerals must not improve the recommendation. Keep the player's ability to place a legal speculative mine.
  • Give a clear message when a legal suggested mine has no known matching deposit in reach. Do not describe a legal barren fallback as resource-qualified.
  • Share the public resource forecast where appropriate, rather than maintaining divergent browser and AI deposit rules. Preserve production rules, extraction radius, food consumption, commands, saves and replay behavior.
  • Test the failing public survey/placement scenario, absent and wrong signs, expiration, foreign knowledge, map bounds, read-only checksums and save/reload. Run relevant unit, browser, lint, type and build checks, and verify committed CI before closure.

Related: #45, #39, #4. This is browser placement assistance. It does not establish original Gold behavior or change mineral reserves.

7 days ago

Mine suggestions now prefer legal sites within reach of the player's live matching survey signs. The browser chooser and computer policy share the same public forecast. A legal unsurveyed fallback remains available, with a warning before construction goods are spent.

The original failing survey/placement case passes, and a recommended iron mine produces physical ore after construction and reload. In a fresh browser match, the recommended surveyed coal mine also completed and produced eight coal through normal controls.

CI passed: 366 unit tests and all 500 browser steps, including the full-length battle. The retained browser reports contain no console or request errors. Mining rules, reserves, food consumption and save formats are unchanged; broader mining fidelity remains in #45.

Sign in to comment on this issue.