Cookie Clicker

Cookie Clicker

Chips Per Second
42 条留言
Quazillionaire  [作者] 2024 年 9 月 20 日 下午 2:14 
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  [作者] 2024 年 9 月 19 日 下午 8:29 
@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  [作者] 2024 年 9 月 19 日 下午 8:29 
[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  [作者] 2024 年 4 月 28 日 上午 10:06 
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  [作者] 2024 年 4 月 27 日 上午 8:56 
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  [作者] 2024 年 4 月 27 日 上午 8:56 
[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  [作者] 2024 年 4 月 27 日 上午 8:55 
[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  [作者] 2024 年 4 月 22 日 下午 12:07 
@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  [作者] 2024 年 4 月 22 日 上午 10:13 
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  [作者] 2024 年 4 月 17 日 上午 1:59 
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 2023 年 9 月 30 日 下午 8:54 
Works, thank you
Beano 2022 年 12 月 27 日 下午 3:35 
Doesn't work, 0/10
Araranguá Gameplays 2022 年 9 月 3 日 下午 6:38 
good
Valley_Foods 2022 年 8 月 3 日 下午 3:53 
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 2022 年 8 月 3 日 下午 3:50 
this does work, why do comments lie
bmacdonald808 2022 年 7 月 27 日 下午 5:20 
Doesn't work
SirSephy 2022 年 7 月 24 日 上午 12:05 
it didn't work
PinkPlinko 2022 年 6 月 28 日 下午 12:54 
@Quazillionaire i have done that multiple times, through multiple pc restarts as well, and still no luck.
Quazillionaire  [作者] 2022 年 6 月 28 日 上午 11:42 
@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 2022 年 6 月 28 日 上午 11:21 
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  [作者] 2022 年 6 月 26 日 下午 8:22 
@Quinfish can you send a screenshot? I'm not seeing that happening.
Quinvincible 2022 年 6 月 24 日 上午 6:35 
Seems like it show double the amount than that i'm actually getting?
Quazillionaire  [作者] 2022 年 6 月 21 日 下午 8:22 
If you have any heavenly chips, they will be shown next to the Legacy button.
Las Biquettas 2022 年 6 月 21 日 上午 5:03 
where do the chips show ?
Quazillionaire  [作者] 2022 年 6 月 20 日 下午 10:49 
You'll get there eventually! I'm currently making over 100 million chips per second. :P
shy 2022 年 6 月 20 日 下午 10:16 
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  [作者] 2022 年 6 月 19 日 下午 7:16 
Thank you so much for your kind words, HUMANKIND'S SWOLLEN PLACENTA and 𝒸𝓊𝓂𝓈𝒽𝑜𝓉 :P
:p 2022 年 6 月 19 日 下午 6:43 
This is something I didn't know I needed until now
The Snitch of Izalith 2022 年 6 月 18 日 下午 5:17 
This is so convenient, thank you for making it!
Quazillionaire  [作者] 2022 年 6 月 17 日 下午 11:13 
@CB1000X I updated it so it formats according to the user's "Short Number" preference
Quazillionaire  [作者] 2022 年 6 月 17 日 下午 6:39 
@Lovey Make sure you have enabled the mod in the Mod menu. Under the "Manage Mods" button.
Wheezing 2022 年 6 月 17 日 下午 4:05 
10/10
Lovey 2022 年 6 月 17 日 下午 3:15 
This mod looks great but idk if i did something wrong but it wont show when i subscribed and launched cookie clicker?
Erbkaiser 2022 年 6 月 17 日 下午 1:12 
Great mod.
Quazillionaire  [作者] 2022 年 6 月 16 日 下午 3:57 
@CB1000X Yeah, that shouldn't be too hard. I'll give it a look this weekend.

Glad everyone is finding it useful!
Chikamae 2022 年 6 月 16 日 下午 3:30 
this is much better :D
Flaming Ninja 2022 年 6 月 16 日 上午 11:49 
Should be in the base game.
CB1000X 2022 年 6 月 16 日 上午 6:53 
Also, awesome mod, thx for making it :winter2019happyyul:
CB1000X 2022 年 6 月 16 日 上午 6:52 
@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 2022 年 6 月 15 日 下午 11:34 
amazing mod, thanks !
Quazillionaire  [作者] 2022 年 6 月 14 日 下午 5:13 
@TheRepSter No, it uses the current CpS rate as seen above the big cookie.
TheRepSter 2022 年 6 月 14 日 下午 1:58 
Does the calculation count the chips generated by clicks that the user (or auto clicker) makes?