OK so if your game rolls lots of dice you can just call a random number generator in a loop. But for any set of dice being rolled often enough you will get a distribution curve/histogram. So my question is there a nice simple calculation I can run that will give me a number that fits that distribution?
E.g. 2D6 - Score - % Probability
2 - 2.77%
3 - 5.55%
4 - 8.33%
5 - 11.11%
6 - 13.88%
7 - 16.66%
8 - 13.88%
9 - 11.11%
10 - 8.33%
11 - 5.55%
12 - 2.77%
So knowing the above you could roll a single d100 and work out an accurate 2D6 value. But once we start with 10D6, 50D6, 100D6, 1000D6 this could save a lot of processing time. So there must be a tutorial / method / algorithm that can do this fast? It is probably handy for stock markets, casinos, strategy games, dwarf fortress etc. What if you could simulate the outcomes of complete strategic battle that would take hours to play with a few calls to this function and some basic maths?
No comments:
Post a Comment