Valheim players, 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.
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
Related Posts:
- Valheim How to Fix Dedicated Server Desync/Lag (uMod)
- Valheim Dedicated Game Server (uMod Support)
- Valheim Player with More than 10 Players (uMod)
- Valheim How to Connect to Servers By IP
- Valheim Backup and Restore World or Character Data Guide
Just wanted to say thanks ! I had a severe lag/ruberbanding issue on my dedicated server that made the game unplayable, even preventing people to join sometimes and your fix seems to have solved it 🙂
I get all kinds of errors after hitting COMPILE (“identifier error,” “the type or namespace name…” etc). Any tips?
Did you move the DLL file out of the Managed folder? I did that first and got all sorts of errors when trying to compile, then I tried it again but this time left the file where it was, and it compiled without issue.
Oyjord, ya you need to keep the .DLL where it is, make a copy before trying to edit anything (I know most people know this) and edit the one in the folder, shouldn’t have any trouble.
dont edit the whole thing, or click edit IL Code and just replace the number, then save as. no need to compile
Same for me… something like inconsisten accessibility ZDOMan.ZDOPeer FindPeer(ZNetPeer netPeer)
I have a umod dedicated server. I tried changing it in the Steam path and there it works…
Need tips too^^
Just for Linux Server operators who come here – I was not able to modify a DLL for the Windows version of the game, and run that in place of the Linux compiled DLL (the lazy way)
However, I was able to download the DLL from my Linux server, rename it and put it in my game directory on my windows machine and use DNSPY to edit the linux version of the DLL following the steps above, and then move that back to the linux server and it worked.
The path is {relative-to-steamcmd-install-dir}/valheim/valheim_server_Data/Managed/ and the file is still called assembly_valheim.dll.
Good luck!
Doesnt seem to work with dedicated server on linux. As soon as I use the modified version the server wont start anymore with errors related to “not connected to steam”. 🙁
Any ideas?
Do you need to do this on the client side or only on the dedicated server?
We just did it on the dedicated server.
I read that you should only attempt to have each of your clients do it if doing the server alone first doesn’t help.
For us, just doing the server .ddl edit made a night and day difference. I was initially a bit skeptical but if you are having issues take my word this fix is worth trying.
I dont know how the dev team hasn’t put out a similar hotfix like this, to tide things over until a long term solution is found.
Many thanks for this tip, just compiled the .dll, now we see if it will work like intended. Nevertheless, since I don’t have a clue of C#, this manual was very much appreciated and relatively easy to follow.
Please help.
It is now the Hearth and Home update.
I got as far as the ZDOMan instance.
There is NO m_dataPerSec
I’m also getting the disappearance of m_dataPerSec please someone help!