Page 1 of 1

stop rendering in the backround

Posted: Thu Aug 01, 2024 8:53 pm
by its a me
i would like for the game to stop rendering the world if it is not visible.
i think that this could be done by not rendering anything when Factorio is in the background/not the focused window.
the reason that i think that this would be a good idea is that when Factorio is running in the background it is unnecessarily rendering and on my laptop is using 40% of the GPU's power
factorio.png
factorio.png (4.94 KiB) Viewed 702 times

Re: stop rendering in the backround

Posted: Thu Aug 01, 2024 9:32 pm
by aka13
Let's add complex logic around the renderer, so you can not play the game more efficiently 🤡

Re: stop rendering in the backround

Posted: Fri Aug 02, 2024 7:39 am
by Stringweasel
What you can do to reduce the load of your GPU when you minimize is to zoom-in as far as possible, at a place where there are as little entities as possible. This will give the GPU less things to draw, and speed up the game even if that's the bottleneck.

Re: stop rendering in the backround

Posted: Fri Aug 02, 2024 7:59 am
by mmmPI
Similar idea to what Stringweasel said, you can go into mapview before alt-tabbing, that can make laptop have longer battery and/or heat less.

Re: stop rendering in the backround

Posted: Fri Aug 02, 2024 9:05 am
by Pi-C
its a me wrote: ↑
Thu Aug 01, 2024 8:53 pm
… when Factorio is in the background/not the focused window … it is unnecessarily rendering and on my laptop is using 40% of the GPU's power
Does that mean you just switch to another program but the game continues (i.e., game time is progressing) in the background? If so, I've a problem that's similar but not quite the same:

I use my laptop for modding. Usually, I make a setup for testing that I'll save. After making changes in the code, I reload the save and take some action in the game that will trigger the things I'm working on (e.g. using a GUI, building/damaging/destroying entities, …). Once that is done, I pause the game and go back to the editor to check the log file and make some more changes. Most of the time, I spend in the editor and the game is not only running in the background, but "paused".

My problem is that the game isn't really paused: No matter whether I've temporarily paused the game with SHIFT+SPACE or whether I'm on the opening screen with the main menu, the game will eat resources. Once I've started Factorio, remaining battery power will drop to about half of what it was before; killing the process will double remaining battery power.

I'm using a local installation (no Steam), I've already turned off the menu simulations, and I usually run Factorio in single player mode (only on rare occasions I may host a game locally so that I can connect from my other computer to test multiplayer issues). Of course, I could shut down Factorio for good while I'm in the editor and restart it when I'm ready for testing -- but as starting the game takes some time (depending on the active mods), I'd like to avoid that. Is there some way to pause the game for real, so that the laptop doesn't consume as much power while the game is idle?

Re: stop rendering in the backround

Posted: Fri Aug 02, 2024 9:24 am
by Kyralessa
its a me wrote: ↑
Thu Aug 01, 2024 8:53 pm
i would like for the game to stop rendering the world if it is not visible.
Are you saying the game does this if it's paused?

Or do you mean you're just letting the game run in the background unpaused while you're doing something else?

If the latter, well, to me it kind of makes sense that the devs aren't spending development time on optimizing the game's performance at a time when no one is playing it. I'd rather they spend the time optimizing it while someone is actively playing it.

Re: stop rendering in the backround

Posted: Fri Aug 02, 2024 10:56 am
by mmmPI
Pi-C wrote: ↑
Fri Aug 02, 2024 9:05 am
Is there some way to pause the game for real, so that the laptop doesn't consume as much power while the game is idle?
You can try "suspending" the process in windows task manager, it is a little different use case if the game is expected to run or not in background, as in this case nothing will run. It's probably not recommended thing to do as usual practice :lol: but the result on laptop battery/temperature are of higher magnitude than just going on mapview even on empty map.

Re: stop rendering in the backround

Posted: Sat Aug 03, 2024 12:44 pm
by Pi-C
mmmPI wrote: ↑
Fri Aug 02, 2024 10:56 am
Pi-C wrote: ↑
Fri Aug 02, 2024 9:05 am
Is there some way to pause the game for real, so that the laptop doesn't consume as much power while the game is idle?
You can try "suspending" the process in windows task manager, it is a little different use case if the game is expected to run or not in background, as in this case nothing will run.
Thanks, you're correct: I don't have to rely on an in-game solution if I can use the tools provided by the OS instead (not the windows task manager, by the way, Linux has 'kill -STOP' and 'kill -CONT')! But with all the settings and hidden settings that exist, I've been fixated on looking for a solution directly in the game. (There must be many people who are running the game in single player mode -- quite unlikely nobody else has been upset about their computer burning through CPU/GPU cycles while they are idling in the main menu!)
It's probably not recommended thing to do as usual practice
Definitely not recommended for normal gaming -- at least not without saving the game before suspending the process! :-)

Re: stop rendering in the backround

Posted: Mon Aug 05, 2024 3:35 pm
by fwyrl
Pi-C wrote: ↑
Fri Aug 02, 2024 9:05 am
No matter whether I've temporarily paused the game with SHIFT+SPACE or whether I'm on the opening screen with the main menu, the game will eat resources. Once I've started Factorio, remaining battery power will drop to about half of what it was before; killing the process will double remaining battery power.
I suspect this is your laptop seeing a known high performance draw process (game, productivity, etc) and enabling some kind of turbo, performance mode, etc. It's possible that it's actually using enough resources to do that ingame, but in the menu seems highly unlikely. Also possible you're running low on RAM and using SWAP space, which would impact battery life as well; Factorio draws just over 2.2 Gb on the menu, which is a lot if your laptop still has, say, 8 gb.

Re: stop rendering in the backround

Posted: Tue Aug 06, 2024 3:14 am
by Rseding91
We tried once in the past to do some special logic around window-not-focused and it instantly broke on mac (viewtopic.php?f=11&t=54575). Ever since we have avoided anything of the kind because it just isn't reliable and we get bug reports.