Valheim

Valheim

Not enough ratings
Fix For multiplayer Lag
By All Might
If you encounter some extreme rubber banding and skipping during multiplayer and can't attribute it to one person's connection or faulty server hardware, it is most likely due to the game's 60kb upload cap and the tendency for players to hit the cap in complex multiplayer situations. Hopefully this guide will help you out but it goes without saying, I do not guarantee anything.
   
Award
Favorite
Favorited
Unfavorite
Download DNSPY
Download DNSPY -> https://github.com/dnSpy/dnSpy/releases

Extract the contents into its' own folder somewhere on your pc.

Run DNSPY

File > Open:
Navigate to (Drive where your game is located):\SteamLibrary\steamapps\common\Valheim\valheim_Data\Managed\
Select assembly_valheim.dll
Click Open

In the left panel Titled 'Assembly Explorer', Find and select assembly_valheim.dll.
Select {}
Select ZDOMAN
Select m_dataPerSec, Right-Click and select Edit Class...
in the line "private int m_dataPerSec = " set it to at least 122880
Click Compile in the bottom right corner
Click File > Save Assembly
Start your Server.
If you are hosting the Valheim locally on your own PC, then all you need to do at this point is launch your server and have some people join. If you are still experiencing lag, then other things may be causing your problems and I am sorry.

If you are connecting to a dedicated server, then you need to replace the assembly_valheim.dll file that the dedicated server uses. Once the file is replaced using the new value, start/restart your server to load the new file.

Check your performance in-game by hitting F2 and checking the data sent value. If this does not go past 60 then you did something wrong or the .dll was overwritten.


IF THE GAME UPDATES, IT OVERWRITES ASSEMBLY_VALHEIM.DLL AND YOU WILL NEED TO REDO THESE STEPS
21 Comments
SapphireStar Dec 4, 2021 @ 5:34pm 
Theres no M_DataPerSec.
Augustus Geezer Mar 31, 2021 @ 11:42am 
Is this still needed with the latest patches? the patch notes say they are working on networking and multiplayer lag specifically...
Ithendyr Mar 21, 2021 @ 12:54pm 
@ClammyMantis488 Thanks for the info 😉
Vallen Feb 27, 2021 @ 9:40am 
Is client side data received capped as well and fixable? Or is that fixed by the dedicated server upload fix? Always seems capped pretty low as well but haven't had the chance to get the server owner to test this fix.
The Time Traveler Feb 25, 2021 @ 10:09pm 
easier to just wait until game isnt in early access than all this garbage. trying to milk AAA quality out of a alpha state game is sort of like sucking a cows face for milk. Time will make the game better. Not outside source installation files from who knows where.
`Hilf Feb 24, 2021 @ 11:14am 
It helped with some lags but server still freezes occasionally (with net connection icon in top left of screen). when I press F2 and see server status, freezes occur when "Data Recv" drops to 0. Sertver then freezes, sometimes even crashes and on realod previous save is loaded. It's really annoying as it happens more frequently lately and it's hard to play.

So far there is no solution for this problem, right? as this one didn't help, unless my server host compiled something wrong :D
Sumsum Feb 23, 2021 @ 4:55pm 
@clammymantis488 thanks for explaining that.. being on rented dedicated server, the files aren't on my pc, so that makes sense.

But you're saying needs all the files within that folder? or of the whole game? because i need to actually download them to my pc, fix and then upload them back in.
ClammyMantis488 Feb 23, 2021 @ 11:54am 
For the people with compile errors, it needs the rest of the game files as well to compile, you can't just compile the one file
Reaper Feb 23, 2021 @ 7:17am 
If you use uMod. You are better off using my guide. You wont have to keep doing this for every update. Plus its pretty much drag and drop.

https://steamcommunity.com/sharedfiles/filedetails/?id=2405427267
Sumsum Feb 22, 2021 @ 6:47pm 
I use DNSpy and follow as the guide says exactly, but when it gets to "press compile at the bottom right corner" I do that and I get errors, and it doesn't compile/save.

I rent a server so had to download the dll file to change and then upload it back, but its not allowing me to as I mentioned in previous post