sweetgiorni / AnyPortal

A Valheim mod for more flexible portals
Do What The F*ck You Want To Public License
17 stars 11 forks source link

Massive FPS drops when hosting #14

Open GashHammer opened 3 years ago

GashHammer commented 3 years ago

Issue Description

Describe the bug Server host experiencing massive FPS drops when another player joins. Going from 140fps down to as far as 15fps. No problems when solo. Only the host is affected. We each tried hosting and the FPS drop happens the moment another player starts to connect. Removing the mod fixes the problem.

To Reproduce Steps to reproduce the behavior:

  1. Players A & B have mod installed.
  2. Player A or B loads a server
  3. Player A has smooth FPS
  4. Player B initiates a server join
  5. The moment Player B starts to join, Player A experiences massive FPS drops. Even before Player B's character has loaded in.

Expected behavior A clear and concise description of what you expected to happen.

Additional context Tested with 3 players. Each took turns hosting and experienced the same problem. All running the same game version, BepInEx version and the same mods.

Screenshots If applicable, add screenshots to help explain your problem.

Game version and environment

Game client version (found in the bottom right of the Valheim main menu v 0.147.3

After reproducing the issue, please attach the BepInEx game log from Valheim/BepInEx/LogOutput.log

Does the issue occur in single-player or multiplayer? You can also check "Both" if you've reproduced the issue in both game modes

If the issue occurs in multiplayer, is the server a "local" server started through the in-game menu, or is it a headless server (like installing the "Valheim Dedicated Server" in Steam or using a server hosting service)

If you are using a headless server, please reproduce the issue and then attach the BepInEx game log from ValheimServer/BepInEx/LogOutput.log

If you are using a headless server, is it being hosted on a Windows machine or a Linux machine?

suniahk commented 3 years ago

What other mods do you all have installed? I'm asking because it may be that the issue lies with a clash with a different mod, rather than the core in-game server itself.

Spinks90 commented 3 years ago

Firstly, thanks for making a great mod.

I'm experiencing the exact same behaviour as @GashHammer is describing above.

Soon as the player connects (before they're in the actual game the FPS decreases massively)

Typically, I'm using the following mods:

I've disabled all mods except for using Vortex from NexusMod:

Still experiencing the lag. It seems to be when people are near the portals. Soon as you disable AnyPortal it's back to normal.

Don't know if anything helps you narrow it down but:

Any other information or anything let me know, it's awesome mod. Just hoping can get performance resolved.

Edit: Thought may help if I provide my portal names too.

Portal list:

GashHammer commented 3 years ago

What other mods do you all have installed? I'm asking because it may be that the issue lies with a clash with a different mod, rather than the core in-game server itself.

I tested it with no other mods installed and still got the fps drops

sweetgiorni commented 3 years ago

I'm guessing that this is because the server sends the entire collection of portal objects every time a client joins. Although, I didn't expect it affect performance this much. I probably used a synchronous method without realizing it. How long does the FPS drop last? I imagine it would go back to normal after the client gets all the portal objects.