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
Extract the contents into its’ own folder somewhere on your PC.
Run DNSPY.
- File >>> Open.
- Navigate to: …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!!!
https://jamesachambers.com/revisiting-fixing-valheim-lag-modifying-send-receive-limits/
i find new variable = sendQueueSize.
Change it twice (two places).
is there still no update on where this is found now? After the update the value m_DataPerSec is no longer there?
‘sendQueueSize’ is new variable for this.
Any find where to change the value now that m_DataPerSec is no longer a thing?
Yeah same issue here, using the search function and m_datapersec no longer exists 🙁
Looks like they may have changed either where this field is located or what the name is since this guide was posted. I can’t find this anywhere in the specified dll file.
If I host the server using Ubuntu with LinuxGSM, do you know where should I change the value?
in regular server do all players need to do this or just the host?
I get so many errors after I compile regardless of what I use and so I can’t save and try. The default is 642880 (as of 2/28/21) on g-portal servers. Any recommendations?
So is the goal here to be lowering this number for m_dataPerSec? Because my DLL was already set about 5 times higher than your listed value of 122880.
Reading through the code at one point they divide m_dataPerSec by 20 to perform a check comparing the size to determine if they want to break out of a loop early or not.
if you have a dedicaded server, we need to change client and server side ? or only server
I’ve only changed this serverside.
It only seems to affect the upload speeds of the server (and thus the receive speed of the client).
So the client upload will still be capped @ ~56kb/s
This solved all our lag issues though, as the server upload seems what was the bottleneck.
if i try to compile i only get errors and can not save
you don’t move assembly_valheim.dll before editing it we need to edit in …SteamLibrary\steamapps\common\Valheim\valheim_Data\Managed\
Yes same with me. I wonder what we’re doing wrong?
Very nice fix. I set it to 245760 which allowed us to play lagfree with 7 people in a boss fight.
Though, this only works for the server upload speed (which is fine)
I can’t believe that by default it is just 56kb/s
Can we apply a similar patch to increase the max number of players?
When I made the adjustment, my dedicated server would not come online.
Fuck yes, this worked wonders!