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

1.14K 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

Because it’s not random it’s pseudorandom.

A pseusorandom number generator starts from any number (the seed) and then does a bunch of math operations that create a random looking number, but since the operations are clearly defined the outcome is also clearly defined.

For example, take any 3 digit number, multiply it with pi and then take only the 7th to 9th behind the decimal repeat this 5 times. The outcome will look completely random, but it will always be the same when you take the same starting number.

Minecraft now uses that to generate the world. Whenever a random decision is made you ask your pseudorandom number generator to generate a decision. In minecraft the coordinates of the world are also used plus the seed, so that the world looks different in different positions. For example “add a tree if seed plus x coordinate plus coordinare input into the random number generator starts with a 5”

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