Download Game! Currently 71 players. Last logged in:MangyLozloPotionCorrel

Ggr's Blog >> 72925

Back to blogs index
Posted: 04 Oct 2026 01:39 [ permalink ]
Random thoughts on randomness

Every once in a while, the topic of randomness is brought up. Usually this
is related to the perceived "fairness", or lack of fairness of some in-game
occurence.

The typical complaint, for example, is that a skill/spell at high percentage
fails more than it "should" - like a skill at 90% has failed for the player
5 times in 10, giving a success rate of 50%. For the mathematically minded
statisticians among us, this is obviously a fallacy - the success rate at low
sample count is meaningless. This is shown well in a typical random coin flip
experiment where the rate should "in theory" be 50% for both sides.

One also has to consider that a single event is always separate from the
other such events, so the success or failure of the given event does not(*)
depend on the outcome of any previous (or future) events. Thus the overall
success rate can only be measured on large scale of events and can fluctuate
wildly in any "smaller" scale measurements. For the same reason there can be
"clustering" of good or bad outcomes.

Of course as we live in a computer game, we also have to consider the nature
of the randomness itself. On computers, we rarely deal with any kind of
"true" randomness, especially where the quality of randomness is not a factor
for reasons of security (such as cryptography). In BatMUD, the typical
randomness is "pseudo-randomness" generated via a variety of algorithms.

The LDmud driver offers a standard random() function for generating random
numbers in a desired range (the algorithm behind it is a variation of the
Mersenne twister, https://en.wikipedia.org/wiki/Mersenne_Twister ). We
also have some other algorithms, although they also tend to be Mersenne
twister-based. Most things in the game typically use the random() function,
but some that require more "controlled" pseudo-randomness may use other
methods due to the LDmud random() lacking a seeding method (for reasons
that are obvious if you think about how LDmud execution chain works).

One can argue that some PRNGs (pseudo random number generators) may be more
prone to "clustering" depending on circumstances, but I suspect that in most
cases it does not matter - though there are probably exceptions. In such
cases, theoretically speaking it might be possible to make event outcomes
more "seemingly fair", but it would be an enormous undertaking and also
quite cumbersome to store some kind of global state for each player (and
perhaps NPCs too), and then carefully measure every "roll" of randomness
and their effect to balance the formulas and other related code.

In the game there typically are also other confounding factors in addition
to "pure" randomness. The success of skills, spells, hits, etc. can be
affected by other variables such as stats, other skills, and the mysterious
"luck" factor. Players, (usually) unable to distinguish these factors from
each other, have a tendency to put blame at singular variables or at worst
consider that the system is wholly broken due to the perceived unfairness.

Unfortunately I cannot go into any specific details about how things
work, for obvious reasons. These are secrets only known to wizards.

I can only assure you that from wizard point of view, these claims of
unfairness are largely amusing nonsense. Sometimes there may, admittably,
be factors that could be adjusted in specific cases such as some specific
skills or spells .. but often it's just that the gods of PRNG are not
favouring you on that day. :)