Probability in Games

Jump to navigation Jump to search

In any game players commonly mix up probability with expectation. This article is an attempt to explain probability in an easily understood way.

For ease of writing, this article will use probability, likelihood, and chance interchangeably.

The misconception described
Players commonly expect something to happen within four tries if the chance is stated to be 25%. And their expectation is fairly correct, in the long run that "something" will happen every fourth time. But as an example, players do not want to spend expensive shards "in the long run" but they expect maximum 4 tries to get a "critical result". In fact, almost all humans expect such results.

Probability Theory

Probability is a big mathematical branch concerning numerical descriptions of how likely an event is to occur. For a deeper understanding, see Probability theory, or the somewhat lighter Probability, both on Wikipedia. This article will focus on the simplest area of this science, since games never use anything advanced.

First of all, in games the probability is based on randomness. An event that has no "memory" of the previous event but each event is independent from any earlier events. Think for example of throwing a dice. Of course the dice does not remember the previous outcome.

Compare this with drawing a card from a well-shuffled deck, and we want ace of hearts. The first draw the chance is 1/52 to win. But here is kind of a "memory" involved so the next draw has a slightly higher chance of winning, namely 1/51. And so forth. Computer games do not have this "memory", never ever.

A well-balanced dice have the probability of exactly 1/6 to yield a desired outcome, let's say 6. But throwing the dice six times does not guarantee that 6 will show up, perhaps not even after eight or ten throws. On the other hand, it may show up on the very first throw, and even several times of the six throws. But on average the 6 will show up every sixth time. Most schools have this as an example in statistics classes and pupils throw the dice maybe hundred times and note the results. And the average result will be amazingly close to the foretold chance of 1/6. Though studying the events more closely they may find many unbroken sequences of the same value, not very long sequences but anyway. Likewise, they will see sequences without a particular value, for example sequences longer than six throws without any 1.

This is a cue to why our expectations will fool us into thinking 'the game is bugged', while it is not. Since "average" does not match well with "expectations".

Computer Randomness

We intuitively understand the randomness of a well-balanced dice, we throw it and our hand cannot repeat the exact movement each time, somebody maybe laughed and caused a slight air draft, or the table surface is not perfectly even. Any such condition will affect the dice. Such conditions cause randomness.

In the world of computers programmers use a "random number generator" (RNG). Simply put, it is something that upon request responds with a number, usually a decimal number between 0 and just less than 1. Not 1 but as close as possible, given the limitations of the hardware and software environment. I will not explain why not 1, just accept it as a fact. (There are RNG using other upper limits, but that does not contradict the essence of this article.)

In the case of a dice, a programmer may multiply the retrieved decimal number with 6 and then add 1, giving a value between 1 and just under 7. Then throw away the decimals (truncating) so that only the integer remains, and voila, there is an integer between 1 and 6. And the probability is guaranteed to be extremely close to the theoretical chance of 1/6, running e.g. a million requests to the RNG.

Experimenting with RNG in hardware has been ongoing for decades but often struggled with exploits or predictable patterns. However, from 2015 Intel and AMD provide such features on some of their chips [1].

For even longer time, RNG have existed as software utility programs, using well tested and tuned algorithms that provide "pseudo-random numbers" based on a "seed", a starting value. Starting the program with the same seed will yield the same number sequence every time, but by for example giving the current time stamp (date and time) as seed it will yield unique sequences each time. In short, based on the seed the program will shuffle around bits in a certain way and a number is provided, and remembered. On next request the program will use the previous number as seed and provide a new number, and remember it. And so forth. In the end of the day it is impossible to determine whether the output is from a RNG or from for example a dice.

Current games use either hardware or ready-made open source software RNG and both kinds are equally good.

Probability in Games

In Lotro we are used to probability (chance) being mentioned in conjunction with for example...

If crafting a particular recipe once or 10 times, each time has exactly the same chance to a Critical Success, no matter the previous results. If running an instance once or 10 times, the chance for a particular item to drop is the same each time. Etc.

Crafting often use higher probability values for recipes using "expensive" materials, and the chance may be boosted even further with the help of certain resources or scrolls. But it is still governed by probability and randomness. However, many other things have a very low probability, even less than 1%. From a probability point of view it does not matter whether the chance is very high or very low, it slavishly follows the mathematical rules.

No buffs exist for loot drop rate though. Games usually have a so called "loot table" applied to a particular creature, or a group of creatures in a particular area. Imagine a loot table as a sequence of 100 slots, as that matches the concept of per cent. From a set of loot items, each slot is filled with one loot item, and a particular item may fill one or many slots. The higher the loot drop rate is for a particular item the more slots are filled with it. (It does not matter if the items lie in slots next to each other or are shuffled around.) Remember the paragraph above, how a programmer used a random number in connexion with a dice. Now the programmer scales the random number with 100 instead of 6, and that number will pinpoint a slot with an item. Randomly.

Game developers tweak the chance values all the time, mainly those for a character's performance. Always with the goal of balancing class vs. class and character vs. creature. Thus, players will constantly see changed values for items, skills, etc., which provide buffs and debuffs. Fairly often players see tweaked loot tables, but rarely any tweaks to for example crafting or running speed. Certainly not in mature games, unless releasing a more pervasive update.

Hopefully players now can adjust their expectations to reality. Expectation is a "wish" but probability is what it is.

Probability Distributions

Everything mentioned above is about "continuous uniform distribution", i.e. each event has the same chance to occur. This is the simplest form of distribution, and the easiest to grasp. Mathematically it is as simple as the formula 1/N where the variable N is "amount of possibilities". E.g. a six-sided dice gives 1/6 while a 12-sided dice gives 1/12. All RNG provide numbers using rectangular distribution.

However, Lotro is using other kinds of distributions too, whereof some yield curves. Often in conjunction with "diminishing results". In that case the formula may look more complex, with more variables and constants. Yet, if anything random is happening in conjunction to such a formula, the same RNG is used and the number will be tweaked into the formula in one way or another.

If interested, see List of probability distributions.

See Also