high CPU usage when idle
Posted: Sun Jul 10, 2016 8:07 pm
on a Mac the CPU usage under 0.13.6 is high even when the program is sleeping / put in pause.
Is that ok?
Is that ok?
Thanks for clarifying. Good to know - I can definitely live with it as is I was just curious.posila wrote:Hi, one thing to note is that Factorio is PC game, so it never is idle. Even if you pause it, it constantly tries to render 60 frames per second. So if you made the screenshot on single or double core computer, it is operating within expected parameters.
We currently use Sleep() in our message loop to wait a little bit if the game manages do update and render in less than 16ms, which makes CPU usage drop below "100% of one core" in small Factories, but using Sleep() is generally wrong approach for games, because Sleep() may return control to the process too late and there won't be enough time to update and render next frame.
That is because the games aren't actually linked to the fps.bobingabout wrote:You know, when not in focus, a lot of the games I play drop maximum frame rate to 5. [...]
I would expect the same from Factorio.
The only way FPS and UPS are linked is that FPS can not exceed UPS since there would be nothing new to render anyway. The game has no problem showing you only 5FPS while updating 60 times a second, the issue is, that rendering is not really the CPU intensive task, updating is.Sifu wrote:That is because the games aren't actually linked to the fps.bobingabout wrote:You know, when not in focus, a lot of the games I play drop maximum frame rate to 5. [...]
I would expect the same from Factorio.
The game runs a cycle every frame that is delivered to your screen. That means that at 5fps your whole factory would run 12 times slower than maximised...
Also that would mean that with my 144hz monitor I would be able to make my factory run 2.4 times faster.
Correct me if I'm wrong, but devs have decided to tie the fps to the cycle speed for simplicity.