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
You have already answered your own question. It’s the procedural generation. The game doesn’t have to save every planet, just the rules on how to create and recreate them. Your save file doesn’t need to save them after they have been generated except for any base structures you’ve built, just their metadata. Think about it this way, what takes up more space? A recipe page or a whole cake?
There are a few important details happening.
——————————
Firstly, “in-game distance” itself contributes almost nothing to file size.
To a computer, recording a save file with *”Object-A is at location (0,0,0) and Object-B is at location (1,3,4)”* takes up the same amount of storage space as *”Object-A is at location (0,0,0) and Object-B is at location (2,6,8)”* despite the distance between A and B being “twice as far” in the second example.
This means that I can generate a sci-fi space universe with Planet-A and Planet-B and the file size will be the same regardless of whether the in-game travel time between those two locations takes 1-hour or 30-hours (despite the two choices producing very different feelings of “scale” to the player).
———————————–
Secondly, there are multiple kinds of “procedural generation” in games.
In some, a randomized procedure is used to make the world, and then every piece of that world is saved in its entirety. This is no different than making a world by hand… other than the fact that it makes a unique world each playthrough.
Other games never save the world, only the procedure. In this case, going to a location “generates” the world around you but it disappears just as quickly when you leave. If this is coded in a smart way, it can be the case that a location you leave gets re-generated *identically* when you return later.
———————————–
If you combine those two ideas, you can create one single unchanging procedure-file that generates the world without having to ever save everything it generates, and then you spawn user-made changes (like *”Destroy the block at coordinate (123987123,24095409,9778211)”*) on top of that with a similar amount of data to tracking objects in any other kind of game world.
In Minecraft the save file does increase actually the more of the world you explore. 2b2t an old anarchy server in minecraft that has been running the same world since like 2010 has a world size of several TERA bytes. And the owner supposedly spends thousands a month on servers to run it and store the massive world save file.
You don’t need to save everything that was generated. You only need to save what was CHANGED.
In minecraft if you have the seed everything will be exactly the same no matter how many different people load that seed so the only amount of data you need to save is the seed.
The only important bits that need to be saved are the blocks you changed. When you do this a lot the save files can start becoming very large as is the case with some of the very old minecraft servers that have absolutely insane save file sizes.
Bcse No mans Sky was a dogwater cashgrab that used procedurally generated assets and it was marketed as huge, despite being mostly empty.
So, til you get there, it wont exist/generate. Since exploring all planets and/or locations would take a huge amount of time, the game will not get heavier in terms of memory space usage unless you spend 20K hours( hyperbolic example).
Procedural generation is fun.
Basically, you have a system for generating random worlds. You give the system a starting point (a “seed”) and it’ll always generate the same random numbers, which means it’ll also always generate the same map from that seed.
If you can guarantee that you always generate the same map every time, then you can just store that seed and generate stuff on demand. Then you save only the stuff that the player modified.
In No Man’s Sky’s example, random generation is based off of something called a “Seed”.
The “Seed” is a small value. Based upon this value, *everything* else that is generated using this seed is ‘created’ the same way. It will generate the same ‘random numbers’ each time, based upon this seed.
No Man’s Sky builds upon this (presumably). A Solar System in No Man’s Sky might generate with a seed of, say, 99. When the game goes to generate this solar system for you (or anyone else), the same code on your machine runs on everyone else’s, using a shared seed that is saved and replicated to everyone. Your computer doesn’t have to download the data for all the planets in a solar system, it just downloads the seed (or it may already be on your computer), in this instance: 99
Their program uses this seed to create a planet, and everything on it. That’s how they can have quadrillion of stars and solar systems, and have them generate exactly the same across everyone viewing them, they Just a small number and it blossoms from there, hence the term “Seed”.
If a game has a new update that adds more to their generation algorithm, or changes it in any way, depending on how they do it, it can actually result in radically different planets after an update than before. It’s why in Minecraft most people start a new world when a new major update comes out, otherwise if they enter an area that is newly generated that borders and older generated area, the difference could be drastic.
An example might be half a mountain, and then a glacier biome cutting through it: In an older version, the ‘seed’ used to generate that tile would generate a Mountain, but the NEW version of the generator comes up with the glacier biome instead, even using the same number.
These games create their worlds “on the fly” rather than being premade.
Imagine needing to know the dimensions of your house so you can buy furniture and other things. You could either measure *everything* up front and record it on paper for future use, or you could simply know how to measure things and measure them as you need. If you put it on paper, you need to store that paper somewhere, but if you just measure when you need to, you don’t need any paper!
The tradeoff is processing time vs memory. With premade worlds, you don’t need as much CPU because all you do is pull the data from the disk and display it. With games that build stuff on the fly, it has to use a lot more CPU while you are playing the game.
Latest Answers