For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

FritzHugo3
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jan 09, 2018 4:30 pm
Contact:

For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by FritzHugo3 »

I have 4.600 hourse playtime. I have ask e so many times, whats going on my fps, why i have 30 FPS/UPS.
First now i have relesaed that power pools are the incredible badest think ar in the gae for FPS drops! (and trainsignals too).

You can have 30.000 power pools and it make absolut nothing with the power pools if they are cabled as one Energy pool.
But if you have 200 power pools without the cable - WHAT I USED SINCE YEARS, since i played first time Factorio for better can see in the logistic cable stuff. The FPS goes so extremly increddible bad.

So PLEASE WHY this fact never stand in tips, in tutorial or something else.

So i understand if this are technicle reasons for the masive lags. But then please make an option for make teoraire invisible the electric cables that the player can better see the logistig stuff. - So than tecnicle this are one Network but the player can se if the are programming.

Yes i now there comes new changes with the new Patch in december and its nice with remember cable but please make shure the people can make this disable and make sure the cable an be cut or invisible.

Thanks.

(Damit so many years i must delet my projects becouse the FPS are so bad) - Nowbody says this with the power pools. So Why we have the option with Shits click a power pool if its so extrem bad)?

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

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Rseding91 »

Do you have a save file showing the issue you're describing? Could you please post it here if you do?
If you want to get ahold of me I'm almost always on Discord.

FritzHugo3
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jan 09, 2018 4:30 pm
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by FritzHugo3 »

I must look if i have saved my tests or not. but here are a picture https://ibb.co/TwrKYvy (normaly i have linked it in the first post i thought but maybe its losing.

I have make the test again at the normal game map and its aproved the same for me.

What i havent do now are test same in vanila but i dont se a reson why its there not also. Becouse i have this problems since years with complete diffrent mods. But yes the vanila test im must do and confirm.

I must have a look for a savegame but not now i must go do something in rl.

FritzHugo3
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jan 09, 2018 4:30 pm
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by FritzHugo3 »

Its not happen in vanila but it have anything to do how vanila handled mods generally.

So, after conducting about 10 hours of testing once again, I can say the following. It's not caused by a single mod. The issue seems to be in the fundamental structure of vanilla Factorio, how the game handles mods. Every mod apparently adds a little more load to the "Electric Network."

I suspect that each individual "electric network" (i.e., each standalone, unconnected power pole) queries each mod individually. And then the sum of networks * the sum of mods escalates to the point where these significant FPS issues occur. I imagine it like this: if you have 150 mods, each power network queries it 1 * 150 times. But if you have 200 power networks, it's 200 * 150 times, and that's just too many queries for the game or the single CPU core to handle.

That's why I'd like to make a big request to the development studio - please allow players to visually deactivate the power cables, just like they can disconnect actual power. This way, technically, you still have a network, the FPS is excellent, and the player still has their aesthetic and overview of logistic circuits.

For reference, my last test setup looked like this. I started a completely vanilla map first. I played far enough to craft the medium power poles. From there, I set up 156 medium power poles as a standalone network. Then I added the mods from my modpack one by one, started the game, loaded the map, and checked the values. I tested up to 150 mods, including major ones like SE, K2, 248, as well as small ones that add new ores. Every single mod affected the numbers.

Except for the very small and pure display mods like EvoGui, AffrraidInTheDark - so purely display mods - all mods seem to add a little more load to the electric network. It appears that all mods with recipes have this effect, although I can't say this with absolute 100% certainty.

And this now explains why I've been having performance issues for years. I enjoy using many mods; they greatly enrich Factorio. Without mods, I would never have reached 4,600 hours of gameplay. But because of the poor performance, I had to abandon every project in its early stages, which is truly unfortunate.

My English is unfortunately not sufficient for this, so the text has been automatically translated, and it's possible that not everything has been accurately conveyed.

I thank you very much for your valuable time and hope that you can incorporate the ability to visually disable selected cables in the patch or add-on.

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

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Rseding91 »

Can you please post a save file with the mods showing the slowdown?
If you want to get ahold of me I'm almost always on Discord.

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

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Stringweasel »

This seems similar to what I investigated here https://alt-f4.blog/ALTF4-52/. Many mega-base builders also know about this limiation, and try to limit isolated network. There's even a mod to locate isolated networks to improve UPS.

It's of course easy to reproduce by spawning many isolated power poles. But this is not a real save so you can see the use cases. IMO in real saves isolated poles are used many time for combinators management, and at train stations.

This is a thing only power players who go big experience. Can usually be worked around in vanilla. In mods like SE with hundreds of planets and spaceships it's an unavoidable problem as your save growz.

