Build
dark red = already standing (free to keep or demolish)
How to use this
Paint your in-game map, press Solve, and get the building
layout that earns the most stars per turn from Markets —
provably optimal, not a guess. Works for 1–3 cities.
Quick start
Tap a City tool (A/B/C) and tap the map — the center
claims the 3×3 around it.
Paint terrain to match your game: crops, forests,
mountains with ore. These are what buildings feed on.
Extend territory with the Territory tools if your city's
borders have grown (up to the 5×5 around its center).
Captured a city with buildings already standing? Mark them with
the existing building tools.
Press Solve for the best plan, then More plans to see
cheaper lower-income options.
Your map is saved in this browser automatically. Undo steps
back through your edits, and Copy link gives you a URL that
opens the map anywhere.
Reading the board
Terrain: plain green = field, yellow rows = crop, dark green
trees = forest, grey peak = mountain, peak with a dot = ore, blue
waves = ocean.
A colored border is city territory (red A, blue B, purple C);
the letter marks the city center.
Dark red letters are buildings that already stand on the tile
(fa farm, h hut, mi mine, S/W/FO
sawmill/windmill/forge, M market, mo monument).
After solving: M +n★ is a market and its income,
S/W/FO Ln a producer and its level, fa/h/mi the
supporting farm/hut/mine that feeds it.
An existing building drawn grey and crossed out is one the plan
demolishes (that is how a market or producer moves to a better
tile, since a city only gets one of each). A small letter in a
tile's corner is what used to stand there.
Tap any tile coordinate in the plan text to flash that tile
on the map.
Rules the editor enforces
Placing a city center claims its 3×3; territory can only be
painted within the 5×5 around a center.
Buildings must stand inside territory. Farms need crop, huts
need forest, mines need ore; painting incompatible terrain under
a building removes it.
Each city gets one market, sawmill, windmill and forge; placing
a second one moves the first.
Before solving, the map is checked against the game's placement
rules (centers 3–5 tiles apart, territory within reach, one
of each special per city) and problems are listed.
The options
Clear forest (Forestry): build on a forest tile, refunds 1★.
Burn forest (Chivalry, 3★): forest becomes crop, for a farm.
Grow forest (Spiritualism, 5★): a field or crop tile
becomes forest — enables field/crop → lumber hut, and the
field → grow → burn → farm chain.
Destroy buildings (Chivalry): with it off, existing
buildings — monuments included — are permanent fixtures
the solver must work around.
Challenge mode
A random 10×10 map with 1–3 cities is dealt as soon as
you open the tab. Place buildings with the Build tools and watch
your income and cost update live; the erase tool removes your
own building or demolishes a pre-built one (free, as in-game).
About half the maps start partly built — sometimes with a slice
of the best plan, sometimes with a decoy village in the wrong
place.
Check my plan grades you against the solver's proven
optimum: ★ for 70%+ of the best income, ★★ for the
maximum income, ★★★ for the maximum income at the
provably cheapest cost. Show solution reveals the optimal
plan; Back to my plan returns to yours.
Understanding the results
Income is stars per turn from markets; cost is the one-time
stars to build everything (terrain conversions included); the
payback is how many turns until the plan has paid for itself.
Proven optimal means an exact integer-program solve found
the plan and proved nothing better exists. A plan marked
near-optimal hit the time limit — it is the best found,
but not proven best.
More plans lists the cheapest plan for every worthwhile
income level: each step down in income is strictly cheaper. Gaps
(e.g. 13 then 9) mean the levels between cost the same as the
higher plan.
Adjacency counts all 8 neighbours and works across city borders.
A market earns 1★ per level of each adjacent sawmill, windmill
or forge, up to 8. A producer's level is the number of adjacent
huts / farms / mines.
NOT AN OFFICIAL Polytopia PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MIDJIWAN.