Valheim

Valheim

VieuxBoeuf Dec 27, 2024 @ 12:19pm
Sudden framerate drop
Hello,

First of all, kudos for this great game that I've been playing since the initial release of early access. Wanted a share a problem I've encountered since a few updates (after the initial Mistlands update) and hopefully see if you guys have any workaround.

Basically, I'm experiencing a sudden framerate drop (from 60 to 10 FPS) after a random duration, from ~15 to ~30 minutes. It is instant (not a gradual decline), and once the game is at 10 FPS, it stays that way until I close and restart it entirely, even in the main menu. CPU usage show something like 3 cores at 100% when it happens, as opposed to 50% on one core normally.

While I can't pinpoint the exact cause, I can give a few information :
- It's not caused by mods (vanilla Valheim install, no specific arguments).
- I'm on Linux running the native version, and at least two distros are affected (Ubuntu and Fedora).
- It happens on solo, self-host, or playing on a dedicated server.
- The cause seems to be random : it happened in combat, while crafting, building, even being idle doesn't protect from it.
- It's not linked to heavy buildings, I also experienced it while exploring in the wilds.
- It can happen in any biome.
- I didn't have this bug when Mistlands first came out, it def started after an ulterior update.
- It's neither an hardware/software issue : this is the only affected game, my rig is decent (i5 12600k, 32 gb RAM, Geforge 4070), and the game runs smoothly at 60FPS until the problem happens.
- It's not a memory leak : the game mem usage remains stable.

Any idea guys ? Thanks in advance ^^
< >
Showing 1-4 of 4 comments
jonnin Dec 27, 2024 @ 2:56pm 
the most common cause of lag spikes is saving to a slow disk drive or if the cloud is enabled once your world has become large. The size of your world increases dramatically as you do these things:
- uncover more of the map (small effect)
- edit terrain (large effect)
- build (large effect)
- clear instances (smallish effect)
and probably a few more things like placing map markers, harvesting renewable wild stuff (berries/shrooms/wood/rock/...)

however by default the game tells you it is saving and tells you how long that took too, so if it is related to the autosaves, it should be clear as the lag spikes will coincide with the save icon etc.

When in a heavily edited area, an area with a lot of lighting or particle effects, etc you can also get lag from that. But you said no... headscratching.

Otherwise, ... not sure, do you notice a pattern as to when it happens at all? Is there any chance some other program decided to do something in the background (linux is not quite as secretive about this stuff but it does a LOT of it just the same). Are you running this in a win emulator that could be doing something stupid because windows?
Last edited by jonnin; Dec 27, 2024 @ 2:58pm
VieuxBoeuf Dec 27, 2024 @ 3:24pm 
Hey thanks for your answer :)

Unfortunately, it's none of that stuff :

- It's not a spike due to saving (or even the occasional FPS drop that lasts for a second or two) : it's more like... for 20-25 minutes the game runs great, and then all of a sudden, it drops to 10 FPS and stays that way, until I quit/restart it.
- It's pure native Linux, no emulation (no Proton). Valheim is one the few games that have been running great so far on Linux, IIRC it's because the devs are Linux fans and code directly on it ;)
- I hadn't considered the background program thing. I tend to close everything and deactivate all the fancy stuff modern OSes activate, but one can never be too sure ! I'm not sure it'll come up with anything though, since Valheim runs great as soon as I restart it.
MaCarBre Dec 27, 2024 @ 4:31pm 
On Linux, you have to have Steam overlay enabled for this memory leak to not happen, both in general and for Valheim specifically. Happens in several games.
Last edited by MaCarBre; Dec 27, 2024 @ 4:32pm
Originally posted by MaCarBre:
On Linux, you have to have Steam overlay enabled for this memory leak to not happen, both in general and for Valheim specifically. Happens in several games.

Hey, thanks a ton, it worked ! I don't remember when I turned that setting off, but turning it back on resolved the issue, thanks :)
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Dec 27, 2024 @ 12:19pm
Posts: 4