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

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

Pretend you have a deck of cards. You shuffle them up so they are no longer in order. Well, they do have an order, but it’s kind of random. As long as you don’t shuffle them again, no matter how many times you flip through the cards, you will get the same order. We’ll call this seed zero.

Now pretend you then take the top card, and put it at the bottom. The cards are still in the same order, you’re just starting in a different spot. This is seed one.

Move another card from the top to the bottom. Again, same order, but you’re now starting at seed two. You can continue to move cards the same way until you get back to the original one on top, and seed zero again.

Computers work the same way. They don’t have random numbers, the have math. But the math is always the same. So when you give it the number 0.37991, you will always get the number 0.61837 as a result (numbers made up). If you then use 0.61837 you then get 0 91826 as a result. So if you keep using the result as the input for the next calculation, you can create a list of numbers.

The seed is then the number you start with. Mincraft then uses that list, starting with that seed number, to create the world.

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