Random number generation, or RNG, is the unseen engine that makes many video game features work, from loot drops to procedural levels.