Gisbert replied to Server lag January 24, 2023 @ 4:55:07 am PST
No, you are the one here without a clue. I had more than one Valheim server up and running. Rewriting from ....scratch???
Boy, you have absolutly no clue what youre talking about. Stop spreading such nonsense - theres kids that could believe this. *shakes head*
Valheim uses a peer-to-peer driven server model for data transfer, which is hardcoded - yes we are in 2023 and not using a "client-server-model" in a multiplayer co-op game.
For explanation, even without script knowledge: The player who is first in a "chunk" becomes a kind of "server". The server you set up via provider does not handle the calculation of damage values or enemy spawns, the player client does. This is recalculated for each "chunk".
This works relatively okay as long as you play with 1-2 friends. But as soon as there are 4-5 people in one chunk, there is a bottleneck regarding the send/receive limits query, because all players forward information to a "designated server" and this server has to return the data for reconciliation to all players. All information is capped at one feed.
If you receive damage for example, one of the group members in one area has to do all the calculation, because the dedicated server itself doesn't.
When information gets stuck at the bottleneck, there are phenomena such as no access to a specific chest for everyone or a cart/enemy sinks into the ground. If the player in question goes offline, anyone can access the chest again, even if the calculation of the chest is done by the "main server" itself.
Valheim devs have "changed" some of the code in a patch some time ago, but it has done little to no good and they themselves have officially admitted that they can't solve the problem this way. But it's been a while. What the devs have done is to implement a kind of hybrid model, which shoots important information at a data jam through, so that at least damage calculation has priority, but as a counter, enemys fall more often in the ground or lagging through the area.
Everyone playing in bigger groups has noticed such things, even if the data seems not much to transfer. You can edit the send/receive limit cap on your server .dll via spydns to give a little higher cap. Which helped a lot for my people. On the other hand you must not set it too high, so information will get lost and you make it worse.
The guide I sent you does fine with all I said here and is the best method to make Valheim in big multiplayer sessions a little bit more enjoyable. But it won't fix the problem itself. The problem is the code as a whole, which must be rewritten to a client-server model to solve this problem as a whole.
This problem is very well known for anyone who is a bit in the know and often sets up servers or has knowledge of what he is doing at all. The devs try to ignore this kind of problem for whatever reason. I think the most people play with 1-2 other players, so they won't run in much trouble at all.
But if the OP is someone who has 4-5 friends playing with him, he will have extreme lag spikes from time to time and the game will be almost unplayable, even vanilla without mods, in direct comparison to today's 2023 standard. Every other player added, every stop forward in the game, every data package more sent makes it worse. Simple as that. Mistlands alone has raised the data which needs to be send a lot. And every update they add will do no favour to the peer-to-peer driven code of their game.
I spent weeks in the code to figure out whats going on or how to fix it, I hope you understand now - and stop accusing others of ignorance when you obviously have no idea at all.
3:13 pm, January 24, 2023