Skip to content

Tidier solved layouts, cheapest ties first, per-landmass pickers, Solve all fixes - #12

Merged
OGMods merged 3 commits into
mainfrom
tidy-layouts-and-solve-all
Oct 29, 2026
Merged

OGMods merged 3 commits into
mainfrom
tidy-layouts-and-solve-all

Conversation

@OGMods

@OGMods OGMods commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Solver

  • Idle buildings are removed, not downsized. Right-sizing used to swap a building with no load for the cheapest tier of its role and leave it standing idle — a Heat Sink Retire the Python solver; extract @reactor2/solver as a package #1 doing nothing beside a Longer solve attempts, kept per-island solves, and a faster engine #8. It now tries removing it first, under the usual power / online / upgrade-plan guard.
  • Empty tiles move to the edge. A new final pass (search/emptyTiles.ts) moves interior holes to the shore and corners; each move is re-simulated and kept only if power holds, no producer goes offline, nothing new goes idle and the plan holds. On a player's eight Singularity solves: 24 interior holes → 0, power identical, 0–145 ms per board (300 ms budget, plus 300 ms shared across alternates).
  • Cheapest tie first. Among layouts tied on power, the cheapest to build (game prices with per-copy scaling, then fewest buildings) becomes the island's primary.

App

  • Every shortlist is ordered cheapest first: pooled attempts (IslandBest), whole-board variants, and a tied re-run (the selection follows the layout on screen). Attempts are still judged against the best power reached, so cheaper ties can't drag the figure down.
  • Part pickers: when two or more islands each have several tied layouts, the card shows a picker per island. Stepping one swaps that island only; the resulting board is scored and slotted into the shortlist, which never grows past 10.

Solve all

  • The estimate is now each island's own estimate summed, instead of the on-screen island × count, so it no longer changes with the selected island. Boards are decoded once in the background, one cached per island.
  • A batch counts as one run throughout (uiState.running): Setup no longer flashes back between islands, Run stays on Stop, and Stop in the gap ends the batch.

Testing

  • npm test (1125 passing), npm run check, npm run knip, format:check all clean.
  • Golden fixtures untouched — neither new pass runs in the deterministic replay.
  • Part pickers and the Solve all flow checked in a browser.

Right-sizing swapped a building with no load for the cheapest tier of its
role and left it standing idle, which is how a Heat Sink #1 ended up doing
nothing beside a #8. A building with no load is now tried for removal first,
under the same power, online and plan guard as a swap.

A new last pass moves the empty tiles a layout leaves inside the land out to
the shore and into corners: a building nearer the edge steps into each hole,
kept only if power holds, no producer goes offline, nothing new goes idle and
the plan still runs. On a player's eight Singularity solves it took 24
interior holes to none at no power, in 0-145ms per board.

Among layouts that tie on power, the cheapest to build (the game's prices,
each copy dearer than the last; then fewest buildings) is the one an island
returns, with its alternates in the same order.
… its own

Every shortlist the app keeps is now cheapest first: attempts pooled for one
island, the whole-board variants, and a tied re-run, which follows the
layout on screen to its new place. A later attempt is still judged against
the best power reached, so a cheaper tie a hair below it cannot drag the
island's figure down.

On a board where two or more islands have layouts of their own to choose
between, the card shows a Part picker per island. Stepping one swaps that
island's layout and keeps the rest; the board that makes is scored and put
into the shortlist, never growing it past ten.
The estimate was the island on screen times the island count, so it moved
with whichever island was open. It is now each island's own estimate,
summed, from boards decoded once in the background and replaced when an
island is edited.

Between two islands the solver is idle while the next board loads, and
Setup flashed back in while Run showed for a beat. A batch now counts as one
run throughout: Setup stays hidden, the button stays on Stop, and Stop in
the gap ends the batch.
@OGMods
OGMods merged commit 2e75bc8 into main Oct 29, 2026
3 checks passed
@OGMods
OGMods deleted the tidy-layouts-and-solve-all branch October 29, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant