• NOW LIVE! Into the Woods--new character species, eerie monsters, and haunting villains to populate the woodlands of your D&D games.

MMO resolution math vs. d20 system

fireinthedust

Explorer
How do MMOs work? Like, if I click a button and it says whether I hit or not, or I have an ability that says "+10% melee attack accuracy", what kind of math is the computer using?

Is it similar to how RPG dice rollers work?

I have this idea in my head of a dice roller with thousands of values on it (because it's a computer, right?), though I suppose a few would be simpler (ie: 1d4 to hit, plus whatever bonuses you've got).

Any insights?
 

log in or register to remove this ad


WoW uses a single attack table as described in [MENTION=2198]Spatula[/MENTION]'s post. This is roughly the same as D&D, only D&D is much blockier (random from 1-20, while WoW is probably random from 1-1000).

Star Wars: The Old Republic actually uses a 2-roll system. The first roll is an attack table with hit, dodge, miss, deflect. If you hit, there is a second roll made on a table with critical hit, regular hit, and shielded blocked hit.
 

Randomness inside computers is actually an interesting topic, because there just isn't a good analogue to the actual unpredictability of dice under the laws of physics. Most 'random numbers' generated by computers are actually via pseudorandom number generation algorithms, which take an initial 'seed' value, then do crazy maths to it to get a sequence of huge numbers which vary unpredictably. One common algorithm of this type is the Mersenne Twister. When you ask a program of this type for a d20 value, it actually takes one number in this sequence (using 32-bit ints, it might be up to 4 billion or so), then takes it modulo 20 (equivalently, gets the remainder when divided by 20) and adds 1 to get a 'random' value between 1 and 20 inclusive. So yeah, there's really no disincentive to using a larger die size; using a larger modulus is certainly easier than acquiring a different die size in real life, and allows for die sizes that can't geometrically exist.

There is the question of where to get seed values, though. In general, if you run a pseudorandom number algorithm with the same seed twice, you'll get the same sequence of outputs both times, which is bad. Most systems use the system clock as a seed value, since it doesn't assume the same value it held previously very often under normal operations :p (though that assumption is stressed in a distributed system like WoW, where you have many servers with subtly varying clocks - it turns out synchronizing clocks across many machines to high precision is an even harder computational problem than random number generation).

There are a few places where one can get genuine randomness. Linux gathers atmospheric noise off of network card interfaces and other hardware components and stores it for use in random number generation (stored in /dev/urandom, I believe), and there are places online where you can buy random numbers generated via atomic decay. However, a system like WoW almost certainly uses pseudorandom number generators, because they're cheap, readily available, and easy to use.
 
Last edited:

Pretty dang impossible to get true randomness in Windows (as hollowleg says, the best you can do is get something that is infinitesimally indistinguishable from true randomness). I like to use cryptographic hash values when I write dice-rollers because of their inherently non-repetitive nature, but this is usually infeasible in video games, which have serious speed requirements.

EDIT: IRC, /dev/urandom is the non-blocking version of /dev/random, so if there is not enough bytes in the pool, you get non-entropic values. I think, but am not sure, that the standard library random functions use /dev/random. Could be wrong though... my Linux-fu is rusty.
 
Last edited:

Cool!

Follow-up question: would the systems of random number generation be more like the d20 system, or more like a d% "roll under" system? Or something else?

I'm thinking about whether the same principles for designing an MMO could be worked into an RPG.

Before this devolves into an edition war (which is, btw, basically over with the announcement of 5e; well, maybe a ceasefire), I just want to say that I'm not taking a traditional RPG like D&D and adding in MMOisms. I want to know if the same design principles they come at their project with are similar to how TTrpgs are modeled.
 

Follow-up question: would the systems of random number generation be more like the d20 system, or more like a d% "roll under" system? Or something else?
Ultimately, saying "roll greater than 10 on a d20" and "roll 50% or less" are the exactly the same from a random number generators perspective. Both systems take large generated random numbers and modulo them to give you the range you need. One system will not give you more entropy than another, and there will be no discernible difference to the person playing the game. As hollowleg mentions, it is the random number generator, and its seed, that gives you all the entropy.
 

WoW uses a single attack table as described in BEGIN TEMPLATE: dbtech_usertag_mention @Spatula END TEMPLATE: dbtech_usertag_mention 's post. This is roughly the same as D&D, only D&D is much blockier (random from 1-20, while WoW is probably random from 1-1000).

No idea what "graininess" is used for WoW.

In principle, the "graininess" on a computer is limited by how many decimal places can be stored by the variable being used.

For example, a 16-bit unsigned integer has a decimal range from 0 to 65535 (ie. 0000000000000000 to 1111111111111111 in binary). If 65535 is taken to be 100%, the graininess is approximately 0.000015259
 

Into the Woods

Remove ads

Top