Valheim

Valheim

This topic has been locked
LOW FPS & LAG/DESYNCS? Look here.
Hello all,

Below I give some insight and information on FPS and desync issues. This is not a complete list and not a full-on detailed analysis, but it gives you some insight and some reach to what is happening and why it is happening, as well as providing some basic fixes you can apply to mitigate the issues.

LOW FPS

1) The game stores terrain modifications as an object. If you terraform your world badly, you will get poor FPS as every modification is stored in memory. That means every time you enter an area that has been terraformed, it needs to recalculate every modification. Every object in the game is an 'instance'. A 100x100 square is already 10 000 instances. You can imagine that flattening land can easily reach these numbers, and then on top of that you have to load all objects (walls, lights, etc.) Then after that, the game will need to calculate collisions. Yes it gets bad fast. The more you do the worse it gets and you cannot undo it. Once you modified terrain, it will remain modified forever.

Sadly there is no fix for this yet so do not do excessive terraforming .
See:
https://www.reddit.com/r/valheim/comments/lqcr88/reason_behind_low_fps_and_huge_instance_numbers/


2) The game does not utilize multicore support and GFX processing. You can modify your game files and settings a bit to utilize these changes. This is pretty straightforward. You can find some FPS fixes below, but especially the config file and the Steam command options are pretty effective. I do not recommend increasing CPU priority.
The fix:
https://attackofthefanboy.com/guides/valheim-increase-performance/

3) the game uses ridiculous post-processing that don't even look good. I'm personally not a big fan of post-processing and in this case, it also eats away FPS and makes the game looks ugly. Not my cup of tea. I suggest you take a look at this article and try changing these options. You can decide for yourself if you like the settings, but do note that these settings eat away FPS when enabled
* Chromatic aberration
* Depth of field
* Motion blur
See:
https://www.pcgamer.com/valheim-recommended-graphics-settings/

LAG & DESYNCS
The game runs pretty poor netcode. You will notice a lot of issues when hosting/joining servers. Why? Because of two reasons:

1) The game artificially limits the amount of data that can be sent & received. The limit is 60-64 kbps which is hilariously LOW. If the request data load is higher than this limit, a que of actions is formed. This que will be cleaned in time. For large bases and many terraforming, this que becomes huge and desyncs you.

2) A player is responsible for hosting each area. The first player that enters an area becomes it's owner and is responsible for telling the server what happens to that area. Not a problem, unless this person has poor ping and he is throttling the information. In this case, all people are affected and you cannot open chests etc. because the HOST has to load the chest before you can access is.

The combination of 1) and 2) can be disasterous. The amount of data sent is limited and one person is hosting - meaning that if several people are in a location, the HOST has to load both the world and the other player's worlds.

Some extra detailed information (also for people that have DSL):
https://steamcommunity.com/app/892970/discussions/0/4939856028569039376/

The fix:
You can overcome some of these problems by modifying the game's .dll to allow higher bitrates. Sadly this is complicated to do.
The biggest improvement is applying this fix to the server and/or host. A smaller but noticable effect is gained by everyone applying this fix.
Personally I have forced all people on my servers to apply this fix and gameplay is 100 times more stable and desyncs only occur very rarely.

A guide can be found here:
https://indiefaq.com/guides/valheim-fix-for-multiplayer-lag.html
I personally boosted the amount by simply adding a zero to the end, so make it 614400


-------------------------------------------------------------
Extra info:
note on the terrain terraforming issue: This has happened in a couple Unity based games in development over the years, most notably Empyrion: Galactic Survival. It will eventually be fixed but likely not until the finalized textures and poly meshes are in the game.
Last edited by [IN-S] Cyllin; Mar 1, 2021 @ 7:00am
< >
Showing 1-15 of 22 comments
Grimsdottir Mar 1, 2021 @ 5:12am 
+1
Sanki Mar 1, 2021 @ 5:27am 
that still isn't a fix for players with ♥♥♥♥♥♥ DSL connection, Valheim creates a spam of tcp and udp connections through your router and in some cases may block those packets, this results player is not able to open chests/pick up loot etc. even with low pings.
[IN-S] Cyllin Mar 1, 2021 @ 5:29am 
Originally posted by $anqtuarium(no connection):
that still isn't a fix for players with ♥♥♥♥♥♥ DSL connection, Valheim creates a spam of tcp and udp connections through your router and in some cases may block those packets, this results player is not able to open chests/pick up loot etc. even with low pings.