IMO though it's mostly regarded as one of the game's limitations to live with. But there would be _many_ players that would be happy if it was optimised a little :)
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

FritzHugo3
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jan 09, 2018 4:30 pm
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by FritzHugo3 »

No matter how large the base is, this occurs even after 1.5 hours. This tells me it's a structural issue with the base game.

I'll send my test map (you have a pm), but what I've been trying to say is that it doesn't matter which mod you use; almost every mod adds a bit more load to the electric network.

The map is vanilla except for minor quality-of-life mods; it has never been saved with "full" mods. I'll send the mods separately. Nothing should be updated, as it could lead to compatibility issues. To prevent others from downloading and causing me additional traffic, I'm sending it privately to you.

In my test, the massive mod "Space Exploration" increases the load by about a full point – it has a lot of recipes and blueprints. Smaller mods with fewer recipes accordingly create less load.

Nothing from the mods needs to be built in the game; simply having the mod active is sufficient.

So, load the semi-vanilla save, check the F5 number, exit the game, activate the first 5 mods, load the save, check F5, and the numbers will continuously increase without building anything.

To avoid any misunderstanding, I want to clarify "Stringweasel's" statement. In practice, larger bases likely have multiple "electric networks." However, the fundamental technical issue already exists in how the game processes the mods.

And yes, I also use wireless power poles for these cases, at all train stations and logistics programming.

If an individual interested in the link wants it, they can message me. But please understand that I won't make it available on the open, public internet. I believe the modders wouldn't agree if I were to reupload their mods, and due to the traffic. So, please only inquire if you have technical understanding, are a programmer yourself, or the like. (For those who are just curious, you can easily replicate the test on your own.)

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

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by aka13 »

You don't upload the mods when uploading a save, and it is not needed to load the save, fyi
Pony/Furfag avatar? Opinion discarded.

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

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Rseding91 »

Looking at the provided save; I can't test them in 2.0 because the mods won't load there but the area taking the time has been changed to where manual testing shows it takes almost no time for empty electric poles.

In 1.1 the cost for an empty electric pole is O(Number-Of-Entity-Prototypes * 3)

In 2.0 the cost for an empty electric pole is O(Number-Of-Types-Connected-To-Pole * 3)

In the case of an empty pole that's 0 so it's effectively O(0 * 3) or O(0)
If you want to get ahold of me I'm almost always on Discord.

Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Qon »

Rseding91 wrote:
Sat Oct 21, 2023 3:26 pm
In 1.1 the cost for an empty electric pole is O(Number-Of-Entity-Prototypes * 3)
Could you explain more why this is happening in every tick for every pole? And by empty pole we are talking about electric networks, not poles, right?
My guess is that it's for maintaining stats electric network usage stats. But just transferring electricity for a single tick without history might also do the same thing even if stats history wasn't a thing.

I was wondering how the game handled stats of networks being split and merged. With the power switch entity a network can now instantly be split into 10k separate networks and merged again the tick after, and for legit reasons like doing circuit controlled power priority and ramping up and down consumption to match energy reserve value etc. So I wonder if this has similar performance concerns, using power switches to dynamically change the topology of the networks at large scale.
Rseding91 wrote:
Sat Oct 21, 2023 3:26 pm
In 2.0 the cost for an empty electric pole is O(Number-Of-Types-Connected-To-Pole * 3)
If it's per connected entity in 2.0, does that mean there will me some kind of massive network merge that has to happen that makes performance potentially worse in 2.0, for heavy power switch use? Since this list has to be recomputed in 2.0, but not in 1.1?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser

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

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Rseding91 »

