Exponential cost scaling
Each purchase multiplies the next price by a fixed factor; prices grow geometrically, income usually linearly.
In most incremental games, each purchase multiplies the next price by a fixed factor : after purchases the price is . Income grows linearly with the count owned, so purchases speed up, then slow down. sets when the turn comes and how steep it is. In 2016, Anthony Pecorella of Kongregate called exponential costs against linear or polynomial production the typical idle-game design, a seesaw between production and costs1.
#How it works
Let be the base price (the first one) and the growth constant. With owned, the next one costs
On a log axis, the price is a straight line: sets its height, and sets its slope. The price doubles every purchases: 4.96 at , 10.2 at 1.07, and 3.1 at 1.252.
#Buying several at once
Buying more with owned sums a geometric series:
At , “buy 10” costs 20.30× the next single price3 whatever the count owned: . Inverting it gives the most you can buy with , 4.
#Why the growth constant sets the pace
Let each one owned earn per second, as each building type does in Cookie Clicker before upgrades5. With owned and nothing saved, the next one takes
The ratio is below 1 while , then above 1, tending to 6:
- Waits shrink until about : 6.7 at , 14.3 at 1.07, and 4 at 1.256.
- Then each wait is about times the last, doubling every purchases like the price6,2.
For Cookie Clicker’s Grandma (base price 100 cookies7, 1 cookie/s8), the wait is 115 s for the 2nd, 38 s at its low for the 8th, and 36 minutes for the 51st9. In Pecorella’s account, multipliers keep production close until the wait “gets prohibitively long”, the point to prestige10.
With linear costs and income , the wait tends to and never runs away.
#Implementations
#Cookie Clicker
The web version (2.058) uses one constant for all 20 buildings: each one owned multiplies the next price by 1.1511. The next price is 12. Free buildings (Starter kit, Starter kitchen) come off the exponent13. Discounts such as ×0.99 apply before the rounding, lowering the line but not its slope14.
var price=this.basePrice*Math.pow(Game.priceIncrease,Math.max(0,this.amount-this.free));Only the Cursor keeps its written base price of 1515. The rest come from a formula on the building’s index16: 100, 1,100, 12,000, 130,000, and so on7. A sibling formula sets base production8.
The store shows bulk prices (1, 10, or 10017) as the exact geometric sum, rounded up once3. The purchase buys one at a time, each rounded up, ignoring the total. Ten Grandmas from zero show 2,031 but cost 2,035, and one cookie short still buys nine18. Selling pays 25% of the next price, about 15% more than its label19.
#Antimatter Dimensions
In Antimatter Dimensions, each of the eight dimensions keeps one price for 10 purchases, then multiplies it by its tier’s factor20. Factors run from 10³ to 10¹⁵, about ×2.0 per purchase for tier 1 and ×32 for tier 821. Starting prices run from 10 to 10²⁴22.
Once a price passes Number.MAX_VALUE ≈ 1.8 × 10³⁰⁸23, the shared ExponentialCostScaling class grows the ratio between sets by another factor of 1024 each set. With sets past the threshold, the price is , quadratic in log space25. For the 1st Dimension, the extra scaling starts after 103 sets, or 1,030 bought23.
The same amount unlocks Infinity, the first prestige reset26. The Break Infinity upgrade “Reduce post-infinity Antimatter Dimension cost multiplier scaling” lowers S to 327. Tickspeed upgrades use the same class at ×10 per purchase28.
“Buy until 10” is exact, because the price is flat within a set29. Max-buy charges only the most expensive set it buys, about 0.1% under the true sum30 at ×1,000 per set. A code comment says it “assumes you only have to pay for the most expensive thing”30. Over a long run, the true sum approaches times the last price: 1.001 at ×1,000 (Antimatter Dimensions) and 7.7 at ×1.15 (Cookie Clicker)31.
#AdVenture Capitalist
Pecorella gives the Lemonade Stand as 32 at 1.67 per second each. At , the shortest wait comes with 15 stands owned6. The game’s code isn’t public.
#A Dark Room: linear, with a cap
A Dark Room prices huts at wood33 and traps at wood34. The build action refuses past the maximum, so the cap, not the price, ends each run35. Housing is 4 villagers per hut36.
#History
Cookie Clicker launched on 8 August 201337. Its earliest capture, five days later, set each new price to 38. The rounding compounded, so the 51st Cursor cost 2,283, not 15 × 1.1⁵⁰ ≈ 1,76138. By v1.035, captured 10 September 2013, the rule was through one Game.priceIncrease39.
A Dark Room, announced two months before Cookie Clicker40, used linear prices. Antimatter Dimensions (201641) used steps of 10 and a super-exponential stage.
#Variants and combinations
- Stepped: Antimatter Dimensions.
- Super-exponential past a threshold: Antimatter Dimensions’ post-Infinity scaling.
- Linear with a cap: A Dark Room.
- Bulk buying: the exact sum (Cookie Clicker’s label) or only the last price (Antimatter Dimensions’ max-buy).
- Discounts: Cookie Clicker.
- Prestige: restarts the curve; production multipliers carry across10.
References
- ^Pecorella calls idle games a seesaw between production and costs, typically with exponential costs () against linear or polynomial production. T2Pecorella 2016
- ^ abA price that grows by a factor of per purchase doubles every purchases. T4Cookie Clicker main.js v2.058 · main.js L7972Pecorella 2016probe
probes/idle-costs/growth-math.mjs - ^ abThe shown bulk price (
getSumPrice) is the geometric sum , discounted and rounded up once: 20.30× the next single price for 10, and 7.83 million× for 100. T4Cookie Clicker main.js v2.058 · main.js L8096–8105Pecorella 2016 · “BONUS CONTENT!”Cookie Clicker Wiki, “Building” · Building Pricesprobeprobes/idle-costs/cookie-clicker.mjs - ^For a plain exponential (base , rate , and owned), Pecorella gives the most you can buy with currency as . T2Pecorella 2016 · “BONUS CONTENT!”
- ^Each type's production is
amount * storedCps, summed into cookies per second, so before upgrades income grows linearly with count. T3Cookie Clicker main.js v2.058 · main.js L5276–5285 - ^ abcdWith income linear in the count, waits shrink until owned, then each is about times the last. T4Cookie Clicker main.js v2.058 · main.js L5276–5285, L7972probe
probes/idle-costs/growth-math.mjs - ^ abBase prices (the first one's price) are Cursor 15, Grandma 100, Farm 1,100, Mine 12,000, Factory 130,000, Bank 1.4 million, and so on up to You at 5.4 × 10²⁶. T4Cookie Clicker main.js v2.058 · main.js L8979, L8024–8031Cookie Clicker Wiki, “Building” · buildings table, “Base Cost” columnprobe
probes/idle-costs/cookie-clicker.mjs - ^ abBase production before upgrades is 0.1 cookies/s for the Cursor, set in its own production function, and to two significant figures for building : Grandma 1, Farm 8, Mine 47, Factory 260, and so on up to You at 5.1 × 10¹⁴. T4Cookie Clicker main.js v2.058 · main.js L8018–8022, L9104–9109, L9001, L8912–8916probe
probes/idle-costs/cookie-clicker.mjs - ^On Grandma income alone, the wait for the next Grandma is 115 s for the 2nd, a low of 38 s for the 8th, and 36 minutes for the 51st. T4Cookie Clicker main.js v2.058 · main.js L8090–8095, L5276–5285probe
probes/idle-costs/cookie-clicker.mjs - ^ abIn Pecorella's account, production first outruns costs, multipliers keep it close, and a prohibitive wait for the next generator marks the time to prestige. T2Pecorella 2016
- ^One global constant,
Game.priceIncrease= 1.15, multiplies a building's price for each one already owned. T4Cookie Clicker main.js v2.058 · main.js L7972Cookie Clicker Wiki, “Building” · Building Pricesprobeprobes/idle-costs/cookie-clicker.mjs - ^ abA building's next price is , with discounts applied before rounding. T4Cookie Clicker main.js v2.058 · main.js L8090–8095Cookie Clicker Wiki, “Building” · Building Pricesprobe
probes/idle-costs/cookie-clicker.mjs - ^Free buildings (Starter kit: 10 Cursors; Starter kitchen: 5 Grandmas) come off the exponent, so the next one costs the base price. T4Cookie Clicker main.js v2.058 · main.js L8266–8275, L3828–3829probe
probes/idle-costs/cookie-clicker.mjs - ^Discounts from upgrades, auras, buffs, and gods multiply the price by constants such as 0.99 or 0.95, lowering the curve without changing its 1.15 slope. T3Cookie Clicker main.js v2.058 · main.js L8792–8814
- ^Only the Cursor keeps its
Game.Objectconstructor price; the formula overwrites the rest (the Farm's 500 becomes 1,100). T4Cookie Clicker main.js v2.058 · main.js L8003–8034, L9104probeprobes/idle-costs/cookie-clicker.mjs - ^Every building after the Cursor gets its base price from one formula on its index : , rounded to two significant figures. T4Cookie Clicker main.js v2.058 · main.js L8024–8031probe
probes/idle-costs/cookie-clicker.mjs - ^Bulk options are 1, 10, and 100; “All” works only in sell mode and means 100 in buy mode. T3Cookie Clicker main.js v2.058 · main.js L8816–8825
- ^
buy()charges each unit's rounded-up price in turn and ignores the shown total: 10 Grandmas from zero cost 2,035, not 2,031, and 2,030 cookies still buy 9. T4Cookie Clicker main.js v2.058 · main.js L8125–8152, L8898–8901probeprobes/idle-costs/cookie-clicker.mjs - ^Each sale pays 25% of the next one's price, rounded down, about 15% more than the label: selling 1 of 10 Grandmas shows 88 and pays 101. T4Cookie Clicker main.js v2.058 · main.js L8156–8176, L8106–8123, L1620–1628probe
probes/idle-costs/cookie-clicker.mjs - ^A dimension's price is : flat for each set of 10, then a jump;
costBumpsmoves only in Normal Challenge 9 and Infinity Challenge 5. T4IvarK/AntimatterDimensionsSourceCode · src/core/dimensions/antimatter-dimension.js L359–364, L544–566probeprobes/idle-costs/antimatter-dimensions.mjs - ^After every 10 bought, tiers 1–8 multiply their price by 10³, 10⁴, 10⁵, 10⁶, 10⁸, 10¹⁰, 10¹², and 10¹⁵, about 2.0× to 32× per purchase. T4IvarK/AntimatterDimensionsSourceCode · src/core/dimensions/antimatter-dimension.js L339probe
probes/idle-costs/antimatter-dimensions.mjs - ^The eight Antimatter Dimensions start at 10, 100, 10⁴, 10⁶, 10⁹, 10¹³, 10¹⁸, and 10²⁴ antimatter. T4IvarK/AntimatterDimensionsSourceCode · src/core/dimensions/antimatter-dimension.js L337probe
probes/idle-costs/antimatter-dimensions.mjs - ^ abThe threshold,
Number.MAX_VALUE(≈ 1.8 × 10³⁰⁸), becomes sets: 103 (1,030 bought) for the 1st Dimension, and 19 for the 8th. T4IvarK/AntimatterDimensionsSourceCode · src/core/dimensions/antimatter-dimension.js L350–357, src/core/math.js L347–349probeprobes/idle-costs/antimatter-dimensions.mjs - ^The post-threshold factor ,
Player.dimensionMultDecrease, is 10 minus the effects of the Break Infinity upgradedimCostMultand Eternity Challenge 6's reward. T4IvarK/AntimatterDimensionsSourceCode · src/core/cache.js L65–68, src/core/dimensions/antimatter-dimension.js L354probeprobes/idle-costs/antimatter-dimensions.mjs - ^
ExponentialCostScaling.calculateCost(n)returns , times once exceedspurchasesBeforeScalingby , so the ratio between steps grows by each step. T4IvarK/AntimatterDimensionsSourceCode · src/core/math.js L377–385probeprobes/idle-costs/antimatter-dimensions.mjs - ^Outside challenges, a Big Crunch (Infinity, the first prestige reset) unlocks when this Infinity's peak antimatter reaches
Decimal.NUMBER_MAX_VALUE, the cost threshold's ≈ 1.8 × 10³⁰⁸. T3IvarK/AntimatterDimensionsSourceCode · src/core/player.js L942–947 - ^The
dimCostMultupgrade (“Reduce post-infinity Antimatter Dimension cost multiplier scaling”) lowers by 1 per purchase, at most 7 times, to 3 before Eternity Challenge 6; it costs Infinity Points. T4IvarK/AntimatterDimensionsSourceCode · src/core/secret-formula/infinity/break-infinity-upgrades.js L116–128, L3–9, src/core/break-infinity-upgrades.js L21–36probeprobes/idle-costs/antimatter-dimensions.mjs - ^Tickspeed upgrades use the same class per purchase, not per 10: with bought, the next costs antimatter up to the
Number.MAX_VALUEthreshold (306 purchases), and past it their own factor,Player.tickSpeedMultDecrease(10 without upgrades), applies. T4IvarK/AntimatterDimensionsSourceCode · src/core/tickspeed.js L154–161, L150–152, src/core/cache.js L60–63probeprobes/idle-costs/antimatter-dimensions.mjs - ^“Buy until 10” charges price × purchases left in the set (
costUntil10), exact since the price is flat within a set. T3IvarK/AntimatterDimensionsSourceCode · src/core/dimensions/antimatter-dimension.js L388–390, L227–242 - ^ abMax-buy (
getMaxBought) counts the whole sets affordable but charges only the most expensive set × 10, about 0.1% under the sum at ×1,000 per set. T4IvarK/AntimatterDimensionsSourceCode · src/core/math.js L387–429, src/core/dimensions/antimatter-dimension.js L320–331probeprobes/idle-costs/antimatter-dimensions.mjs - ^A long bulk purchase whose price grows by a factor of per item costs about times its last price. T4Cookie Clicker main.js v2.058 · main.js L8096–8105IvarK/AntimatterDimensionsSourceCode · src/core/math.js L387–429probe
probes/idle-costs/growth-math.mjs - ^Pecorella, crediting the AdCap wiki, gives AdVenture Capitalist's Lemonade Stand growth 1.07, base cost 4, and 1.67/s each; with the first free, the price is . T2Pecorella 2016
- ^A hut costs wood, with already built, up to 20 huts (11,500 wood for all 20). T4doublespeakgames/adarkroom · script/room.js L43–58probe
probes/idle-costs/a-dark-room.mjs - ^A trap costs wood, and at most 10 can be built. T4doublespeakgames/adarkroom · script/room.js L13–28probe
probes/idle-costs/a-dark-room.mjs - ^The build action does nothing at the item's maximum count, so the cap, not the price, ends each building's run. T3doublespeakgames/adarkroom · script/room.js L1025–1027
- ^Each hut adds room for 4 villagers; the maximum population is huts × 4. T3doublespeakgames/adarkroom · script/outside.js L177–179, L11
- ^The changelog dates the launch to 8 August 2013; Orteil says he made the original “in a couple hours, for laughs”. T2Cookie Clicker main.js v2.058 · main.js L2020–2021
- ^ abcThe original (13 August 2013 capture) set each new price to , compounding the rounding: the 51st Cursor cost 2,283, not the unrounded 1,761. T4Cookie Clicker, 13 Aug 2013 capture · index.html L503–512probe
probes/idle-costs/cookie-clicker.mjs - ^By v1.035 (captured 10 September 2013), the price was via the same
Game.priceIncrease, still unrounded. T3Cookie Clicker main.js v1.035 · main.js L1836, L1871–1876 - ^doublespeak games announced A Dark Room as “a minimalist text adventure” in a blog post dated 10 June 2013. T2Townsend 2013
- ^The About screen says Finnish developer Hevipelle began the game as a solo project in 2016, later expanded by a large team. T2IvarK/AntimatterDimensionsSourceCode · src/components/modals/InformationModal.vue L23–24
- ^The changelog's 24 August 2013 “big update!”, which “revamped the whole game (new graphics, new game mechanics)”, falls between the 1.1 and 1.15 captures. T2Cookie Clicker main.js v2.058 · main.js L2014–2015
Sources
Code
- Kerajärvi), Hevipelle (Ivar and Antimatter Dimensions contributors. 2026. “Antimatter Dimensions source code.” Commit 5409e32. IvarK/AntimatterDimensionsSourceCode @ 5409e32 · licence, all uses
- games), Michael Townsend (doublespeak and A Dark Room contributors. 2025. “A Dark Room source code.” Commit 1fada46. doublespeakgames/adarkroom @ 1fada46 · licence, all uses
Primary
- Pecorella, Anthony. 2016. “The Math of Idle Games, Part I.” Kongregate Developers Blog. Kongregate. original · archived · licence, all uses
- Townsend, Michael. 2013. “A Dark Room released.” doublespeak games blog. doublespeak games. original · archived · licence, all uses