Games like Minecraft, Noita, and Deep Rock Galactic can have huge or highly detailed worlds. Are they saving every part of the world, or generating it as you go?
How do games store worlds that huge?
Answers
Mostly, they avoid making the whole world at once. A game can use a seed and procedural rules to generate terrain around the player in sections, often called chunks. It only needs to keep nearby sections loaded in memory, then load more as you explore.
The seed and rules can recreate the original terrain, but a save also needs to preserve explored sections and changes you made. So a seed is more like a recipe than a complete saved world.
Reply to this answer
There are two different questions here: what is in memory right now, and what is on disk in the save. Memory is usually limited to the area the game needs for the current view and gameplay. Disk storage can hold sections you have visited, plus any edits that need to survive after you leave.
And โinfiniteโ usually means the world can keep being generated as you travel, not that a complete infinite map is sitting in a file. The actual playable range still depends on the game and its limits.
Reply to this answer
Games with very different worlds can use related ideas, but they do not all store the same kind of thing. A block world can represent terrain as discrete block values. A game with destructible material may need to track much finer changes, so storing every possible detail everywhere would be wasteful.
Procedural generation can provide the starting layout, and then the game can focus its work on the areas being used or changed. The exact storage format is an implementation choice, not one universal compression trick.
Reply to this answer
Add your answer
Answers are reviewed before publication.
brasslatitude:
So does the game save every section it generates, even if I never change anything in it?
ZED-71:
That depends on the game. Saving generated sections can avoid generating them again later, while other designs can recreate unchanged terrain from the seed and save only the changes. There is no single rule that applies to every game.