Page 1 of 1

[0.17.31] [modded] huge UPS drop when holding a blueprint.

Posted: Fri Jun 07, 2019 1:20 am
by credomane
I've been playing on a server (that's been slow to update) everything's been going great until last week. Now (or at least it has only become bad enough now) whenever any player picks up a blueprint to place into the world every connected player has their FPS tank from 60 to 5fps. It becomes nearly impossible to restore everything to normal without pausing the game for clients to catch up again before unpausing. Upon investigation over several days the issue seems to be related (from my limited view) to 60844. The "render preparation" goes from <1-4ms all the way up to ~40ms instantly. I've tried updating factorio to 0.17.45 and updating all mods but the issue still persists. It might have something to do with the fact that the blueprints (i honestly have no idea, really, but it is my best guess) all "create" about 3k+ core/cursor-boxes.png sprites at a minimum when holding the blueprint for placement while the biggest offenders tend to create 13k+ of the core/cursor-boxes.png sprite. These blueprint aren't even that big, imo, to be creating so many instances of that sprite.

In MP this spike in "render prep" makes fps drop to 5fps. This, as we know, is because the client is trying the best it can to keep up with the server's 60ups.
Then in SP this make my ups drop to 20-32 depending on the BP and fps follows suit because fps is always less-than-or-equal to UPS.

Attached or linked is:
A perf log from the debug menu showing before holding a bp then holding a bp for about 2 seconds each.
220MB zip file of mods used on the server. ... sp=sharing
21MB save from the server. ... sp=sharing
time-usage screenshot
gpu-usage screenshot

blueprint shown in the screenshots is the worst offender for this issue that i've found. Let me know of any other info you might need or want and I'll do my best to provide it. I know support for modded is limited but I'm thinking and hoping this is also a vanilla issue too.

Re: [0.17.31] [modded] huge UPS drop when holding a blueprint.

Posted: Tue Jun 11, 2019 8:31 pm
by Klonan
I think this is related to viewtopic.php?f=30&t=61861

So if it persists in the next release let us know by reposting the bug report with a log from the latest version

Re: [0.17.31] [modded] huge UPS drop when holding a blueprint.

Posted: Tue Jun 11, 2019 10:21 pm
by posila
Unfortunatelly it is not related.

61861 is about suboptimal sprite batching, resulting into many draw calls each with small CPU overhead, resulting in very low FPS. (Render time is high)

This is about creating dummy entities in order to render the blueprint and do buildability checks, eating time of the update. (Render preparation is high; Render is normal = under 16ms)

Re: [0.17.31] [modded] huge UPS drop when holding a blueprint.

Posted: Tue Jun 11, 2019 10:59 pm
by tehfreek
Can some buildability checks be deferred until the next update? That way only the eventual placement will lag (because of course all buildability checks will need to be performed at once then).

Re: [0.17.31] [modded] huge UPS drop when holding a blueprint.

Posted: Sat Jun 15, 2019 7:04 am
by kovarex
Yes, that blueprint is HUGE, and rendering so huge amount of previews and all the info takes some time. So this is expected. I'm saying not a bug. (Yes it could be optimized out, but only to let people to preview even bigger blueprints etc.)