Sadly there's some things I can't offer you a fix on. The game doesn't even send that much information, but DSL will struggle at the most minimal of upload speeds. The problem is that this game is P2P and thus requires simultaneous upload and download to function properly, and that is something that DSL goes flat on.
Trip Mar 1, 2021 @ 6:14am 
Wish I had known about the terraforming before I started chopping up the terrain on my friends server.

Is there any guide to how much as too much?
[IN-S] Cyllin Mar 1, 2021 @ 6:19am 
Originally posted by Trip:
Wish I had known about the terraforming before I started chopping up the terrain on my friends server.

Is there any guide to how much as too much?

Every object in the game is an 'instance'. If you press F2 while in game, you can see the instance counter loaded. A 100x100 square is already 10 000 instances. You can imagine that digging a trend + flattening land can easily reach these numbers, and then on top of that you have to load all objects (walls, lights, etc.)

Then after that, the game will need to calculate collisions.
Yes it gets bad fast.

No guide on how much is too much, but flattening a mountain is likely too much already. Digging a small moat is probably not so bad. The more you do the worse it gets and you cannot undo it. Once you modified terrain, it will remain modified forever.
MeGa Mar 1, 2021 @ 6:31am 
Interesting post thx! Give him an award or sth lol people only awarding trolls lately
TECHNOMANCER Mar 1, 2021 @ 6:33am 
Thanks for posting this in detail, and linking it from other threads so people see it....


"This has happened in a couple Unity based games in development over the years, most notably Empyrion: Galactic Survival, back in the day, it will eventually be fixed.
But it's not worth working on for the DEVs until the finalized textures and poly meshes are in the game." -from my post on the issue.
It's a "known quantity" in Unity games where you can terraform.
The terrain issue will get fixed, it is not super complicated just time consuming and most likely easier once they finish building the rest of the biomes on the existing code structure.

I am honestly not sure if this is a constant issue amongst all systems | On my wifes server both of use cant find a location over 10k Instances and one of the players bases is heavily modified terrain wise. I spent an hour with f2 on while i cleared a side of a mountain till my iron and bronze pick broke. The instances raised and fell but never changed much. I started at 7761 instances and ended at 7832 instances.

I don't know if it's something other people are doing differently or if its a system issue or even different for dedicated servers, but I've have been trying to find an area even breaking 10k instances on our server.
love how the ocean is 81-170 instances, is there even a floor out there?
[IN-S] Cyllin Mar 1, 2021 @ 6:36am 
Originally posted by Grimm Liberty:
Thanks for posting this in detail, and linking it from other threads so people see it....


"This has happened in a couple Unity based games in development over the years, most notably Empyrion: Galactic Survival, back in the day, it will eventually be fixed.
But it's not worth working on for the DEVs until the finalized textures and poly meshes are in the game." -from my post on the issue.
It's a "known quantity" in Unity games where you can terraform.
Do you mind if I add this text to the main post?
Grimsdottir Mar 1, 2021 @ 6:37am 
Originally posted by Grimm Liberty:
Thanks for posting this in detail, and linking it from other threads so people see it....


"This has happened in a couple Unity based games in development over the years, most notably Empyrion: Galactic Survival, back in the day, it will eventually be fixed.
But it's not worth working on for the DEVs until the finalized textures and poly meshes are in the game." -from my post on the issue.
It's a "known quantity" in Unity games where you can terraform.
Wait. They're gonna be updating the meshes and textures? That might raise the game from 1gb to 2gb! Like wtf. Thats UNACCEPTABLE. IT NEEDS TO 200+GBS like COD.
Considering the amount of items and the size of the map and the content we have. Its crazy how small the game is. I was basically JohnTron when I saw the size of the download and then got into the game and explored a bit. A full "what the.. WHAT THE F*CK?" moment.
[IN-S] Cyllin Mar 1, 2021 @ 6:38am 
Originally posted by The Shattered Grin:
The terrain issue will get fixed, it is not super complicated just time consuming and most likely easier once they finish building the rest of the biomes on the existing code structure.

