I want to generate a completely unique world with biomes (like what Minecraft and similar games do). I don't understand how they generate these entire worlds from a single "seed" number. Can someone provide a basic overview of the technique?
How do you generate random X from a seed? a seed value is the initial state of a random number generator. In most programming languages, you can set this seed. For example, C uses
srand(). If you don't specify a specific seed to start with, usually a timestamp value is used as the seed. That way, each time you run, the random numbers are different.
// C example srand(1); for(i=0; i<3; i++) printf("%d\n", rand()); srand(1); for(i=0; i<3; i++) printf("%d\n", rand()); 1270216262 1085377743 1481765933 1270216262 1085377743 1481765933
As you can see, whenever you seed with a certain value (I used 1 as a seed), the resulting random numbers are the same.
How do you create a minecraft-life world based on random numbers? Notch has a post about this. Also, you can check out other people's tutorials on "minecraft-like worlds". I enjoyed this one, for example: Minecraft-like rendering in OpenGL 4. The basic idea is to use Perlin noise (or simplex noise). Here is a good question about noise functions: Understanding Perlin Noise