Random Numbers In Software Based Games
Generating random numbers is fundamental for all software to create realistic and chaotic representations in games. Software depends on the random generation of numbers for elementary game mechanics like terrain inception to minor game mechanics like the vector trajectory of a bullet being fired in the air. The light rays of an artificial sun, for example, in a game are randomly perceived to create realistic and disorderly shadows like how shadows would be seen in the real world. While software is heavily dependent on random numbers, the truth is there is no way for software to create random numbers. Software based games produce numbers that seem unpredictable, but actually are produced by a predictable process.
Software based random number generators are actually pseudorandom number generators (PRNG). Numbers produced by PRNGs are based on a mathematical procedure to create a sequence of numbers that have certain statistical characteristics in relationship with each other. These generators start with a seed number, such as 4, and then take this seed through a mathematical process, a common example is multiplying the seed by 5 and adding 3 and dividing by 16 and taking the remainder. The generator then takes the resultant number as the new seed number and repeats the process to create a seemingly random sequence of numbers.

The more complex the seed and mathematical procedure is, the more entropic and complex one can make the magnitude of a PRNG. Minecraft is one of the most elaborate and multiplex examples using a PRNG to create and maintain a virtual world. A seed for Minecraft consists of a 19 digit code that goes through a logistical process of millions of lines of Java code. This 19 digit code produces a world that has a seemingly random 326,825,000 blocks at spawn. Using only the seed, Minecraft creates unique terrains with differing biomes, structure, creatures, ores, plants, and player placement. Even the location of a little daisy that is millions of blocks away from you is predetermined before you even start playing.

Every Minecraft world is vastly different from one another, each containing unique characteristics to give the player a new experience in every world. A practical aspect of a PRNG in Minecraft is that with a seed, anybody can create the same world with every block exactly the same. Even though a PRNG is not true random number generation, the process allows game developers to use efficient, deterministic, and periodic number sequences with mathematical patterns that are easy to implement, but seem random and chaotic to any person using the software.
On the other hand, there is an electrical process to make a true random number generator (TRNG), but this process is quantum physics based and sporadic in giving outputs. Typical TRNGs use two lights sending electrical waves to each other at the same time to turn each other off and on. Because of electron displacement in the waves, there will sometimes be wobbles in the waves causing one wave to reach the other light sooner or later than the other wave. In terms of physics, the timing and intensity of the wobble is truly random and can be translated into a number for software use. While truly random, TRNGs are inefficient and aperiodic because the wobbles in the light waves don’t occur at recurrent intervals. Meanwhile, a PRNG merely gives an illusion of randomness, but is much more reliable to use for game development.
In conclusion, PRNGs are ideal for software based gaming. PRNGs allows software to feel random enough to portray realism to a player, while still employing certain mathematical patterns for a game to run efficiently and consistently.
Citations:
Todd E. Humphreys
Associate Professor, William J. Murray, Jr. Fellowship in Engineering