mculig / TemtemTracker

A tracker for the MMO Temtem
GNU General Public License v3.0
30 stars 14 forks source link

How do you calculate the "Chance Luma"? #5

Closed julianpoemp closed 4 years ago

julianpoemp commented 4 years ago

I'm thinking about the values your application is calculating. Isn't the formula to calculate the chance something like this:

chance = 1/(8000 - x) * multiplier

where x is the number of encouters.

If I calculate it using your application with 36 Encouters and multiplier 1, I get the chance 0,45%. If I'm using my formular I get 0,1%.

julianpoemp commented 4 years ago

Ok, I think my formula is wrong. You calculate using this formula

chance = encounters (1/8000) multiplier

that produces more realistic results than my formula. Further more if I hit the 8000 encounters the result of my formula would be undefined because division through 0 :D

mculig commented 4 years ago

The formula is the cumulative distribution function of the geometric distribution. https://en.wikipedia.org/wiki/Geometric_distribution

You can see it here: https://github.com/mculig/TemtemTracker/blob/master/TemtemTracker/Controllers/LumaChanceCalculator.cs#L24