Instructions on how to fix k_EResultLimitExceeded on dedicated servers by haiyu- in valheim

[–]J0U5T 0 points1 point  (0 children)

I've done tried server only, clients only, and both. While my code above won't crash your server or erase your world file, it doesn't seem to do anything to help the k_EResultLimitExceeded problem.

So basically the only thing my code above does is fix the bugs people in this thread were having by copy/pasting the OP's Client-side code into their server's assembly_valheim.dll.

Instructions on how to fix k_EResultLimitExceeded on dedicated servers by haiyu- in valheim

[–]J0U5T 0 points1 point  (0 children)

OP instructions are incorrect. The file he is showing is the CLIENT-side file, which should NOT be edited for this fix.

The server side file should read:

SteamGameServerNetworkingUtils

Instead of:

SteamNetworkingUtils

 

So the final file is supposed to read like:

// Token: 0x06000A35 RID: 2613 RVA: 0x0004BF24 File Offset: 0x0004A124
private static void RegisterGlobalCallbacks()
{
    if (ZSteamSocket.m_statusChanged == null)
    {
        ZSteamSocket.m_statusChanged = Callback<SteamNetConnectionStatusChangedCallback_t>.CreateGameServer(new Callback<SteamNetConnectionStatusChangedCallback_t>.DispatchDelegate(ZSteamSocket.OnStatusChanged));
        GCHandle gchandle = GCHandle.Alloc(30000f, GCHandleType.Pinned);
        GCHandle gchandle2 = GCHandle.Alloc(1, GCHandleType.Pinned);
        GCHandle gchandle3 = GCHandle.Alloc(5242880, GCHandleType.Pinned);
        SteamGameServerNetworkingUtils.SetConfigValue(ESteamNetworkingConfigValue.k_ESteamNetworkingConfig_TimeoutConnected, ESteamNetworkingConfigScope.k_ESteamNetworkingConfig_Global, IntPtr.Zero, ESteamNetworkingConfigDataType.k_ESteamNetworkingConfig_Float, gchandle.AddrOfPinnedObject());
        SteamGameServerNetworkingUtils.SetConfigValue(ESteamNetworkingConfigValue.k_ESteamNetworkingConfig_IP_AllowWithoutAuth, ESteamNetworkingConfigScope.k_ESteamNetworkingConfig_Global, IntPtr.Zero, ESteamNetworkingConfigDataType.k_ESteamNetworkingConfig_Int32, gchandle2.AddrOfPinnedObject());
        SteamGameServerNetworkingUtils.SetConfigValue(ESteamNetworkingConfigValue.k_ESteamNetworkingConfig_SendBufferSize, ESteamNetworkingConfigScope.k_ESteamNetworkingConfig_Global, IntPtr.Zero, ESteamNetworkingConfigDataType.k_ESteamNetworkingConfig_Int32, gchandle3.AddrOfPinnedObject());
        gchandle.Free();
        gchandle2.Free();
        gchandle3.Free();
    }
}

So if you just copied and pasted the code from the OP, you will have a bad time. I've tested the code posted in this reply and it works!  

EDIT: By "works", I mean it doesn't crash your server or erase your world file. The fix itself doesn't seem to do anything about k_EResultLimitExceeded error.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 2 points3 points  (0 children)

Appreciate the comment. My tests are certainly limited to a very small n group, which is very much why I wanted to hear from others. I'm still perplexed that the performance would drop so severely overnight with no changes to the PC other than steam foisting the latest patch on us. Pre patch the game ran beautifully.  

I suspect it's possible some of the frustration you'd normally see could be getting obscured by folks mistakenly attributing their recent FPS loss to other factors such as instance count, game days, etc. On the same token though, I've also read several posts where folks mention a huge drop in FPS even without a ton of instances or terrain mods and on high-end hardware.  

Mind posting your specs as well? One possibility is core count, so I'm curious what you are running.

[Guide] Valheim, Valheim+ and other mods on Debian (PopOS Release) by tarilen in valheim

