Re-do dice rolling algo
Vlek opened this issue · 2 comments
Currently the algorithm for rolling a dice takes a given number of dice to roll and a number of sides for the dice and creates that many random numbers and sums them all up.
Example:
3d6 == Sum of 3 random numbers between range 1 to 6.
Instead, as this can be extremely inefficient at higher rolls, we should do a weighted distribution and randomly choose.
Example:
10d6 == A number between 1 and 6 where the entries are weighted to account for the fact that we are rolling 10 dice.
While this would be more efficient, it would not work with debug messages when users want to see what each individual roll is. This means that this could only be used in the case where debug is false. While that does not totally rule out this feature enhancement, it does cut down on its usefulness.
This is going to be improbable to do after adding in re-roll, keep, and drop notations. I am going to close this because I cannot foresee a way of adding this that wouldn't cause all sorts of weird edge-case issues where special processing is going to occur that would be a testing nightmare.