Game Internals › Idle Kingdom Clicker › Research

Research

How research is paid for, what each of the 65 researches does at every level, what it costs, and how long it takes, as implemented in Code.dll (TechStateTools, BalanceTools.GetResearchCost, CreateBoostsFromTechLevelSystem, CreateBoostsFromAdjacencySystem) with the game's BalanceData25 research tree.

1. How research works

TechStateTools.GetResearchPerSecond @ 0x270A8AC · GetResearchCost @ 0x28530D4 · TechStateInfoComponent.Paid

A research isn't bought outright. Its cost (always Science) is paid gradually into the active research (TechStateInfo.Paid), and the level completes when the cost is met.

research per second = Science surplus delivered to your Universities per second (from the cart solver) time to finish = (cost − paid) ÷ research per second

That's why the cart planner weights University deliveries ×4 (production page, section 5): Science reaching Universities is research speed. More Universities, more Science goods in range, and fewer transport bottlenecks all speed it up. The World Completion Bonus and prestige speed it up too, because both raise transport capacity.

Research you get for free

UnlockBeginningTechsForFinishedTutorialSystem · TechStateTools.IsTechUnlockedFromCastle · CastleUnlocks.Setup

Four researches are yours from the start: Castle Construction, Foodstore, Foraging Hut and Grassland Dwelling. Six more reach level 1 free as your castle levels up: Forest Dwelling at castle level 3, Woodcutter at 4, Stockpile at 7, Shaman at 10, Library at 13 and University at 15. (The castle table also lists Foodstore at level 2, but you already have it by then.) Further levels are paid in Science as usual.

Cost of a level

one listed cost: cost(1) = base, cost(n) = base × UpgradeCost[n] (n = 2 … 100) a cost per level: cost(n) = Cost[n] (Land, Infrastructure, Portal)

What a level does, by research type

Producer / Refinery
unlocks the building (a producer makes raw goods, a refinery turns goods into better ones). From level 2, that building type gets production × UpgradeMultiplier[n] (a Tech_ boost filtered to that building).
Transport / Crossing
unlocks the store, or the bridge, tunnel or portal. From level 2, its transport capacity × UpgradeMultiplier[n]. Bridges reach 2 tiles from level 30 and 3 from level 76. Tunnels reach 2 from level 50 and 3 from level 76.
Neighbour bonus
each building of that type gets production × (same-type neighbours you own) × m(n), where m(n) = min(4, 2 + 0.01(n−1) + 0.09⌊n/10⌋ + 0.06⌊n/50⌋).
Land
lets you claim that terrain (Grassland Dwelling, Shipbuilding and so on). Level n gives a number of free tiles of it.
Infrastructure
Village Center, University, Academy, Castle, Trading Post. Level n sets the maximum number you can build and their maximum level. For the Castle (Castle Construction), the first number is the governor slots instead: 1, then 2 from research level 3, then 3 from level 9 (confirmed in the game). The Castle's level cap comes from its own unlock list.

2. The trees

Techtree.Data · Prereq / PrereqLvl · Tier

Three trees, Food, Material and Science: pick one above. Rows are the research's tier. Arrows show prerequisites, labelled with the level needed when it's above 1. Click a research to open it in the calculator below.

3. Research calculator

Try it
Every level

4. The level table

TechtreeBasicUpgradeData.Data[n] = { Cost, Multiplier }

Every research with a single listed cost (Producer, Refinery, Transport, Crossing, Neighbour bonus) shares this table. Two patterns:

Ordinary levels
each costs ×16 the previous one (2⁴ per level) and adds a fixed amount to the multiplier: +0.2 per level up to 9, then +0.4, +1.8, +5.6, +13, +25.2 … per decade.
Milestones (10, 20 … 100)
cost extra on top of the ×16: ×10 at level 10, doubling each decade to ×5,120 at level 100. In return they roughly double the multiplier (level 19 → 20 goes ×7.4 → ×15.5). So the level after a milestone costs less than the milestone itself, and stopping just short of a milestone leaves most of the decade's value unclaimed.

The last column, "gain per ×10 cost", shows how much multiplier each tenfold increase in Science buys. Milestones are by far the best value.

The table has rows up to level 103, but rows 101–103 are blank (cost 0, multiplier ×1). GetMaxLevel returns 104 for these researches, so in theory levels past 100 would be free and would reset the boost to ×1. Treat 100 as the real cap.

5. Neighbour bonus

CreateBoostsFromAdjacencySystem.CountNeighborsAndSetBoost · BalanceTools.GetAdjacencyBoostMultiplier @ 0x2854924

Ten neighbour-bonus researches (Plant Lore, Fungal Lore and others) each target one building type. With the research at level n, every player-owned building of that type counts its neighbours of the same type and gets a local production boost of neighbours × m(n). With no neighbours there's no boost. Local boosts multiply with everything else, so clustering same-type buildings pays off quickly.

Try it

Neighbours on the hex grid, so at most 6. Which researches: .

Sources and confidence

  • Read from the code: the cost rule (listed cost, or base × the shared level table), max level, research speed from University Science surplus, the research boost (producer/refinery → production of that building, transport/crossing → transport capacity, from level 2), the neighbour-bonus formula and its constants, connector length thresholds, free land and level caps by index, research granted at the start (UnlockBeginningTechsForFinishedTutorialSystem: Castle Construction, Foodstore, Foraging Hut, Grassland Dwelling) and research unlocked by castle level (IsTechUnlockedFromCastle → CastleUnlocks: Foodstore 2, already yours by then, Forest Dwelling 3, Woodcutter 4, Stockpile 7, Shaman 10, Library 13, University 15).
  • From data names: the first per-level number (AmountUnlock) as the maximum count for Infrastructure (the level cap is confirmed in GetCurrentBuildingMaxLevel). For the Castle it's the governor slots: the game's Castle Construction research says extra slots unlock at levels 3 and 9, matching the data. The Portal's PriceFactor (1, 0.9, 0.75) is probably a portal price reduction per level, not traced.
  • Checked in the game: only one research runs at a time, as the code's single active-research slot implies. The research production multiplier: a Foraging Hut with research level 17 shows ×6.6, as the table gives, and the whole output figure matches (formulas page). The research cost: the Foraging Hut research from level 17 to 18 costs 186.5ag in the game, and section 3 gives base 39.5T × the level-18 cost factor (4.722e21) = 186.53ag.
  • Research time needs no separate check. It's the cost still to pay divided by the Science delivered to Universities per second, and the cost is confirmed above.
  • Not traced: the research queue.
  • Odd data: Tech.FoodStore lists itself as its own prerequisite, which does no harm because it is granted at the start.