the random number generator
Moderator: Event DM
- Malathyre
- Sage
- Posts: 2079
- Joined: Wed Sep 24, 2003 8:47 pm
- Location: Michigan, U.S.A. (GMT-5)
- Contact:
the random number generator
Out of curiousity, does anyone know how this thing really works? I'm not interested in the d20 rolls anymore, I figure the RNG does a good enough job of randomly generating a number between one and twenty. I am curious how it does the dice rolling for other dice, however. Specifically, let's say you have an ability that rolls 4d10 damage. My suspicion is that the random number generator assigns equal probability to all numbers between 4 and 40 for this dice set...even though all numbers rollable by 4d10 most certainly do NOT have equal probability of being rolled.
Translation: I've seen my character's wyrmling form roll 40 for damage on her 4d10 breath weapon. More than once. I've also seen her roll 4 more than once...I highly suspect it is because all numbers between 4 and 40 were assigned equal probably by the RNG, but I have no idea where to look or how to figure this out.
It's not important at all and I don't care if is just generating a number between 4 and 40 and not really taking into account the type of "dice". I was just curious if anyone knew how this thing worked for sure. Thanks!
Translation: I've seen my character's wyrmling form roll 40 for damage on her 4d10 breath weapon. More than once. I've also seen her roll 4 more than once...I highly suspect it is because all numbers between 4 and 40 were assigned equal probably by the RNG, but I have no idea where to look or how to figure this out.
It's not important at all and I don't care if is just generating a number between 4 and 40 and not really taking into account the type of "dice". I was just curious if anyone knew how this thing worked for sure. Thanks!
"The stars predict tomorrow you'll wake up, do a bunch of stuff, and then go back to sleep!"--Your Horoscope for Today, Weird Al Yankovic
- Malathyre
- Sage
- Posts: 2079
- Joined: Wed Sep 24, 2003 8:47 pm
- Location: Michigan, U.S.A. (GMT-5)
- Contact:
Thanks, dougnoel. I'm no statistician, but the odds of rolling all 10's on 4d10 are not good...and I've seen it happen more than once in game. Sometimes, it is more fun if those random numbers are a bit less random. 

"The stars predict tomorrow you'll wake up, do a bunch of stuff, and then go back to sleep!"--Your Horoscope for Today, Weird Al Yankovic
- ReallyStupidGuy
- Scholar of Fools
- Posts: 435
- Joined: Sun Sep 26, 2004 1:44 am
- Location: VA
- Contact:
- tindertwiggy
- Legacy DM
- Posts: 6905
- Joined: Tue Jul 16, 2002 12:20 am
- Location: Newish England
- Contact:
- Dirk Cutlass
- Elder Sage
- Posts: 4691
- Joined: Mon Jan 27, 2003 9:42 am
- Location: GMT
I thought Spellsinger or someone did some work on this before ... maybe I'll dig it out.dougnoel wrote:It's rolling 4d10, it's using the d10() function. wE can only guess at the implementation. However, my guess is that Bioware skews the output to make things seem more heroic. Basically it grades on a curve...
Personally, I don't think they deliberately skewed the output on some curve. I just think they implemented it badly...
Linear Congruential Generators, which are the norm for pseudo-random number generators on computers are notoriously un-random in their lower order bits. My bet is that when they "scale" the number to make it a d10 or d20 or whatever, they used modulo function "%" rather than doing a proper scaling. The former is more common practise for a "C" programmer, e.g. when you want to limit the range of a variable x you do "x = x % N" or something.
But the modulous means that lower-order bits are used.. which as I mentioned before are not very random, so lots of 1,1 and 20, 20 and other such combos occuring more than they should do.
The effect of this may be to make it seem "more heroic", but I think that's just the way it seems. I doubt that Bioware really thought of it, and its just like it is because of their lack of understanding of pseudo-randomness.
Of course this is just speculation

(If any Bioware s/w programmer is reading this... feel free to put us all straight!)
EDIT:
Actually the odds are 1 / (10 x 10 x 10 x 10) = 1 / 10000Malathyre wrote:I'm no statistician, but the odds of rolling all 10's on 4d10 are not good...