UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

Hello there, thought people would find this interesting. Hopefully someone will be able to help.

Playing a multiplayer game with three people total. First noticed frame stuttering on my computer in multiplayer as the game got older and our factory got bigger. Other players didn't have the same issue; after much diagnosing using single player and multiplayer we thought this meant my computer is slower than the server. Which it almost certainly is.

HOWEVER, it's happening in a slightly strange way and circumstances that I thought might be interesting to developers and others.

So in single player, FPS and UPS drops in the following situations:
  • When fully zoomed out in map view on Nauvis BUT only with pollution turned on. Turning pollution overlay on causes the "render preparation" time to quadruple, with a drop from 60FPS/UPS to 50FPS/UPS.
  • When fully zoomed out in map view on Vulcanus but with certain overlays turned on. Turning on pump overlay for example causes the "render preparation" time to triple, with a drop to 55FPS/UPS.
  • When looking at a "busy" area of Vulcanus, but only when first looking at it (the FPS/UPS returns to 60 in a short amount of time). Moving the mouse around to highlight things causes "render preparation" time to go up, which causes an FPS/UPS drop. As does looking at one of the pinned map cutaway views.
  • When scrolling or moving around the map quickly (e.g. in map view or with legendary mech with twelve legendary legs). But only when looking at areas for the first time or when something changes
  • When looking at a platform blasting through very very very dense asteroids. But again only when looking at for the first time or when a railgun goes through a lot of huge asteroids in one shot.
These situations also, as you would expect, cause significant FPS drops in multiplayer (though not UPS drops).

Computer spec is AMD Ryzen 9 3900X with a Nvidia RTX 4070 Ti.

GPU usage never goes above 10%, and processor usage never goes above 5%. Looking at process explorer, the highest Factorio thread never tops 3.5% CPU usage. No individual CPU core goes above 60% usage from what I can see. V-Sync and G-Sync turned off, power saving performance on CPU and GPU set to maximum performance.

I suspect all the above is because of the CPU or something else is at its maximum limits, and then a bit of extra GPU time pushing everything over the edge? However none of the actual hardware seems anywhere near to max capacity.

We could lower the game speed on the server, but I don't want to nuke other people's achievements just because my computer is too slow. Perhaps a new CPU with better single thread performance would help... or overclocking the existing CPU. However am interested to see what people think.


Busy Vulcanus, with and without cutaway window.

20241114092706_1.jpg
20241114092706_1.jpg (1.77 MiB) Viewed 657 times
20241114092711_1.jpg
20241114092711_1.jpg (1.76 MiB) Viewed 657 times

Nauvis, with and without pollution overlay.

20241114084702_1.jpg
20241114084702_1.jpg (651.21 KiB) Viewed 657 times
20241114084553_1.jpg
20241114084553_1.jpg (658.02 KiB) Viewed 657 times

Vulcanus, with and without pipe overlay.
20241114093705_1.jpg
20241114093705_1.jpg (901 KiB) Viewed 657 times
20241114093717_1.jpg
20241114093717_1.jpg (903.19 KiB) Viewed 657 times
Entity readout with dense asteroids. What is "SmokeWithTrigger"? Also the asteroid collectors are busy.
20241114093346_1.jpg
20241114093346_1.jpg (1.19 MiB) Viewed 657 times

Nauvis with pollution AND pipe overlay, with corresponding readouts from Process Explorer and iCUE when under this processing load.
20241114094816_1.jpg
20241114094816_1.jpg (640.95 KiB) Viewed 657 times

Factorio threads, process explorer:

2024-11-14 09_48_24-Window.png
2024-11-14 09_48_24-Window.png (56.71 KiB) Viewed 657 times
GPU, CPU overall usage and memory specs.
2024-11-14 09_48_43-Window.png
2024-11-14 09_48_43-Window.png (129.12 KiB) Viewed 657 times

As said, would be very interested in people's thoughts and help!
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

