Tuesday, February 18, 2020

Have any video game designs used non-uniform random numbers in interesting ways?


A variety of video games use uniformly distributed numbers to decide the outcome of an event, such as a "50% chance to hit" almost always means to check if a random floating point number from 0-1 is greater than 0.5. Many games will layer a few of these uniform percentages on top of each other, for instance a D&D hit roll is a uniformly distributed number from 1-20, except that 1 and 20 have special outcomes. To my mind it seems like things like critical hits are added by designers to try and emulate the fact that in reality hitting/missing or winning/losing is not actually a binary outcome.


In many cases the real life amount of "damage" done by an attack would likely be closer to a gaussian/bell curve distribution, which many results in the middle but the occasional very exciting outlier and smooth curve connecting them. Dice games like Settlers of Catan emulate gaussian distributions by adding together multiple independent rolls, but I feel like I've almost never seen this mechanic in video games.


It seems like games like Civilization (Sid Meier talked extensively at GDC about player perception not matching the actual math used in the game) would benefit from results that matched how things work in the real world. Have any video games used a gaussian or otherwise non-uniform distribution of random numbers in interesting ways?



Answer



Shooters often use Gaussian random distribution for weapon accuracy. (If you use linear random numbers and you have bullet decals, it's very easy for a player to see that the accuracy distribution is square, which "feels wrong.")


One interesting random selection method that you don't mention, but which shows up fairly often in games, is "random without replacement." This is analogous to drawing cards from a deck; the game runs in random order through a set of possible outcomes (put together with the desired distribution) and then "reshuffles." This is done to reduce the chance of lucky or unlucky streaks.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...