Page 1 of 1

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

Posted: Tue May 02, 2017 12:18 am
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.

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

Posted: Tue May 02, 2017 9:01 am
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 :)

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

Posted: Mon Jun 26, 2017 6:08 am
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

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

Posted: Thu Jul 13, 2017 9:43 pm
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.