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
In: 1323
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.
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.
You know how in math class you can have a function like f=x^2 and you can draw a graph with a parabola in it? It’s the same idea here. There’s a function that, when given an input, will give you a fixed output. When x=2, f is always 4. It’s just that in the game it’s a lot more complicated. Ultimately there’s some sort of “function” that will always generate the same world in the same location.
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.
Minecraft and NMS rely on procedural generation. They don’t generate the whole world, only the immediate area around you, and they use a relatively small list of assets to do so. But because the generation algorithm is procedural and predictable, it can fill in the map as you go. If you don’t take or leave anything in a chunk, it can just forget it’s ever existed when it’s unloaded and regenerate it identically from scratch when you visit it again.
This next part is conjecture, but it makes sense
If you do do something in a chunk, Minecraft can store just a differ of that chunk, ie only the changes made to it. Then when you return, it’ll generate the chunk, apply the differ it’s saved, and it’ll be just as you left it.
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.
There’s no real significant ELI5 possible for this I think, it’s really just math. You could I guess also think of it as putting the idea of compression on its head.
Instead of taking some arbitrary data that your art department built, you have a small seed (a number) and an algorithm that auto-generates these assets on the fly. The algorithm will be small, the seed will be small, the core asset primitives won’t take up much space. The trick is really just that instead of having to do a best effort attempt at compressing something arbitrary, you start from something knowingly fixed size and small.
Few games are infinite, many are unbounded, for specifically the reasons you cite. If the user can modify the world, that has to be stored. Depending on how much they can alter the world and how precisely you want to retain that, the more storage will be needed. Your game then can still be unbounded, but won’t be infinite – the storage or memory does eventually run out after all.
But say you made a drifting game with an infinite track and an indestructible everything, no tire marks or anything, then yeah, that can be proper infinite.
ELI5:
There aren’t 256 galaxies on your ps4; and only the planets you’ve visited.
It’s generated procedurally. So, when you land on a thing, or view a thing for the first time, it either downloads (if exists) or generates new.
All you really need on hand is the picture of the map with the names; text is tiny.
Take a seed 846. Now take a block 1. Block 1 gives you landscape 846. 2 gives you 846×2 and so on. If we calculated all of these we would have an infinite data set which can’t be stored on your device. But we dpnt need to calculate all of them. You calculate whichever ones actually occur. The endless blocks aren’t actually defined until you walk to a certain poiny. The seed is the function that defines how each block will be determined, but the number of blocks is endless.
Latest Answers