I am honestly not sure if this is a constant issue amongst all systems | On my wifes server both of use cant find a location over 10k Instances and one of the players bases is heavily modified terrain wise. I spent an hour with f2 on while i cleared a side of a mountain till my iron and bronze pick broke. The instances raised and fell but never changed much. I started at 7761 instances and ended at 7832 instances.

I don't know if it's something other people are doing differently or if its a system issue or even different for dedicated servers, but I've have been trying to find an area even breaking 10k instances on our server.
love how the ocean is 81-170 instances, is there even a floor out there?

Instances are only objects not native to the seed. You cannot modify much in the ocean, so the instances you see are yourself, your boat, some of your stuff, the loot in your ship, etc.

I'm not sure how exactly the instances are calculated. The system is not dumb: is a terrain is modified twice, it will merge changes into one instance. However the merge is never perfect and chunks will never overlap 100% so it won't be extremely effective over a very large area.

My base has 12k instances and you can really notice it's taking it's toll. I assume some changes are more resource intensive that others - that far my knowledge does not go. :)
TECHNOMANCER Mar 1, 2021 @ 6:41am 
Originally posted by Cyllin-OD:
Originally posted by Grimm Liberty:
Thanks for posting this in detail, and linking it from other threads so people see it....


"This has happened in a couple Unity based games in development over the years, most notably Empyrion: Galactic Survival, back in the day, it will eventually be fixed.
But it's not worth working on for the DEVs until the finalized textures and poly meshes are in the game." -from my post on the issue.
It's a "known quantity" in Unity games where you can terraform.
Do you mind if I add this text to the main post?

Feel free to do so.

I have learned to be patient with EA games, I've been a round a bit and seen it a few times in six years, LOL
Grimsdottir Mar 1, 2021 @ 6:43am 
Originally posted by Grimm Liberty:
Originally posted by Cyllin-OD:
Do you mind if I add this text to the main post?

Feel free to do so.

I have learned to be patient with EA games, I've been a round a bit and seen it a few times in six years, LOL
E... A... SPRORTS. Its IN YOUR WALLET.
Originally posted by Cyllin-OD:
Originally posted by The Shattered Grin:
The terrain issue will get fixed, it is not super complicated just time consuming and most likely easier once they finish building the rest of the biomes on the existing code structure.

I am honestly not sure if this is a constant issue amongst all systems | On my wifes server both of use cant find a location over 10k Instances and one of the players bases is heavily modified terrain wise. I spent an hour with f2 on while i cleared a side of a mountain till my iron and bronze pick broke. The instances raised and fell but never changed much. I started at 7761 instances and ended at 7832 instances.

I don't know if it's something other people are doing differently or if its a system issue or even different for dedicated servers, but I've have been trying to find an area even breaking 10k instances on our server.
love how the ocean is 81-170 instances, is there even a floor out there?

Instances are only objects not native to the seed. You cannot modify much in the ocean, so the instances you see are yourself, your boat, some of your stuff, the loot in your ship, etc.

I'm not sure how exactly the instances are calculated. The system is not dumb: is a terrain is modified twice, it will merge changes into one instance. However the merge is never perfect and chunks will never overlap 100% so it won't be extremely effective over a very large area.

My base has 12k instances and you can really notice it's taking it's toll. I assume some changes are more resource intensive that others - that far my knowledge does not go. :)

I get that about the ocean, Instances can not be entirely items non native to the seed as you can go form the boat to a new island and watch it raise to 6-7k on average.

The math behind it is a bit elusive.
Buck Fell Mar 1, 2021 @ 6:55am 
The game does not limit transmits to 56KBs. It does appear to set a limit on installation in valheim_assembly.dll as it varies from player to player. The game does average around 56KB/s for an average area with NPCs and buildings but that can easily spike to upwards of 100KB/s for very brief periods (second or two) if you enter a busy area that's not already under control of other players, it can also drop to 15 or 20KB/s if there's not much around.

https://steamcommunity.com/app/892970/discussions/0/4939856028569039376/
< >
Showing 1-15 of 22 comments
Per page: 1530 50

Date Posted: Mar 1, 2021 @ 5:07am
Posts: 22