See also screenshots showing the various settings from this post: 68653
20241114101335_1.jpg
20241114101335_1.jpg (696.49 KiB) Viewed 634 times
20241114101355_1.jpg
20241114101355_1.jpg (690.49 KiB) Viewed 634 times

Slowdown also occurs when manually firing artillery to scout new areas:
20241114101923_1.jpg
20241114101923_1.jpg (716.23 KiB) Viewed 634 times
20241114101908_1.jpg
20241114101908_1.jpg (706.68 KiB) Viewed 634 times
Attachments
Test 3.zip
(86.86 MiB) Downloaded 10 times
fwyrl
Inserter
Inserter
Posts: 48
Joined: Fri Jul 01, 2016 10:54 pm
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by fwyrl »

What do your individual GPU cores's or fuctions' usages look like? It's possible to pin your GPU at only 10% usage if, say, 10% of it is running at 100%, and the other 90% is doing nothing. That 100% is the average across all functions, including things like video compression/decompression, RTX, etc.

Something like HW info should let you look at this iirc, though it's a bit advanced.
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

fwyrl wrote: Fri Nov 15, 2024 12:12 am What do your individual GPU cores's or fuctions' usages look like? It's possible to pin your GPU at only 10% usage if, say, 10% of it is running at 100%, and the other 90% is doing nothing. That 100% is the average across all functions, including things like video compression/decompression, RTX, etc.

Something like HW info should let you look at this iirc, though it's a bit advanced.
I'm not entirely sure how to check individual GPU cores... We may be pushing my knowledge of modern GPU architecture, but doesn't a 4070 TI have several thousand cores? If the game is GPU bottlenecked with the GPU at 10% and lower, I'm not sure that's within my capabilities to fix (though hopefully useful to the developers)? And there aren't too many consumer upgrades to a 4070 TI?

In this case, I suspect some part of my computer (maybe the CPU) is already close to capacity in keeping up with the server, and certain things push it over the edge.

As a curious example, moving the mouse around on the screen (bringing up tooltips) can now cause FPS slowdowns (see attached video).

Bringing up any tooltip with the contents of the logistics network on Vulcanus ALWAYS does, but that's because it a sprawling montrosity. Rapidly moving the mouse cursor to the other displays and then back to Factorio can also reliably cause FPS slowdowns. Artillery "activating" biters by destroying their nests also causes slowdowns which need to be recovered from.

Would be very interested by any thoughts or responses people might have!
Attachments
Sequence 01_1.mp4
(60.06 MiB) Downloaded 17 times
posila
Factorio Staff
Factorio Staff
Posts: 5371
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by posila »

It's not GPU issue. It's that your update time is so close to 16 ms, that there is not time to pause update to prepare rendering (more overlays = more time needed to prepare rendering). In single player, your UPS would start dropping, in multiplayer the game tries to maintain update rate with the server at cost of framerate.
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

Thanks for the reply posila, much appreciated!

I'm currently running with the theory that upgrading the CPU will help, in addition to whatever optimisations come out in future updates.

...and we could of course not having platforms going incredbly slowly through incredibly dense asteroid fields, but where is the fun in that...
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by BlueTemplar »

You don't seem to have mentioned trying to lower your graphic settings ?

Otherwise, it's a shame that Factorio still doesn't have a system to automatically slow down game speed (like some other infinite scaling games do !) so that the weakest computers can keep up :
Option to make server wait for slowest client
and others :
viewtopic.php?f=6&t=94768
and related issues :
viewtopic.php?f=49&t=82132

Because, regardless of how much Wube improves game performance, given enough playtime, the factory will keep growing until there is only one computer left.
BobDiggity (mod-scenario-pack)
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

BlueTemplar wrote: Mon Nov 18, 2024 1:52 pm You don't seem to have mentioned trying to lower your graphic settings ?
Most graphics settings seem to reduce load on the GPU and VRAM, both of which are nowhere near capacity.

The situation seems to be that even a small increase (0.5ms to 1ms) in render preparation causes the FPS (and FPS/UPS in single player) to drop. There's not much slack left from the game update (15ms) for the render (1.3ms to 2ms usually).

