Domande di Internet

Eli5: How can games like minecraft or no mans sky be essentially infinite, yet take up a very small amount of storage?

Bentornati ad un’altra straordinaria edizione delle domande di cultura generale!

867 utenti della rete avevano questa curiosità: Spiegami: How can games like minecraft or no mans sky be essentially infinite, yet take up a very small amount of storage?

No mans sky is like 18GB or so on my PS4, yet there are 256 galaxies and literally around 18 quintillion planets. It can be played completely offline too, so it isnt coming from some server somewhere

I understand they're procedurally generated, so they dont even exist until you pass through that area, but even after playing for countless hours and crossing thousands of miles of landmass, the save file is still extremely small

Ed ecco le risposte:

They have a small amount of actual assets that they have to load. When they procedurally generate new environments, they’re just picking from a box of assets and remixing them. So when you save a file, they don’t have to save the entire environment. Just the instruction manual for which parts from the asset pool to load into specific spaces in the game world.

It’s kinda like scripted comedy vs improv. If you’re scripting 2 hours of comedy, you need many pages of dialogue, sets, cues, etc. If you’re improvising, you just need to know the rules, not the details. You fill in the details as you go. Kinda like procedural generation for games like this. They focus on the rules and make up the details as needed.

If I asked you to create a football field sized checkerboard, you could do it without much thought or concentration. You just know the rules that one white block needs to go next to one black block and repeat until you meet the required size.

If I asked you to create a football field sized portrait of mario, you’d have to really think about the color and placement of every block such that it creates the desired output.

Games like no man’s sky just have simple rules for generating content that pulls from a set of premade assets (all games do this to one degree or another). That’s why you’ll see repeats of things just arranged in different ways or maybe a different color. It’s way easier to just follow the rules with specific ingredients – all you have to remember are the rules and then have access to the ingredients.

In reality those rules will all boil down to a seed number. Then the game does calculations with that seed number to determine various factors about the planet (in the case of no man’s sky). To recreate that planet all you need to save in your memory is the seed number, and when someone else comes back to that planet, it reads that seed number, performs the same calculations and the result is the same.

Vs. other types of games where more things are unique and placed in very particular places and ways, you need to write down the location and placement of all those items, which increases the memory required, but you get a more custom feel to the game.

How can lego builds be essentially infinite, yet there are very small amount of building bricks?

By building with that bricks (assets, blocks…)

For example in Minecraft, the map can be really huge, if you make it so… Map of 2b2t (famous Minecraft server) is terabytes in size

The procedural generation is deterministic. The area doesn’t exist till you go there and it gets generated. Once you leave, it stops existing, and gets regenerated if/when you come back.

In the case of Minecraft where one can make changes, it only stores the changes and regenerates everything else. Also for Minecraft, the changes are just which blocks are where. So, a single block is probably only like 4 numbers; x, y, and z coordinate plus another small number for what kinda block is there. So even if you destroyed or changed thousands of blocks in an area, that’s only like a couple kilobytes of changes.