If there is any topic talking about this and SOLVING it please redirect me to it.
The issue i’m facing is basically that i need to have decimal probability(chances), something like 0.27% or 66.8%.
A way i found was the weighted method but its really one of the worst and it doesn’t have decimals , the other ways were bunch of complicated algebra that I couldn’t understand since there were no explanation to it.
After thinking about this issue for a while i came up with some sort of a trick to solve it but I don’t think its the best for performance and here is the explanation for it:
Before i get into the logic you need to know that if you multiplied a percent with another percent your basically getting the first percent out of the second one, for example 10% * 1% is 0.1% so here is the logic for it,
I basically have two chances, The first one is the chance of the item existing in the box and the second chance is the chance of getting it from the box if it existed in the first place so basically the first chance HAS to come true so that the second CAN come true,
so basically if i want 0.1% chance all i do is have the first table containing 10 elements and one of them is different than the 9 rest and if that different element was picked then i will put one copy of the item in the chest which contains 100 elements so the chance of pulling that item each time you do the calculation is the chance of the first table 1/10 which is 10% multiplied by the chance of the second table which is 1/100 which is 1% so the full calculation is (1/10) * 100 * (1/100) so its 0.1%,
As i said this prob takes a lot of resources specially if each player will be afk opening chests so i hope you guys can help, a perfect example of this system is the one used in ANIME FIGHTERS SIMULATOR Made by daireb.