Anahkiasen / cookie-monster

A rehosted, cleaned up and updated version of the CookieMonster plugin.
31 stars 24 forks source link

Wrinklers stats fix #6

Open lucabondi opened 10 years ago

lucabondi commented 10 years ago

First of all, great addition. Very useful.

The Cookies Sucked stat is miscalculated. The "up to 6x stacking effect" of wrinklers is counted in here, while it should be counted in the Reward of Popping stat only.

As you can see, no matter how many wrinklers you have on screen, the Reward of popping stat is always 1.1x the Cookies sucked... which is the benefit of a single wrinkler.

Hope i've explained myself. :)

Anahkiasen commented 10 years ago

Well I don't think so, the "Cookies sucked" calls CookieMonster.getWrinklersSucked() which just returns the plain number of cookies sucked, without any modifier.

Then the value of the rewards are calculated as I see them in the original code which is the 1.1 modifier is applied to each wrinkler separately and not to the total. Or am I not getting you ?

lucabondi commented 10 years ago

I don't pretend to be right against the code. XD

I'll explain how i get there... of course i might be wrong somewhere.

First, as the first wrinkler was approaching, i cheated 0 cookies to bank. So the the cookie in bank and the cookie sucked both start from 0.

Then i let the game run for 52 minutes (i wanted to make an hour, but i had to leave. XD) without clicking golden cookies or reindeer.

cookie sucked

As you can see from the screenshot, i'm running at 3.942 T CpS. So after 52 min, or 3120 sec, WITH NO WRINKLERS i should have 12.299 Qa in bank.

But i have 6.588 Qa... so the cookies actually sucked by the wrinklers are 5.711 QA... while CM says that the cookie sucked by the wrinklers are 54.989 Qa.

And since the Reward of popping stat is correct... something is wrong.

SyDr commented 10 years ago

From Wiki:

The number of cookies sucked away by a Wrinkler is equal to the total amount your CpS is Withered. If multiple Wrinklers are present, the Wither rate is increased from 5% to 10%, 15%, etc, up to a maximum of 50%. Each wrinkler considers the full Wither rate to be the rate that it sucks at, not just its individual 5%, for the purposes of calculating how many cookies you receive when popped.

See: http://cookieclicker.wikia.com/wiki/Wrinkler

lucabondi commented 10 years ago

"The number of cookies sucked away by a Wrinkler is equal to the total amount your CpS is Withered. If multiple Wrinklers are present, the Wither rate is increased from 5% to 10%, 15%, etc, up to a maximum of 50%."

This proves my point.

"Each wrinkler considers the full Wither rate to be the rate that it sucks at, not just its individual 5%, for the purposes of calculating how many cookies you receive when popped."

This proves Anahkiasen's point.

I guess there's nothing he can do about that. Case closed. ;)

Anahkiasen commented 10 years ago

More importantly – I don't compute anything regarding how many cookies a Wrinkler sucked : I get the statistic directly from the wrinklers themselves because it's stored on them, and that's the statistic used when popping them in the original code. Which is why I'm so confused as to why that number would be wrong.

lucabondi commented 10 years ago

The number is wrong because it's not the real number of cookies sucked.

You can try my experiment in the previous post... or you can do another one even more simpler... load the same game in 2 browsers, then enter an auto-pop-wrinkler code in one of them. Wait awhile and you'll see that the difference between the 2 games it's not what the cookie sucked stat tells you.

But in the end, from a gameplay standpoint the stat that matters is Reward of popping... Cookie sucked is just an info. Nobody is asking you to compute formulas, so don't lose your mind over this. :D

BenByington commented 10 years ago

I'm not here to hound you. If you no longer care about this issue, then just ignore this post:)

What exactly is meant by "cookies sucked", "reward of popping" and "benefit of popping"? (I'm going to call them C, R and B below)

-There are two ways you can interpret the name behind C -- it is either the amount of cookies lost, i.e. not directly entering your bank while at least one wrinkler is feeding, or it is the number of cookies that are currently being stored by the wrinklers, which includes the odd multipliers that occur when there are multiple wrinklers. I'd argue that the first is more intuitive, but I do understand that Orteil uses the second in his code. However, I think that it is the fact that Orteil does not use the intuitive interpretation that causes the confusion here.

-R is fairly self-explanatory, being the number of cookies added to your bank if you pop all current wrinklers.

-B almost sounds like a synonym to the last metric. I assume this is meant to be a true measure of profit, where you are including the opportunity cost of your decreased cps while you are withered.

So, on to the crux of the matter. If B is meant to be "cookies gained from popping" minus the "cost of having kept wrinklers around", then it should NOT be B = R - C because that is not how you currently have C defined. If you redefine C to actually measure the amount of cookies wrinklers prevent from directly entering your bank rather than the number of cookies stored by the wrinklers, then it would be correct.

If B is not meant to be a measure of profit considering opportunity costs, then I really have no clue what these stats are supposed to indicate.

lucabondi commented 10 years ago

C is the number of cookie stored by the wrinklers... Orteil fooled us with his code. XD R is C x 1.1 which is the benefit of a single wrinkler. So in the end B is R - C.

BenByington commented 10 years ago

Sorry, I might not have been clear. I know what formulas you used -- I dug those out of the code before coming here -- I wanted to know what these quantities are supposed to mean for you. Lucabondi started this thread because this trinity of variables makes no sense. Either C should be defined instead as the cookies you lose, not the cookies stored by the wrinklers, or B should be something other than R-C, or B is not a measure of the profit in which case it is completely unclear what the number you are calculating there is.

Edit: I just realized I was conversing with lucabondi instead of Anahkiasen. My points stand, but apologies for the confusing delivery!

davidgro commented 10 years ago

I have a proposal. Let's call the amount that doesn't make it into my bank the "Cookies withered" to match the CPS stat. Cookies withered and sucked are widely different when there is more than one wrinkler because they don't obey Conservation of Cookies.

Anahkiasen, is it possible to track cookies withered as the number of wrinklers changes? it would be a more useful stat than sucked (which is just reward/1.1) and could make the Benefits of popping stat show the actual difference between having them and not. (for comparsion to to say Pledging)

Anahkiasen commented 10 years ago

Whatever you guys think is better than this I mean, I just put this as a starting point but if we all agree there is more interesting stats to display I'm all for it. Would you be willing to make a PR for this or ?

davidgro commented 10 years ago

If you are asking me specifically, I am kinda new to Github and don't know what that means, sorry.

SyDr commented 10 years ago

@davidgro, it seem there is no good way to count withered cookies (i.e. no way to count withered cookies by number of sucked cookies).

One possible variant is to add counter especially for this stat. But if you load Cookie Monster after first appearing wrinkler - stat will be incorrect. Do you accept this?

Anyway, i think, in current version "Cookies sucked" and "Benefits of popping" are useless stats.

davidgro commented 10 years ago

@SyDr I figured it might be like that.
Such a counter should work fine if on load when CM detects a wrinkler already present, in the stats for withered cookies it says something to the effect of 'pop all wrinklers to start counting'

While we are at it, would a small tooltip for each wrinkler showing cookies if popped be feasible?

Thanks!

SyDr commented 10 years ago

I made this. But it's doesn't looking good (code). Can someone give any tips? 80e6673647d0127c75b407c805b38f94542c0f71 (+ forgot about cookie-monster.js 6a51b59cb9b083a876c694276d7ce5ca37a862db)

2014-02-18 20 32 31 2014-02-18 20 33 29

davidgro commented 10 years ago

Looks good to me, I'll admit I was expecting to see the 6x factor appear, but that's of the base CPS not the withered part, both ways of counting that seem equally valid to me.