Cookie Clicker

Cookie Clicker

Chips Per Second
42 Comments
Quazillionaire  [author] 20 Sep, 2024 @ 2:14pm 
hey @z , I assure you the issue is not whether or not your code is good or functional, I'm sure it is. I've just been busy, I moved a couple months ago, my job changed, and my spare time for personal projects has been minimal. I still have the discussion post you made bookmarked, and I'll set aside some time this weekend to integrate your work into the mod. Thanks again for the helpful contribution.
z  [author] 19 Sep, 2024 @ 8:29pm 
@Quazillionaire, it's now been five months since I made my posts and released my corrected version of Chips per Second. I have run it for hundreds of hours in all sorts of situations, and I have never seen even the tiniest bug. I have Cookie Monster installed, and the number reported by my version of the mod always exactly matches that reported in the last line of the popup produced by Cookie Monster when hovering the cursor over the Legacy button. The algorithm I use for determining this number is also much simpler (and more reliable) than the original algorithm, as it simply reports the difference between the current prestige level and the prestige level from one second previously.
z  [author] 19 Sep, 2024 @ 8:29pm 
[continued]
As a professional software engineer with decades of experience, I can assure you that this mod now works as well as possible given the intrinsic limitations of JavaScript floating point and the algorithm that Orteil uses to calculate new prestige. The perfect match of this mod's output with that of Cookie Monster, which was derived independently, is strong evidence of this. Do you want to update your mod with my revised version, which I've linked to in the post below? Otherwise, I'd like to simply publish a fork of your mod containing my changes. Please let me know what you'd like to do.
z  [author] 28 Apr, 2024 @ 10:06am 
I have now finished my work on the mod, thoroughly tested it, documented it, and made it available. You can find the full documentation for my changes in the Discussion Revised Version of Chips Per Second (1.4). For future reference, this Discussion can also be reached via the Discussions tab at the top of this page.

If you haven't read the following three posts of mine, you can skip them, as they are included in the new Discussions thread.
z  [author] 27 Apr, 2024 @ 8:56am 
After still more research, I have finally pinned down the problem definitively, and I have designed and mostly implemented a fix for it. I expect to have the whole thing finished within a few days.

It turns out that this was not a precision problem after all. In fact, the zero result for chips per second is completely correct! The fact that the mod would flash out of existence whenever the CPS was zero through me off a bit, but it was easy to see why it was doing that, and I fixed it.

The reason that zero is the proper result in many cases has to do with the ubiquitous presence of exponential growth throughout Cookie Clicker, combined with the fact that the rate of exponential growth varies greatly depending on what quantities are being examined.
z  [author] 27 Apr, 2024 @ 8:56am 
[continued]
if you look at the Wiki section Calculating Heavenly Chips, [cookieclicker.fandom.com] you see at the line that starts "Heavenly Chips = " that to find out how many heavenly chips you get from a certain number of cookies, you divide the number of cookies by a trillion and then take the cube root of that result. (This is explained slightly differently earlier on the Wiki page.) The cube root function is the killer here, especially as the number of cookies always includes all the cookies you have ever baked, even across ascensions.
z  [author] 27 Apr, 2024 @ 8:55am 
[continued]
What is happening here is that as the total number of heavenly chips rises, a given amount of cookies will produce fewer heavenly chips. This is easily noticeable. At some point, the number of CPS falls below one, and so it is reported as zero. If you have Cookie Monster installed, you can verify this by looking at the bottom of the tooltip that appears when you hover the cursor over the Legacy info.

The mod was also calculating the number of cookies somewhat incorrectly, and I have fixed this.