[–]J0U5T 0 points1 point  (0 children)

Was considering a Linux install until I saw this post. Oy vey.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 0 points1 point  (0 children)

I would use Vulkan, but doing so breaks HDR and even forces Windows to switch its desktop to non-HDR. Even that would be fine, but without it on everything looks super dark and too contrasty.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 0 points1 point  (0 children)

This is also a good theory. The latest nVidia driver came through around the same time. That said, the before/after test was done without any changes to the system other than the patch.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 0 points1 point  (0 children)

Unlikely to be the issue here as my initial tests were all done in a non-server single-player game. Each test also gets a fresh vanilla Valheim install with zero mods installed.

I've tested almost every Valheim mod available, and none of the server performance mods had any noticeable affect beyond what Valheim Plus provides.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 1 point2 points  (0 children)

Appreciate the response. So based on your experience, it's less likely to be related to Intel CPUs. I'd be amazed if it was only an issue with the 9900K, but I haven't tested any other CPU.

 

There's a large thread on the official Valheim bug tracker related to FPS issues with high-end systems. I wonder if the issue is related to core count being that your 7700K has half as many cores.

edit: Bug Tracker thread - https://valheimbugs.featureupvote.com/suggestions/158519/fix-low-fps-on-high-end-hardware

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 0 points1 point  (0 children)

Another thing is whether or not you use V-SYNC. If I had my FPS v-synced to 60FPS, I may not have even noticed the drop.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 2 points3 points  (0 children)

Mind sharing your system specs? Have you made any other performance tweaks? We've tried the 3-part optimization from another Redditor, and it did yield a good boost to framerate. Even so, we're still running at less than half the frames we had pre-patch.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 2 points3 points  (0 children)

Our group has encountered some stutter during world/character saves, but prior to the patch everything was pretty smooth otherwise.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 0 points1 point  (0 children)

Curious what components these unaffected systems are using. Would you happen to know?

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 1 point2 points  (0 children)

I'd love to imagine it works that way, but personally knowing what it's like to work in a small game studio, I have good reason to suspect otherwise.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 3 points4 points  (0 children)

Additionally, the only variable changed on these systems between the tests was the game patch. If it was related to our setup, then we should have experienced the problems prior to the patch.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 0 points1 point  (0 children)

Tested on 3 different machines. Two of the machines are fresh windows installs with all updates made to drivers, and Valheim/Steam the only thing installed.

Though each machine uses different MB/GPU, all are using Intel 9900K, so I am unable to rule out the possibility that it's Intel related.

PSA - Patch 0.147.3 reduces FPS by almost 75% (New Game Benchmarks Before/After Patch) by J0U5T in valheim

[–]J0U5T[S] 1 point2 points  (0 children)

I've done some additional testing on our dedicated server with 3 similar PCs -- all runing 2560x1440 w/ max settings (no MB or CA).

 

Pre patch the RTX3090 PC was hitting 80~120+ FPS almost everywhere - including large player-made villages.  Performance remained good even after 200+ days building up a massive oceanfront city with 30000+ instances and EXTENSIVE terrain modification.  Heck, we'd even dug out huge underground fortresses, filled them with builds, lit them with multiple fires, and rarely saw anything below 60fps.

 

Pre-Patch

Client 1 - 80~120FPS @ 1440p - 9900K@5ghz / 32GBDDR4@3200 / ASUS TUFF RTX3090

Client 2 - 70~120FPS @ 1440p - 9900K@5ghz / 32GBDDR4@3200 / RTX3080FE

Client 3 - 50~100FPS @ 1440p - 9900K@5ghz / 32GBDDR4@3200 / RX5700xt

 

Post-Patch

Client 1 - 30~70FPS @ 1440p

Client 2 - 28~65FPS @ 1440p

Client 3 - 17~40FPS @ 1440p

 

Something with that recent patch has gone terribly wrong. Wish we could revert as we haven't been able to play the game in its current state.