[1.1.70] Prolonged lag from particles.
Posted: Sun Oct 23, 2022 8:46 pm
Mod Krastorio 2 has a grenade with a virus against biters, when using which there is a prolonged droop in performance. I can understand the performance drop due to the script (which actually kills half of the enemies on the map), but the debug option shows that much more time is spent on particle processing.
I find it strange that particles affect performance so much (What's with the particles turned on, what's with the particles turned off).
I did a check without mods as follows.
I created a new map with a lot of enemies (~60k) and ran a simple script:
As a result (in the screenshot), the frieze lasts for a couple of seconds, after which the UPS drops to less than 2 within a minute (approximately).
For control, I changed the method from "die" to "destroy":
As a result, the freeze for a couple of seconds and after the normal speed of the game.
Apparently, the "destroy" method is not used by the mod, since this method does not update statistics and does not raise the desired event.
Save file just in case.
I find it strange that particles affect performance so much (What's with the particles turned on, what's with the particles turned off).
I did a check without mods as follows.
I created a new map with a lot of enemies (~60k) and ran a simple script:
Code: Select all
/c for _, entity in pairs(game.player.surface.find_entities_filtered({force="enemy"})) do entity.die() end
Code: Select all
/c for _, entity in pairs(game.player.surface.find_entities_filtered({force="enemy"})) do entity.destroy() end
Apparently, the "destroy" method is not used by the mod, since this method does not update statistics and does not raise the desired event.
Save file just in case.