How do games like Minecraft and No Man’s Sky have seemingly “infinite” world expansion, yet their files are not only tangible but quite small?

273 views

I was playing Minecraft the other day and went very, very far from my spawn point and eventually returned home. When I retraced my way back, I couldn’t wrap my head around how the game not only generates the environment but remembers the placement of everything as I return to the same places I had already been. With that in mind, wouldn’t the game be required to remember… an absurd amount of information as the user explores their world? How are the file sizes of these worlds not crazily big?

In: 12

8 Answers

Anonymous 0 Comments

The game world is generated by mathematical formulas and algorithms. It’s not like developers need to hand-place every square metre of grass or empty space. The process is called [Procedural Generation](https://en.wikipedia.org/wiki/Procedural_generation).

Any deviation from that formula (such as changes made by the player) are persisted in the save file. For complicated things like modifying the landscape, that can get real complex real fast, which is why most games don’t implement it, or limit the amount of change that can be done, or the changes are reset when the player leaves the area. Something like Minecraft is a bit easier because it works in 1 metre cubes, you only need to specify the area of blocks that have been changed/removed. For placing specific objects you only need to store the type of object (usually a simple identifier like a numeric ID) and coordinates for its position.

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