Qon wrote:
Sat Oct 21, 2023 4:23 pm
Could you explain more why this is happening in every tick for every pole? And by empty pole we are talking about electric networks, not poles, right?
It's per electric network. For a pole disconnected from everything else that makes it 1 electric network. It happens because the normal electric network process makes a buffer big enough to track consumption and production done by that network for that tick, does the transfer of power, and records it in that buffer. Then it goes over the buffer after all transfers are done between all priorities and adds the values to the network statistics. That buffer is number-of-entity-prototypes large so when power is transferred between things it can simply do: buffer[entity-id] += transfer; The buffer gets re-used between ticks but re-setting it to zeros at the beginning of the electric network update and checking what values are non-zero for tracking statistics after the electric network update takes a significant portion of time when there are hundreds of networks with thousands of prototypes in the buffer.
Qon wrote:
Sat Oct 21, 2023 4:23 pm
I was wondering how the game handled stats of networks being split and merged. With the power switch entity a network can now instantly be split into 10k separate networks and merged again the tick after, and for legit reasons like doing circuit controlled power priority and ramping up and down consumption to match energy reserve value etc. So I wonder if this has similar performance concerns, using power switches to dynamically change the topology of the networks at large scale.
When split, the statistics are copied. When merged they get merged; every value gets added from the source to the destination. it's very slow because it's O(N) on the number of things in the networks. That will never be faster than O(N) because the game can't simply decide to throw out existing statistics info. Power switches will always be poor for performance at that scale.
Qon wrote:
Sat Oct 21, 2023 4:23 pm
If it's per connected entity in 2.0, does that mean there will me some kind of massive network merge that has to happen that makes performance potentially worse in 2.0, for heavy power switch use? Since this list has to be recomputed in 2.0, but not in 1.1?
No. In 2.0 the buffer is changed to a flat-map where only the values things ask to be added are added. Once they're added they stay in the buffer and no re-sizing needs to happen. SInce like 99%+ of entities don't consume or produce power (and even if they do, they will only get added if they're actually in that network) the size of the map is significantly smaller compared to 1.1.


But again: heavy power switch usage will always be slow. There's minimal to almost zero advantage to using power switches over simply making more power production. The time and energy to wire up all the switches vs just making more production is a wash.
If you want to get ahold of me I'm almost always on Discord.

Tertius
Filter Inserter
Filter Inserter
Posts: 904
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by Tertius »

Rseding91 wrote:
Sat Oct 21, 2023 4:58 pm
But again: heavy power switch usage will always be slow. There's minimal to almost zero advantage to using power switches over simply making more power production. The time and energy to wire up all the switches vs just making more production is a wash.
Many thanks for that info, especially because I actually cared and couldn't stand powering all those beacons on a big smelter array for nothing if there was currently no input or the output was full. And it is fun to create "intelligent" circuits that detect if these beacons need power or not, and it's fun to watch how the array is switched off occasionally. I didn't perceive any usage spike or lag when a smelter array was switched on or off. Might be a perceivable impact if something toggles every tick, but not if there is a switch once every 1-2 minute.

Of course it's not really worth the hassle to save 1-2 U235 per hour or whatever. Now my conscience is clean if I just power these beacons for nothing :lol:
Last edited by Tertius on Sat Oct 21, 2023 11:44 pm, edited 1 time in total.

FritzHugo3
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jan 09, 2018 4:30 pm
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by FritzHugo3 »

Rseding91 wrote:
Sat Oct 21, 2023 3:26 pm
...
In 1.1 the cost for an empty electric pole is O(Number-Of-Entity-Prototypes * 3)
In 2.0 the cost for an empty electric pole is O(Number-Of-Types-Connected-To-Pole * 3)
In the case of an empty pole that's 0 so it's effectively O(0 * 3) or O(0)
So maybe the problem are not longer in 2.0 if we have luck?

Ahm, its not faire from me but you are here so :D dont think to bad over me. I found this two mods could be great for vanila.
https://mods.factorio.com/mod/power-grid-comb (for optical no spaghetti cable - its only for the optic)
https://mods.factorio.com/mod/queue-to-front-button (You have handcraft for 10 minits but now you must have fast a other thing - you must not ll abborded with this
(both dont compromise any ballance, its only qol and i think realistic for vanila)

I say thank you all the nice people here. Its much more as i have hope from writing the first post here. Its not often that Devs answer player in game forums. This tell me this Devs love her work, game and more they respect the modder and i found this absolut greatly.
Also i say thank you the other posters here.

All other are to tecnical high for me, that's why im out here. But ofcourse fell free to talk

Have all a verry great weekand.

User avatar
MEOWMI
Filter Inserter
Filter Inserter
Posts: 332
Joined: Wed May 22, 2019 12:21 pm
Contact:

Re: For devs - Would this huge FPS problem with power pools are fixd in the Addon/Patch on december?

Post by MEOWMI »

Tertius wrote:
Sat Oct 21, 2023 5:35 pm
And it is fun to create "intelligent" circuits that detect if these beacons need power or not, and it's fun to watch how the array is switched off occasionally. I didn't perceive any usage spike or lag when a smelter array was switched on or off. Might be a perceivable impact if something toggles every tick, but not if there is a switch once every 1-2 minute.
I once had somewhere between dozens to a hundred of those "energy saving laser builds". They toggled just about every second in order to maintain a specific charge level on an accumulator. Having it active made me lose like 30 FPS/UPS. After I turned it off, I never dipped below 60 in the hundreds of hours afterwards.

If you're just running a modestly sized factory, playing around with the idea can be fun, and can work without lag in those cases, but on larger scales, it just makes way more sense to just add more power production.

Post Reply

Return to “Ideas and Suggestions”