Randomness in video games

Written by Timur

Last semester, after my team’s final presentation about a simple app we developed called “random choices,” which selected a random item from a list of things the user entered, our professor liked our work and presentation. Still, he had a note that got me thinking the whole break and made me alter many mechanics that a game I’d been developing for months had. He asked us whether the item was randomly selected, which is the case; however, to our surprise, he said that this shouldn’t be the case as it can frustrate users in some cases.

I didn’t pay much attention to it until I tested my game out of boredom and realized that the drops, which are supposed to be an equal mixture of health drops and energy drops, are only energy drops! I set the chances of having either of them to 50%, which was the moment I realized there is more to randomness in games than just putting Random. Value (that’s the life of code that generates a float between 0.0 and 1.0.) I did my thorough research and contacted my professor to learn more, and I learned more.

The element of randomness is almost everywhere in video games. Yes, we know that rogue-like games depend on it to create level layouts and enemies, and other games have it for drops (like my game.) But it’s also seen in the miss chances in RTS games like warcraft 3, card games like Hearthstone, RPG games with random encounters, and much more. Additionally, randomness is present in critical hit chances, which practically is supposed to be random, but it’s not.

Turns out that if a game’s randomness is left the way it is supposed to be in theory, the game would eventually be either too hard or too easy, depending on what the console provides. Having it too easy is not often a complaint; however, having it unfairly difficult? This is not good for business.

An ability in Warcraft 3 called “Bash” for a character called the Mountain King gives him a 25% chance of stunning the enemy. The way it works is that each time the Bash is missed, the chances of having it in the next hit increases until the stakes are high to a point where a Bash is inevitable. After the Bash lands, the chances of having it next drop down to zero, making it impossible to have two Bashes in a row.

The drops worked like magic after I implemented that in my game. Read Randomness in video games 2 to learn more about this exciting mechanism’s theory.