ELI5- how does a game like Minecraft infinitely generate terrain ?

424 views

ELI5- how does a game like Minecraft infinitely generate terrain ?

In: Technology

2 Answers

Anonymous 0 Comments

It’s related to pseudo random number generation.

You start with a “seed”. A value that your generator uses as a starting point, and every step it makes a new random looking number that is defined by the previous number and an algorithm that jumbles it until it looks like it’s completely unrelated.

And then you start creating world features based on that. Simplified examples:

If the number at coordinates X,Y is bigger than z then make a mountain. On the mountain create a tree whenever your random number ends in a 13.

And then you tinker around with the rules of how that numbers translate to a world until it looks good.

Anonymous 0 Comments

However large a terrain is, you will only access a particular area at a time. So, rest of the areas don’t need to be processed at that time.