Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In minecraft, before creating a world you have an option to input a seed. The algorithm takes the seed and creates a completely unique world. How does this work?

share|improve this question
    
I believe you need to work at Mojang to know the full answer to that question. :P –  Billy ONeal Oct 21 '11 at 17:13
5  
@BillyONeal or simply read Mojang's blog. –  rightfold Oct 21 '11 at 17:19
1  
add comment

1 Answer

It gives the seed to a pseudorandom number generator (PRNG) and uses that PRNG to generate the world.

Giving the same seed will give the same sequence from the PRNG and thus generate the same world.

share|improve this answer
    
Good point, though has anyone tried giving the same seed to Minecraft more than once to see if the terrain is really the same (or even just "approximately" the same)? –  FrustratedWithFormsDesigner Oct 21 '11 at 17:15
2  
@FrustratedWithFormsDesigner Notch (the designer of the game) says that the generated world will be identical if the same seed is given. –  rightfold Oct 21 '11 at 17:16
    
I guess that answers it! –  FrustratedWithFormsDesigner Oct 21 '11 at 17:18
5  
The only times the terrain changes when the same seed is input is if the generation algorithm changes (which is just about every major update...). It's worth pointing out that the terrain generation is commonly called procedural generation –  thedaian Oct 21 '11 at 18:09
1  
Minecraft also runs a hash function to transfer string seeds into numbers. –  Pubby Oct 21 '11 at 18:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.