Once my work on the mod is finished and ready for release, I'll post a brief notice here and point to a thread in the Discussions area, where I will explain the details.
Quazillionaire  [author] 22 Apr, 2024 @ 12:07pm 
@z Good catch, and I appreciate you sleuthing that out. I unfortunately don't have a lot of time at the moment to spend fixing it, but if it tickles your fancy you'd be welcome to make a pull request (https://github.com/quazillionaire/cookie-clicker-mods) . Otherwise, I will make a note and dig into it eventually. Thanks!
z  [author] 22 Apr, 2024 @ 10:13am 
A little more research has shown that the most likely problem is that this mod is falling victim to the limitations of JavaScript floating number precision. This would explain why this problem appears later in the game, as cookie numbers get much bigger and the difference between various numbers in the game increases.

JavaScript numbers start to break when their absolute value exceeds about 9 quadrillion. Not only are numbers of this size not uncommon in Cookie Clicker, but this seems to roughly correspond to the range where this mod stops working. Further research is necessary, and I will see what I can find. If this is indeed the problem, there are workarounds.

Edit: Sure enough, that's the problem. One number adds a number that is 15 orders of magnitude smaller than it, and then subtracts the first number from the second. The result is (incorrectly) computed to be zero, and so nothing is displayed.
z  [author] 17 Apr, 2024 @ 1:59am 
I noticed that this mod works in the early stages of the game, but then the box and its contents start flickering on and off sometime when the number of chips is in the millions, and shortly after that, the box and its contents disappear for good.

I've taken a brief look at the code, and I found that when the box does not appear, the crucial routine chipsPerSec() always returns zero. This is clearly incorrect. I've recently learned a bit about how prestige works, so I'll take a look soon and see if I can find a quick fix. (From a quick look, the current code for chipsPerSec() does not look correct.) I'll try to get back with a fix soon.
wandering 30 Sep, 2023 @ 8:54pm 
Works, thank you
Beano 27 Dec, 2022 @ 3:35pm 
Doesn't work, 0/10
Araranguá Gameplays 3 Sep, 2022 @ 6:38pm 
good
Valley_Foods 3 Aug, 2022 @ 3:53pm 
my only complaint is that it sometimes blocks the news and i like those, but i don't know it it could be fixed but i can live with it
Valley_Foods 3 Aug, 2022 @ 3:50pm 
this does work, why do comments lie
bmacdonald808 27 Jul, 2022 @ 5:20pm 
Doesn't work
SirSephy 24 Jul, 2022 @ 12:05am 
it didn't work
PinkPlinko 28 Jun, 2022 @ 12:54pm 
@Quazillionaire i have done that multiple times, through multiple pc restarts as well, and still no luck.
Quazillionaire  [author] 28 Jun, 2022 @ 11:42am 
@Pink There is no heavenly upgrade, it should just work. I'm not sure what's happening there. I'd recommend making sure the mod is enabled, then "Save & Quit" and boot up the game again.
PinkPlinko 28 Jun, 2022 @ 11:21am 
i can't figure out how to get the mod to work, even with this as the only mod i have and at top priority. is there a heavenly upgrade i need to be able to see this stat, or am i missing something else?
Quazillionaire  [author] 26 Jun, 2022 @ 8:22pm 
@Quinfish can you send a screenshot? I'm not seeing that happening.
Quin🐟 24 Jun, 2022 @ 6:35am 
Seems like it show double the amount than that i'm actually getting?
Quazillionaire  [author] 21 Jun, 2022 @ 8:22pm 
If you have any heavenly chips, they will be shown next to the Legacy button.
Las Biquettas 21 Jun, 2022 @ 5:03am 
where do the chips show ?
Quazillionaire  [author] 20 Jun, 2022 @ 10:49pm 
You'll get there eventually! I'm currently making over 100 million chips per second. :P
shy 20 Jun, 2022 @ 10:16pm 
i gain about 1 heavenly chip a day... am i doing something wrong? how on earth do you get chips so often that you need a per second counter?
Quazillionaire  [author] 19 Jun, 2022 @ 7:16pm 
Thank you so much for your kind words, HUMANKIND'S SWOLLEN PLACENTA and 𝒸𝓊𝓂𝓈𝒽𝑜𝓉 :P
Andrés 19 Jun, 2022 @ 6:43pm 
This is something I didn't know I needed until now
The Snitch of Izalith 18 Jun, 2022 @ 5:17pm 
This is so convenient, thank you for making it!
Quazillionaire  [author] 17 Jun, 2022 @ 11:13pm 
@CB1000X I updated it so it formats according to the user's "Short Number" preference
Quazillionaire  [author] 17 Jun, 2022 @ 6:39pm 
@Lovey Make sure you have enabled the mod in the Mod menu. Under the "Manage Mods" button.
Wheezing 17 Jun, 2022 @ 4:05pm 
10/10
Lovey 17 Jun, 2022 @ 3:15pm 
This mod looks great but idk if i did something wrong but it wont show when i subscribed and launched cookie clicker?
Erbkaiser 17 Jun, 2022 @ 1:12pm 
Great mod.
Quazillionaire  [author] 16 Jun, 2022 @ 3:57pm 
@CB1000X Yeah, that shouldn't be too hard. I'll give it a look this weekend.

Glad everyone is finding it useful!
Chikamae 16 Jun, 2022 @ 3:30pm 
this is much better :D
Flaming Ninja 16 Jun, 2022 @ 11:49am 
Should be in the base game.
CB1000X 16 Jun, 2022 @ 6:53am 
Also, awesome mod, thx for making it :winter2019happyyul:
CB1000X 16 Jun, 2022 @ 6:52am 
@Quazillionaire Would it be possible to add a simplification of the Chips per second amount? like
instead of 26,311,970/sec it would be 26.31M/sec
spoon licker 15 Jun, 2022 @ 11:34pm 
amazing mod, thanks !
Quazillionaire  [author] 14 Jun, 2022 @ 5:13pm 
@TheRepSter No, it uses the current CpS rate as seen above the big cookie.
TheRepSter 14 Jun, 2022 @ 1:58pm 
Does the calculation count the chips generated by clicks that the user (or auto clicker) makes?