how do “seeds” work in video games such as Minecraft?

1.18K viewsOtherTechnology

For example, how does an infinitely randomized world like Minecraft manage to generate me an identical world to my friend with just a handful of numbers that they send me?

In: Technology

23 Answers

Anonymous 0 Comments

Computers are actually quite bad at generating random numbers. Instead, they use math to generate “pseudo-random” numbers that are “random enough” for most purposes. A simple version of this might be “ok, it’s 11:04 am, so to generate “random” numbers, start with the 11th digit of pi and take every 4th digit from there.” Without knowing the math used and the starting value (seed), the results appear random to us. But if you input the same “seed”, you’ll get the exact same results. This is how games like minecraft work – if you don’t give a seed they pick/generate one (often based on the current time), kick off the pseudo-random number generator, and generate the world. The ability to generate the same world from the seed is a consequence of that, and useful for testing (so you can recreate the exact same conditions), and some players tend to like it as well, so they make it easy to access and set the “world generation seed”.

You are viewing 1 out of 23 answers, click here to view all answers.