stop rendering in the backround

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

its a me
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Jul 26, 2024 7:37 pm
Contact:

stop rendering in the backround

Post 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 851 times

aka13
Filter Inserter
Filter Inserter
Posts: 793
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: stop rendering in the backround

Post by aka13 »

Let's add complex logic around the renderer, so you can not play the game more efficiently 🤡
Pony/Furfag avatar? Opinion discarded.

User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 399
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: stop rendering in the backround

Post 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.
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Official Contributor to Space Exploration

mmmPI
Smart Inserter
Smart Inserter
Posts: 3521
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: stop rendering in the backround

Post 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.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1719
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: stop rendering in the backround

Post 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?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Kyralessa
Filter Inserter
Filter Inserter
Posts: 561
Joined: Thu Sep 29, 2016 5:58 pm
Contact:

Re: stop rendering in the backround

Post 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.

mmmPI
Smart Inserter
Smart Inserter
Posts: 3521
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: stop rendering in the backround

Post 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.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1719
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: stop rendering in the backround

Post 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! :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

fwyrl
Inserter
Inserter
Posts: 38
Joined: Fri Jul 01, 2016 10:54 pm
Contact:

Re: stop rendering in the backround

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 14011
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: stop rendering in the backround

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Ideas and Suggestions”