v0.1 ⌊ALPHA⌉
On this page
  1. Prices
  2. History of the price rule
  3. Related
  4. References
  5. Sources

Cookie Clicker is a web incremental game by Orteil and Opti1. You click a cookie, then buy buildings that bake for you. It launched on 8 August 20132, reached Android in 20193 and Steam in 20214. Its web code is one unminified main.js, archived from the first weeks.

#Prices

Prices scale exponentially: each building owned multiplies the next of its kind by 1.155, one constant for all 20 buildings. Free buildings from prestige upgrades come off the exponent6. Discounts multiply in before the rounding7.

Only the Cursor keeps the 15 written into its definition; a formula on the index overwrites the rest8,9. It gives Grandma 100, Farm 1,100, Mine 12,000, and so on10. A sibling formula sets base production11, and a type’s output is its count times that rate12.

RuleWhereEvidence
×1.15 per one ownedGame.priceIncrease, main.js L79725
⌈base⋅1.15owned−free⌉getPrice, L8090–L809513
Buy 10 / 100 = geometric sum, rounded oncegetSumPrice, L8096–L810514
Purchase loops one at a time, each roundedbuy, L8125–L815215
Sell pays 25% of the next pricesell, L8156–L817616

Ten Grandmas from zero show 2,031 but cost 2,035, and one cookie short of the label still buys nine15. The sell label is 25% of the last building’s price, so the refund is about 15% more16.

#History of the price rule

The earliest capture, 13 August 2013, sets each new price to ⌈price×1.1⌉17,18. By v1.035, captured 10 September 2013, the rule was base×1.15n19. The changelog’s 24 August “big update!” falls between the two20. The 2014 legacy beta lists “price and CpS curves revamped”21.

References

  1. ^The game's About text credits it as “a javascript game by Orteil and Opti”. T2Cookie Clicker main.js v2.058 · main.js L1410
  2. ^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
  3. ^The changelog's 28 September 2019 entry announces the official Android version, with iOS to follow. T2Cookie Clicker main.js v2.058 · main.js L1553–1559
  4. ^ abThe changelog's 1 September 2021 entry announces the Steam release and says web and Steam will get the same updates. T2Cookie Clicker main.js v2.058 · main.js L1505–1507
  5. ^ abOne 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 Pricesprobe probes/idle-costs/cookie-clicker.mjs
  6. ^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
  7. ^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
  8. ^ abOnly the Cursor keeps its Game.Object constructor price; the formula overwrites the rest (the Farm's 500 becomes 1,100). T4Cookie Clicker main.js v2.058 · main.js L8003–8034, L9104probe probes/idle-costs/cookie-clicker.mjs
  9. ^Every building after the Cursor gets its base price from one formula on its index n: (n+9+5max⁡(0,n−5)1.75)×10n×max⁡(1,n−14), rounded to two significant figures. T4Cookie Clicker main.js v2.058 · main.js L8024–8031probe probes/idle-costs/cookie-clicker.mjs
  10. ^Base 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
  11. ^Base production before upgrades is 0.1 cookies/s for the Cursor, set in its own production function, and ⌈10⋅nn/2+2⌉/10 to two significant figures for building n: 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
  12. ^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
  13. ^A building's next price is ⌈basePrice×1.15max⁡(0,owned−free)⌉, 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
  14. ^The shown bulk price (getSumPrice) is the geometric sum b⋅ra⋅(rk−1)/(r−1), 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 Pricesprobe probes/idle-costs/cookie-clicker.mjs
  15. ^ abbuy() 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–8901probe probes/idle-costs/cookie-clicker.mjs
  16. ^ abEach 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
  17. ^The original (13 August 2013 capture) set each new price to ⌈price×1.1⌉, 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
  18. ^The original version's starting prices were Cursor 15, Grandma 100, Factory 500, Mine 2,000, Shipment 7,000, Alchemy lab 50,000, and Portal 1,000,000. T3Cookie Clicker, 13 Aug 2013 capture · index.html L521–582
  19. ^By v1.035 (captured 10 September 2013), the price was basePrice×1.15amount via the same Game.priceIncrease, still unrounded. T3Cookie Clicker main.js v1.035 · main.js L1836, L1871–1876
  20. ^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
  21. ^ abThe 25 August 2014 “legacy beta, part I” notes say “price and CpS curves revamped”. T2Cookie Clicker main.js v2.058 · main.js L1790–1792
  22. ^In v1.035, Game.Object sets each building's basePrice to the literal its definition passes, such as the Farm's 500. T3Cookie Clicker main.js v1.035 · main.js L1841–1851, L2114

Sources

Code

Primary

Secondary