Valheim

Valheim

_catch Feb 8, 2024 @ 4:04am
How does save of the world works from tech perspective?
I was googling and still didn't find the answer

I play it on steam deck and PC and I've noticed that the game save time increases as the game time goes on. How does this work?

Is the unexplored part saved as chunks and then the fully generated part is saved after you reach it?
Or is the entire world generated in detail from the beginning?
And what exactly are you saving? The state of each explored part or just the changes to what I'm doing?

Will the save time or save size decrease if I, for example, cut all the trees + stumps and break all the rocks on the explored islands? Or will it conversely increase with each save?
If I have explored half of the map and for 30 minutes I will just sit and do nothing, will the game save time be 3-4 sec?

Does it make sense to demolish old bases (small or large) to decrease save time? And will the number of outposts increase the save time?
Last edited by _catch; Feb 8, 2024 @ 6:15am
< >
Showing 1-10 of 10 comments
Útost Alronbem Feb 8, 2024 @ 5:53am 
I believe the world IS being generated fully on first launch.
Reason to think that way: console command which allows you to update unexplored areas of existing savegame with new content after new content update.

Altering terrain shouldn't affect savegame size at all (and shouldn't affect save time) since terrain data is basically just a huge heightmap. And biome borders are still permanent, non-adjustable, right?

Wrecking everyhing in sight is expected to reduce savetime ONLY if you'll go wreck all pre-built structures (like abandoned villages or skeleton towers) - these seem to use the most data due to density of all those building pieces in one place and sheer amount of data associated with each smallest building piece.

As most vegetation and creatures renew themselves, it's generally useless to go all scorched earth on them just for sake of savetime reduction.
_catch Feb 8, 2024 @ 9:40am 
I don't think it makes sense from this perspetive. All pre-built structures are already there and very first save takes less then sec to save the world.
Every action which alters the world should in theory increase the time needed to save the current state. It's saving the differences between the clean generated map and whatever the player does, so those differences will add up.
vinyblaster (Banned) Feb 8, 2024 @ 10:36am 
To keep it simple: the more you explore the bigger the save file gets (and obviously save time).

The world is generated as you explore it based on the seed. A few things are randomized like the orientation of caves, or the content of dungeons.

To answer your question, I think that cutting trees, destroying rocks would have the opposite effect. The save file would need to track that you have destroyed these items.
Útost Alronbem Feb 8, 2024 @ 10:54am 
Originally posted by _catch:
I don't think it makes sense from this perspetive. All pre-built structures are already there and very first save takes less then sec to save the world.
It is, however, not clear if these structures' blocks are placed on worldgen (i. e. first flight with the Valkyrie) or on demand (appearing in view range) or using some other trigger sequence.
One thing's for sure: once these appeared in view, demolishing them does more good than harm _for save time_. If it doesn't or does the opposite - it's bug report time, since it's a sign of useless data being processed.
Quintium Feb 8, 2024 @ 11:37am 
The more you explore, the more zones[valheim.fandom.com] are generated over time. Everything created in a zone is saved.
So, the more you explore, the more it has to keep track on and is saved. Hench save file grows.
Also another thing to consider is that some objects, like large rocks and metal veins, are created as a specific single game object, so it exist as one instance when saved.
If you then hit it, it will be replaced with a different game object that contains multiple separate game objects. Which is what you see as broken pieces. That will generate more objects to store, if they do not get removed.
As an example. If you hit a copper vein once, it is replaced with the multiple game objects, so if you only mine out what is on the surface, then the game still keep track on multiple objects underground.
Also a reason to why it is a good idea to remove tree stumps.
RagnCharran Feb 8, 2024 @ 2:52pm 
Originally posted by Quintium:
If you hit a copper vein once, it is replaced with the multiple game objects, so if you only mine out what is on the surface, then the game still keep track on multiple objects underground.

I always wondered why the first hit on an ore deposit didn't count as actual damage for the mining of it, it just was like a "starter" hit. This explains it.

But regarding copper deposits, what is worse for the game to have to keep track of - underground pieces left unmined, or all the ground damage needed to dig out those pieces (unless you use a noninvasive method like troll/abomination attack to clear them)?
Quintium Feb 8, 2024 @ 6:57pm 
Originally posted by RagnCharran:
Originally posted by Quintium:
If you hit a copper vein once, it is replaced with the multiple game objects, so if you only mine out what is on the surface, then the game still keep track on multiple objects underground.

I always wondered why the first hit on an ore deposit didn't count as actual damage for the mining of it, it just was like a "starter" hit. This explains it.

But regarding copper deposits, what is worse for the game to have to keep track of - underground pieces left unmined, or all the ground damage needed to dig out those pieces (unless you use a noninvasive method like troll/abomination attack to clear them)?

Good point, Terraforming is likely worse. More data to keep track of.
Útost Alronbem Feb 9, 2024 @ 3:09pm 
Originally posted by Quintium:
Terraforming is likely worse.
*sigh*
Terraforming should be lightweight due to it being singular heightmap image.
Unless there were some preparations for "proper" holes-in-the-ground, which either I've missed or didn't started.
Last edited by Útost Alronbem; Feb 9, 2024 @ 3:09pm
Horemvore Feb 10, 2024 @ 11:06am 
Originally posted by DrinkFromTheCup:
Originally posted by Quintium:
Terraforming is likely worse.
*sigh*
Terraforming should be lightweight due to it being singular heightmap image.
Unless there were some preparations for "proper" holes-in-the-ground, which either I've missed or didn't started.

Player terraforming increases instance count, which increases save time and reduces fps. Been a known thing/issue since day one, so much so in the early days they changed how it works to be less resource hungry. You can press F2 in game to see the resource window.
Last edited by Horemvore; Feb 10, 2024 @ 11:07am
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Feb 8, 2024 @ 4:04am
Posts: 10