Upgrade costs, building costs, production and prestige, as implemented in the game's own code (Code.dll, class Code.BalanceTools) and fed by its balance data (BalanceData25, build of 20 March 2026, commit e785d5399).
Each section gives the formula, then lets you plug in values. The calculators use the game's real tables, which are embedded in this page.
Each building has up to three cost components (Food, Material, Science). Each one is a list of bands that start at particular levels. Every level you buy is priced separately and the prices are added up:
the last band whose StartLevel ≤ ℓ (the first band if ℓ is below all of them).
firstStart
the StartLevel of the component's first band. The exponent counts from here and does not reset at a new band, so a band boundary is a one-off step in price, not a new curve.
effectMult(ℓ)
×5.4 when ℓ is an effect level (10, 25, 50, 100, 200 … 2000), the levels the game announces as "Level N Effect Acquired". ×100 for University and Academy (every 10 levels) and Village Center (every 5). Always 1 for Castle and Trading Post. Otherwise 1.
A component only adds cost once ℓ ≥ firstStart (the exponent must be ≥ 1). That's how Material appears in a Foraging Hut's price from level 101.
Try it
Price of each single level, levels 1 to
Show as a table
2. Building another copy
BalanceTools.CoreBuildCost(type, amountExisting) @ 0x284D040 · BuildCost(type, 1, 1) routes here
A new building's price depends on how many of that type you already own (n). The game first checks a hand-tuned step table. Past the end of that table it falls back to a formula:
if BuildamountCostSteptable[type] has an entry n:
cost = Steptable[type][n]
else, for each component whose firstStart ≤ 1 (using its first band):
cost = BaseCost × AmountPower ^ n × (1 + AmountFactor × n)
The AmountPower and AmountFactor fields in the balance data are only used here, never for upgrades.
effects = number of effect levels ≤ level
perSecond = Base × level × 2^effects × global × local
cycleTime = Timer × 0.5^effects
perCycle = perSecond × cycleTime
global = (1 + 0.1 × prestige) × other global boosts
local = (Royal Edicts and governors on this tile)
Base
BuildingProductionBaseTable, per unit of level, per second.
Timer
ProductionTimerTable, seconds per cycle before any effect level.
2^effects
each effect level (10, 25, 50, …) doubles the rate and halves the cycle time. Per-cycle output (before boosts) is therefore Base × level × Timer at any level: effect levels make cycles come faster, not bigger.
global
all active global boosts, mostly multiplied together (one ID-prefix group is summed first). Prestige is one of them (the game's Economy Boost).
local
governor boosts on the tile add together; Royal Edict boosts multiply.
total of that category collected this run (totalResourcesCollectedInRun).
f(x)
a tier lookup: the factor of the highest threshold ≤ x, or 1 below the first threshold. Food's first thresholds are 10M → ×1.2, 1.72B → ×1.4, 3.79B → ×1.6.
land
the land you've claimed on the current map, as the game shows it (castle and free tiles included).
landFactor
the same lookup on the current map's land table (map 1: 10 land → ×2.0, 15 → ×2.1, …).
The game's reset screen puts it as "each point increases production, transport and research speed by 10%". In the code it multiplies production and transport capacity, and research speed follows from transport, because research runs on the Science that carts deliver to Universities.
Try it
Numbers use idle-game notation: K, M, B, T, then aa = 1015, ab = 1018 … az, ba …, each step ×1000. Inputs accept these suffixes (5B, 2.5aa, 40K) or plain numbers.
What's verified and what isn't
Read from the code: every formula above comes from statically reading the ARM64 disassembly of the methods named in each section (Cpp2IL dump of libil2cpp.so, metadata v39, Unity 6000.3.11f1). Constants not in the JSON came from the binary: the 5.4× and 100× effect-level multipliers and the lists of effect levels.
Checked in the game: five upgrade prices from a late-game save match to the digits shown. Foodstore 410→411: 6.21ag Material. Bridge 1→2: 661.25ad Material + 6.61ad Science. Fisherman 400→401: 138.85af Material. Library 450→451: 23.07af Material + 809.49ae Science. Quarry 225→226: 22.63ag Material. Clay Pit: built for 100T, then upgrades to level 2 for 129.96T, to level 9 for 325.19T, to level 10 for 2aa and to level 25 for 14.29aa. Levels 10 and 25 are effect levels, so this confirms the ×5.4 surcharge (325.19T × 1.14 × 5.4 = 2.00aa). Prestige on reset also matches: on map 4 the calculator gave 2.055ac prestige and a 31.66% boost, and the game showed 2.05ac and ×1.32. Production also matches: a level-1 Foraging Hut on map 1 showed 0.105 Food/s base × level 1 × governors (castle) ×12.72 × research level 17 ×6.6 × Economy Boost ×988.3233ab = 8.71ac Food/s. The formula gives 8.712ac. The prestige factor is exactly 1 + 0.1 × prestige (9.88ac), and the game calls it the economy boost.
Names: the game's code calls the second resource Wood, and the game shows it as Material. These pages use Material.
Prestige: the reset calculation also records Shrine and Portal Tower factors in its result, but this function doesn't multiply them into Total. They may be applied elsewhere or only displayed. Not traced. In the game, the reset screen doesn't mention shrines, and prestige matched the calculator without them. Portals haven't been checked.
Settlements: land prices count your owned tiles across all terrains, subtract free tiles (the castle uses one free grassland), and are scaled per map. The building-cost calculator here ignores all that. Use the maps and prestige page, which handles it and matches the game.
Not modelled: refinery input consumption, cart transport, governor traits, the linear-programming resource valuation, and the exact makeup of global and local boosts. The production calculator takes those as plain multipliers.