04-21-2014, 04:23 AM
You might want to consider changing how the Chance is used, similar to how the weights for Enchantments or for Prefabs are calculated in MCS. First all the "weights" are summed together, then a random number in range [0, Sum) is chosen. Then each item in the list is iterated and its weight subtracted from the random number. When the subtraction first becomes negative, that item is chosen.
This system is quite easy to grasp and easy to code, too. Say, you have Item1 with weight of 20, and Item2 with weight 1. Quite naturally you would expect that out of 210 generates items, approximately 200 will be Item1 and 10 will be Item2.
I have some mental trouble analyzing your system, how the chances work - if I want that 20:1 ratio, how do I set the chances?
This system is quite easy to grasp and easy to code, too. Say, you have Item1 with weight of 20, and Item2 with weight 1. Quite naturally you would expect that out of 210 generates items, approximately 200 will be Item1 and 10 will be Item2.
I have some mental trouble analyzing your system, how the chances work - if I want that 20:1 ratio, how do I set the chances?