Giter VIP home page Giter VIP logo

Comments (4)

Aktanusa avatar Aktanusa commented on July 24, 2024

Hmm indeed this might be hard. Are you saying to show what is the chance to get something which changes to be lower as more of it has been already unlocked?

from cookiemonster.

Treazer avatar Treazer commented on July 24, 2024

Yeah, all of that stuff. It should say the chances for getting for instance a common Easter egg from both wrinklers and golden/wrath cookies and it has to calculate everything changing the chances, i.e. you've already unlocked some of the eggs, you've got upgrades or achievements increasing chances for random drops etc.

from cookiemonster.

svschouw avatar svschouw commented on July 24, 2024

The calculations really are not that hard. Christmas and halloween cookies work exactly the same, only easter eggs are a bit harder.

You take the base fail rate and multiply with a bunch of multipliers based on unlocks (can easily be found in the source; lookup "halloween cookie drops" and "seasonPopup.spawn"). Then take pSucces = 1 - failrate. After that the chance to unlock a new cookie is pSuccess * (1 - have/total).

As for easter eggs the calculations are as follows (for failRate calculations lookup "DropEgg" in the source):
Chance of normal drop first chance:
pNormal1 = pSuccess * 0.9 * (1 - nHaveNormalEggs/nNormalEggs)

Chance of rare drop first chance:
pRare1 = pSuccess * 0.1 * (1 - nHaveRareEggs/nRareEggs)

Chance to get redrop
pRedropNormal = pSuccess * 0.9 * (nHaveNormalEggs/nNormalEggs)
pRedropRare = pSuccess * 0.1 * (nHaveRareEggs/nRareEggs)
pRedrop = pRedropNormal + pRedropRare

Change of normal drop 2nd chance
pNormal2 = pRedrop * 0.9 * (1 - nHaveNormalEggs/nNormalEggs)

Change of rare drop 2nd chance
pRare2 = pRedrop * 0.1 * (1 - nHaveRareEggs/nRareEggs)

Chance of normal drop:
pNormal = pNormal1 + pNormal2

Chance of rare drop:
pRare = pRare1 + pRare2

I could probably make a branch and do a pull request.

from cookiemonster.

Aktanusa avatar Aktanusa commented on July 24, 2024

I'll get my head around this in a bit, too early in the morning =p

from cookiemonster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.