What is an important technical advice you’d give to novice developers about utilising RNG?

  1. More for applications than games, but have a way to set a fixed seed for the generation. It's useful being able to repeatedly get the same results (often just because a user wants the same art/world generated, but as the developer it is very useful for debugging as it's very hard to debug random errors).

  2. There's a great video by GameMakersToolkit on input and output randomness that really changed my perception of randomness in mechanics, why some random things feel good while others feel bad.

  3. A lot of the random number generator implementations aren’t as random as you think, and helper functions are frequently wrong. Off by one errors or errors at the distribution edges in ranged functions (eg randInt(1, 10)) are horribly common. Be really careful stealing random RNG code off SO etc.

  4. Yup, that last bullet point is very important. If you have a game where you have a random chance of getting a rare item, and it's purely up to chance. There will be players who WILL NOT GET THE ITEM. Likely ever. Even non-rare items, even if it's just "Kill X to get Y foozles" and the chance to get a foozle is some percentage...there will be players who get the quest done immediately, and players who kill thousands. Is it rare, sure? But in a game like WoW with millions of players, players are going hit all over the distribution curve.

  5. If youre using RNG, you have to be very careful that the RNG does not screw the players over in ways that they will feel is unfair.

  6. This is more from a design perspective rather than technical. There are certainly various "flavors" of randomness. And some approaches might produce more accurate results than others. But at the end of the day, I find that often this doesn't have all too big of an impact on your game's design. Personally, I like to not overthink it and just use the next best random number generator for whatever I'm trying to achieve at the moment. If, at a later stage, I notice that I dislike the random distribution, then I will look into it.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may have missed