On Minecraft, how is it possible that during a map creation, you can just scramble letters, numbers and symbols as a seed and still have a random map as a result?

686 viewsOtherTechnology

My real question is, how is it possible on programming context?

Like, typing “dioasdjklasdknlvioj3e40435905$%” randomly on the seed input, start the map and have a still totally randomly generated world.

And by that, i actually mean how can that be possible if Minecraft wasn’t complex to program, as far as i know.

EDIT: Forgot to add, there is also a more than a sixtillion (Or even far, far more) of character combinations (Incluiding quantity of characters). All of them, if you change a single character in any place, generates you a random map. The slightlest change, and your map is completely different.

Where i am going is… how is it possible that such a small game like Minecraft could have an infinite number of randomly generated maps if it just weights a few Gigabytes (Or even Megabytes) on your PC?

In: Technology

11 Answers

Anonymous 0 Comments

When you generate a random number, it’s not actually random. A computer algorithm does a lot of complex math to make a number that looks random. If we give the random number generator a number to start with (called a seed) it gives us the same sequence of numbers as an output every single time.

This is why every every minecraft world with the same seed generates the same, it all starts from that seed.

It does a couple of things to make the map. It makes a random block of data that it fills with random numbers, and then it smooths those number out so there’s a slow transition between them. This is called a temperature map. This is how it puts biomes where they are. A certain range of numbers is an ocean, another is a forest, etc. The numbers between land and ocean biomes usually correspond to beaches

It then makes another one of these that it uses for elevation. High numbers on that one become hills, low numbers become valleys.

Then a block of random numbers with no smoothing, called a noise map, tells it where to out trees, cactuses, tall grass, flowers. It all depends on which biome it lands in and which number is on the noise map.

It does the same for ore distribution, but that is a 3D process, since it needs to account for height.

Caves and structures follow a different process, but it’s all the same idea, the seed is an instruction manual for which random numbers to generate, and there’s a whole bunch of code saying what random number does what.

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