Random Number Generation in GameMaker manta ray manta ray

June 2022

Level 5: Game design and randomness

Work in progress

Now you're an expert in simulating random variables and working with randomness in GameMaker. The big question is, should you do it? The answer is: it depends.

As with any tool, using it appropriately gives several benefits, but overusing it can bring havoc to your game. Let's talk about some pros and cons of randomness.

Pros of randomness

Randomness brings variety to a game. When we play our favorite roguelike, for example, we are treated with a seemingly infinite variation of levels, masterfully constructed using procedural generation. When the boss drops a legendary weapon with a small probability, we rejoice: this is why we've tried beating the boss for the nth time. This allows for replayability, which is very important for game developers and players alike.

When you have randomness, you can increase player engagement. Players will be eager to try new stuff, play all modes and get all goodies.

Finally, randomness can increase realism for your game. Small things like adding random drift to a weapon, as well as big things like your uber powerful traffic simulator, can really enhance the sense of realism.

Cons of randomness

Implemented incorrectly or when not necessary, randomness can bring frustration to your players. If you have a great weapon in your turn-based battler but randomness dictates you miss, this can really feel unfair. If you score that equalizer at minute 92' in your soccer simulation, but the referee blows the whistle for a non-existent offside (because the developers implemented a probability of making mistakes for the referee), your computer/laptop integrity could be at risk.

Randomness, especially in procedural generation, can yield artificial, boring or cookie-cutter levels, which can actually create boredom instead of excitement for variety.

Input and output randomness

Where is the fine line between "good" and "bad" randomness? One way this topic has been studied is by classifying different types into input randomness and output randomness. The idea is the following:

The general consensus is that input randomness (done well) is good, because it allows for variety and replayability, but does not trump the player strategy or decisions; however, output randomness (done badly) can produce a bad outcome, even if the player skill is high or they have taken a good decision.