Serious FPS/UPS drop when many enemies die. [0.15]

Bugs that are actually features.
jonatkins
Fast Inserter
Fast Inserter
Posts: 155
Joined: Wed Sep 30, 2015 7:29 pm
Contact:

Serious FPS/UPS drop when many enemies die. [0.15]

Post by jonatkins »

I've always noticed (started playing on 0.12) Factorio would start slowing down when destroying enemy bases with 100+ destroyer drones active. I'd always assumed it was just the number of enemies trying to attack me making the game lag, but with the addition of the nuke in 0.15 it may be more.

When firing a nuke into the center of a dense enemy base, the game will heavily lag, dropping from 45+ FPS/UPS to around 5 FPS/UPS. This starts during the explosion and continues for a while after the explosion effect has finished, but while the death animations are still active. Once the animations have finished, things return to normal.

It seems at it's worst when there's lots of worms - perhaps because they're smaller than bases so there's more in the same area.

The debug overlay gives some clues, hinting at both rendering and entity updates as problem areas - but it's hard to be certain as these numbers look to be averaged over a second or two and the event is quite short.

My PC is rather old, and I'm not expecting 60 FPS/UPS at all times - but there does seem to be something particularly sub-optimal in this area that could be worth looking at.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14348
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Serious FPS/UPS drop when many enemies die. [0.15]

Post by Rseding91 »

This isn't a bug (it's working as intended now) however I've noticed the same thing so I'll be taking a look at it sometime soon to see if I can make it faster :)
If you want to get ahold of me I'm almost always on Discord.
jonatkins
Fast Inserter
Fast Inserter
Posts: 155
Joined: Wed Sep 30, 2015 7:29 pm
Contact:

Re: Serious FPS/UPS drop when many enemies die. [0.15]

Post by jonatkins »

FYI, I've been looking at this issue to see what was causing it.

First I noticed it was largely caused in the display code
  • after launching a nuke, zooming in close and running away will greatly reduce the problem, as the deaths are off-screen. There's still a drop in FPS, but nowhere near as bad.
  • pausing the game mid-explosion, when it's on-screen and the FPS is low (e.g. an autosave) keeps the FPS low
Looking into the entity definitions, I found the blood explosion particle effects. When these are removed, it eliminates the FPS drops entirely.

For anyone else finding this thread, I've packaged this as a mod - https://mods.factorio.com/mods/jonatkins/AlienBloodFix
Sicnarf
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Fri Apr 08, 2016 9:32 pm
Contact:

Re: Serious FPS/UPS drop when many enemies die. [0.15]

Post by Sicnarf »

Is their any way with a vanilla game to turn off the blood effects in options? The lag when nuking is very annoying.
Post Reply

Return to “Not a bug”