By decault, it uses a Cryptograpically Secure Pseudorandom Number Generator (CSPRNG), specifically .NET's System.Security.Cryptography.RNGCryptoServiceProvider.
It gives good enough results to ensure dice rolls are not biased (one of the tests in my test suite is to perform 10 million rolls and ensure that each possible result is within 0.5% of a completely even distribution). Care has been taken to ensure there is no bias in the math operations (such as modulo) to finesse the result into the appropriate range.
It is possible to plug in a true RNG instead of using a CSPRNG, but I do not believe that the DDB staff have done so. They can correct me if I'm wrong 🙂
That would be a terrible idea and would not work. Random.org's API takes multiple seconds to request random numbers from, and the nature of D&D Beyond means that it would likely quickly both run into limits and run afoul of its API guidelines. Roll20 does not expose an externally-accessible API.
Short of DDB plugging in a hardware RNG, a CSPRNG provides nearly the same level of randomness. A normal PRNG is terrible and biased, but CSPRNG are crafted to remove the bias between grabbing multiple sets of numbers. You can still deterministically generate numbers if you know the seed, but these are seeded using a multitude of factors which would make it nearly impossible for you or anyone without a wide swath of information about the operating environment to figure out what it was seeded by.
Out of curiosity is there a way to take in to account things like improved crits (crit damage on 19 or 20) and/or crit damage in general (roll extra damage dice on a crit)
Out of curiosity is there a way to take in to account things like improved crits (crit damage on 19 or 20) and/or crit damage in general (roll extra damage dice on a crit)
The easiest way is to roll the attack, hit post, then edit the post based on what you rolled. If you want to do it all at once, something like the following should work:
(rolling to attack with a crit on 19-20, then rolling crit damage if the attack crit and normal damage otherwise). Assuming +4 to hit and 1d8+4 damage.
I roll to hit, [.roll]1d20cs>=19 + 4[./roll]! Damage: [.roll]if([roll:-1:critical], =0, 1d8+4, 2d8+8)[./roll]
Example (remove the . in front of roll and /roll): I roll to hit, 8! Damage: 10
(Spoiler has a dozen rolls in it to illustrate. The 5th one crit on a nat 19 and you can see that it rolled double damage)
Testing with improved crit and great weapon fighting style (2d6.reroll(<=2) + 3, 4d6.reroll(<=2) + 6)
13! Damage: 12
21! Damage: 12
21! Damage: 11
8! Damage: 12
15! Damage: 11
18! Damage: 12
23! Damage: 12
12! Damage: 10
25! Damage: 19
24! Damage: 25
11! Damage: 12
OOh that appears to have worked......I think sorta.....
[Maul: 19! Damage: 15]
Hmm well it mostly works - it still keeps rerolling 1's and 2's until it doesn't get them - and the rules state I have to take the re-roll whatever it may be (even a 1 or 2 again)
How do I use this function to calculate x to the power of y?
There is no exponentiation in the roller, so you would need to multiply x together y times. If y is unknown, then this will be a difficult if not impossible task, depending on what sort of properties you can assume about y.
Hmm well it mostly works - it still keeps rerolling 1's and 2's until it doesn't get them - and the rules state I have to take the re-roll whatever it may be (even a 1 or 2 again)
In that case you will want ro or .rerollOnce instead of rr/.reroll. For example, 2d6.rerollOnce(<=2)
12
DM | Dragon Heist: Hell of a Summer
Jasper Garrai - Aasimar Ranger/Cleric | The Dark Below
Hyacinth Hagsbane - Hexblood Ranger | Witchwood
Petra Pebblefoot - Svirfneblin Wizard | Tomb of Annihilation
So using the curly braces to group bundles everything together:
75
To roll stats, use six different [ roll ]4d6dl1[ /roll ] commands:
STR:14, DEX:11, CON:10, INT:13, WIS:12, CHA:14
Ardrik, Dwarven Barbarian
"Any society that would give up a little liberty to gain a little security will deserve neither and lose both" -- allegedly Benjamin Franklin
Tooltips (Help/aid)
Ardrik, Dwarven Barbarian
"Any society that would give up a little liberty to gain a little security will deserve neither and lose both" -- allegedly Benjamin Franklin
Tooltips (Help/aid)
No worries. All good. :)
Ardrik, Dwarven Barbarian
10
This will be the stats for my next custom character! <3
16 14 15 12 10 15
Love the UI. Very useful.
But where does the randomness come from? What does the engine feed off of?
Check out all my important links here.
May we live in Less Interesting Times
By decault, it uses a Cryptograpically Secure Pseudorandom Number Generator (CSPRNG), specifically .NET's System.Security.Cryptography.RNGCryptoServiceProvider.
It gives good enough results to ensure dice rolls are not biased (one of the tests in my test suite is to perform 10 million rolls and ensure that each possible result is within 0.5% of a completely even distribution). Care has been taken to ensure there is no bias in the math operations (such as modulo) to finesse the result into the appropriate range.
It is possible to plug in a true RNG instead of using a CSPRNG, but I do not believe that the DDB staff have done so. They can correct me if I'm wrong 🙂
I'm a computer programmer and an RPG purist. I don't trust pseudorandom for this.
Can't you plug in to Random.org or take Roll20's system?
Check out all my important links here.
May we live in Less Interesting Times
That would be a terrible idea and would not work. Random.org's API takes multiple seconds to request random numbers from, and the nature of D&D Beyond means that it would likely quickly both run into limits and run afoul of its API guidelines. Roll20 does not expose an externally-accessible API.
Short of DDB plugging in a hardware RNG, a CSPRNG provides nearly the same level of randomness. A normal PRNG is terrible and biased, but CSPRNG are crafted to remove the bias between grabbing multiple sets of numbers. You can still deterministically generate numbers if you know the seed, but these are seeded using a multitude of factors which would make it nearly impossible for you or anyone without a wide swath of information about the operating environment to figure out what it was seeded by.
In short, it's fine the way it is.
Out of curiosity is there a way to take in to account things like improved crits (crit damage on 19 or 20) and/or crit damage in general (roll extra damage dice on a crit)
Skameros - Bugbear Barbarian - Out of the Abyss - By Kerrec
Follow your Arrow where it Points - Tabaxi Monk - Baldur's Gate: Descent Into Avernus (by Pokepaladdy)
Citron Pumpkinfoam - Fairy Monk - Project Point: Team Longsword
I roll to hit, 16! Damage: 5
I roll to hit, 19! Damage: 12
I roll to hit, 18! Damage: 9
I roll to hit, 21! Damage: 9
I roll to hit, 13! Damage: 7
I roll to hit, 6! Damage: 9
I roll to hit, 16! Damage: 10
I roll to hit, 9! Damage: 8
I roll to hit, 21! Damage: 11
I roll to hit, 22! Damage: 7
I roll to hit, 24! Damage: 18
I roll to hit, 20! Damage: 12
13! Damage: 12
Testing with improved crit and great weapon fighting style (2d6.reroll(<=2) + 3, 4d6.reroll(<=2) + 6)
13! Damage: 12
21! Damage: 12
21! Damage: 11
8! Damage: 12
15! Damage: 11
18! Damage: 12
23! Damage: 12
12! Damage: 10
25! Damage: 19
24! Damage: 25
11! Damage: 12
OOh that appears to have worked......I think sorta.....
[Maul: 19! Damage: 15]
Hmm well it mostly works - it still keeps rerolling 1's and 2's until it doesn't get them - and the rules state I have to take the re-roll whatever it may be (even a 1 or 2 again)
Skameros - Bugbear Barbarian - Out of the Abyss - By Kerrec
Follow your Arrow where it Points - Tabaxi Monk - Baldur's Gate: Descent Into Avernus (by Pokepaladdy)
Citron Pumpkinfoam - Fairy Monk - Project Point: Team Longsword
How do I use this function to calculate x to the power of y?
"Any society that would give up a little liberty to gain a little security will deserve neither and lose both" -- allegedly Benjamin Franklin
Tooltips (Help/aid)
Testing
[Maul: 6 Damage: 12]
[Maul: 9 Damage: 12]
[Maul: 10 Damage: 12]
[Maul: 24 Damage: Unable to parse dice roll.]
[Maul: 17 Damage: 13]
[Maul: 11 Damage: 12]
[Maul: 24 Damage: 24]
[Maul: 25 Damage: 24]
[Maul: 7 Damage: 14]
Hmm looks like that worked thanks!
Skameros - Bugbear Barbarian - Out of the Abyss - By Kerrec
Follow your Arrow where it Points - Tabaxi Monk - Baldur's Gate: Descent Into Avernus (by Pokepaladdy)
Citron Pumpkinfoam - Fairy Monk - Project Point: Team Longsword