Mousing over a logistics storage chest on Vulcanus causes the render preparation time to double, almost from 2.0ms to 3.8ms. Mousing over a steam turbine causes the render prep to increase by 1.4ms (from 1.3ms to 2.7ms). Doing either causes my computer to fall behind the server.

Turning off all smoke effects when looking at a full screen of steam turbines does nothing either way. Which is good!

If the primary bottleneck is the CPU, I'm not sure what graphics settings would be useful in terms of reducing load on the CPU? From the tooltips, I've already seemed to tick all of them.

Unless there were some dramatic improvements, it still wouldn't in a lot of the cases mentioned in the various posts, such as scrolling around (unless you kept your mouse on the minimap to avoid sprogging tooltips) or trying to view the pollution map on Nauvis.
posila
Factorio Staff
Factorio Staff
Posts: 5371
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by posila »

Update and render run in parallel, but they have sychnronization point - render preparation, which block both render and update. Disabling options "show smoke", "show particles" and "show decoratives" will remove some work from render preparation ... how much depends on how much smoke, particles and decoratives would there be on the screen (which in map view is none). Otherwise ... less overlays (including alt-mode) and more zoomed in (so smaller number of things on screen) is better for render preparation.
BlueTemplar wrote: Mon Nov 18, 2024 1:52 pm Otherwise, it's a shame that Factorio still doesn't have a system to automatically slow down game speed (like some other infinite scaling games do !) so that the weakest computers can keep up
Yeah, it's pitty, wheybags prototyped it long time ago, but it didn't get merged. And I am not willing to take it upon myself to "sell this feature" to the team, implement (and maintain) it.
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

And of course, another solution would be to destroy the "son of icebreaker" platform.

Having tested in singleplayer, that platform alone is taking up about 2.4ms of game update time... or to put it in other terms, 25% of all entity update time.

All FPS/UPS issues vanish when that platform is destroyed in single player. (though n.b. it has to be destroyed. If you just delete it via the UI option, it keeps doing whatever it is doing in the background until the 5 minute timer is up).

Clearly trying to get to the shattered planet has a performance cost!

Before and after the timer runs down.
20241118154914_1.jpg
20241118154914_1.jpg (945.49 KiB) Viewed 385 times
20241118154925_1.jpg
20241118154925_1.jpg (831.9 KiB) Viewed 385 times
Caddrel
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Oct 27, 2024 10:14 am
Contact:

Re: UPS / FPS slowdowns despite low GPU and CPU usage; somehow related to fast movement and pollution!

Post by Caddrel »

posila wrote: Mon Nov 18, 2024 3:42 pm Update and render run in parallel, but they have sychnronization point - render preparation, which block both render and update. Disabling options "show smoke", "show particles" and "show decoratives" will remove some work from render preparation ... how much depends on how much smoke, particles and decoratives would there be on the screen (which in map view is none). Otherwise ... less overlays (including alt-mode) and more zoomed in (so smaller number of things on screen) is better for render preparation.
Ooo, very helpful. It is true, my happy place so far has been to simply zoom in a bit closer or go to a slightly less busy area when performance begins to suffer.

No idea whether this is useful, but there seem to be particularly big jumps in render prep looking at logistic chests (>1.5ms increase, doubling in same cases). Or pipes (0.8ms or thereabouts). And steam turbines (1.3ms increase).

Assemblers, meanwhile, show little increase when moused over. Solar panels seem to change their performance cost depending on whether it is day or night (approx 1.0ms increase in render prep as soon as they start generating power, but little to no increase when not). Same with accumulators.

This is probably all well known and probably written down somewhere else on the forum already, apologies. I mainly mention it because in the case of say solar panels, it's a 500% increase in "game render presentation" time depending on whether they're generating power or not. "Game render presentation" drops from 1.2ms to 0.2ms as soon as that bar is either empty or full.
Post Reply

Return to “Technical Help”