A critique of Factorio’s power generation systems

Post all other topics which do not belong to any other category.
foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by foamy »

eradicator wrote:
Sat Jul 18, 2020 5:12 pm
wosthisdo wrote:
Fri Jul 17, 2020 10:31 am
There are lots of mods that play with power generation (most overpowered), but I'm hoping that Factorio 1.1 might update the power distribution system.
Never gonna happen. Electrical system is heavily ups-optimized. And such a change would turn every factory currently in existance into garbage, forcing players to do major reworks for no fun gain at all. Minecraft on the other hand has a bunch of mods with different tiers, and a bunch of more mods with completely unique power systems. If you haven't tried i very much recommend you do.
I mean, they juggled the science recipes pretty recently, and I rebooted a megabase to build from scratch rather than bother reworking things. The devs clearly are willing to break things.

And it's still vaguely silly that small electric poles are, by far, the most effective way to move power any kind of distance.

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by astroshak »

Eh ... dunno about that.

If you drive around my town (the suburbs of Tampa, Fl) you’ll see a few places where they have “Large Power Poles” but that most of the power poles are still the “Small” type. Some are being replaced by “Medium” ... this is wholly based upon the apparent materials composition of the power poles, mind you - wooden, metal, or metal framework for small, medium, and large respectively.

wosthisdo
Inserter
Inserter
Posts: 21
Joined: Wed Sep 18, 2019 6:28 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by wosthisdo »

I think you're conflating transmission networks with distribution networks.

See, for example wikipedia https://en.wikipedia.org/wiki/Electrica ... nglish.svg

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by Hannu »

wosthisdo wrote:
Sat Jul 18, 2020 6:48 pm
Certainly something like that. Obviously 'fun' is different for different folks! I just think it's very overlooked - apart from poles I'm not sure it's been updated since the dark ages. I have no LUA experience but would be happy to devote some time to help develop a mod.
Unfortunately it is not possible to make realistic like mod. There can be very simple artificial restrictions, like power pole X can conduct Y steps, but not anything interesting, like tradeoff between losses, reliability and power handling. It seems not possible at all with Factorio's development rules.

Some kind of semi realistic power network simulator would certainly be an interesting game. I have sometimes thought programming it for myself (without fancy graphics and commercial like UI, which are far too laborious for one hobbyist programmer), but even very simple version would take very much time. And it would be very tedious and hard to begin if player does not have any electrical engineer background and basic knowledge of working principles of power networks.
My other idea is simulated nuclear reactor with quite realistic coolant and thermal flows (modeled with real equations) but fictive nuclear physics (for example fissile stuff with positive temperature feedback which must be controlled). That's because too realistic reactors running decades flawlessly may be somewhat boring from entertaining point of view.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by Ranakastrasz »

Hannu wrote:
Tue Jul 21, 2020 1:24 pm
wosthisdo wrote:
Sat Jul 18, 2020 6:48 pm
Certainly something like that. Obviously 'fun' is different for different folks! I just think it's very overlooked - apart from poles I'm not sure it's been updated since the dark ages. I have no LUA experience but would be happy to devote some time to help develop a mod.
Unfortunately it is not possible to make realistic like mod. There can be very simple artificial restrictions, like power pole X can conduct Y steps, but not anything interesting, like tradeoff between losses, reliability and power handling. It seems not possible at all with Factorio's development rules.

Some kind of semi realistic power network simulator would certainly be an interesting game. I have sometimes thought programming it for myself (without fancy graphics and commercial like UI, which are far too laborious for one hobbyist programmer), but even very simple version would take very much time. And it would be very tedious and hard to begin if player does not have any electrical engineer background and basic knowledge of working principles of power networks.
My other idea is simulated nuclear reactor with quite realistic coolant and thermal flows (modeled with real equations) but fictive nuclear physics (for example fissile stuff with positive temperature feedback which must be controlled). That's because too realistic reactors running decades flawlessly may be somewhat boring from entertaining point of view.
https://mods.factorio.com/mod/flownetwork
Never actually tried it, and it is way outdated, but does look like a proof of concept for more complex power simulations.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by Hannu »

Ranakastrasz wrote:
Tue Jul 21, 2020 2:06 pm
Never actually tried it, and it is way outdated, but does look like a proof of concept for more complex power simulations.
More complex yes, and that mod seems to be nice and interesting work. However, it looks more like some kind of fluid flow network than electric network. It is possible to reduce calculations significantly if some kind of storage is assumed in every node. Then next state can be calculated by simple matrix multiplication (under certain conditions). In realistic electric networks effects are immediate and linear system have to be solved at every time step. Or even non linear system, if such effects are taken into account (which may be important in real systems).

dmsilev
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Dec 19, 2017 4:50 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by dmsilev »

eradicator wrote:
Sat Jul 18, 2020 7:54 pm
For a mod the only realistic way i see would be enforcing very complex restrictions on pole2pole connections, as there is no moddability of the actual power system.
As a hypothetical, how about this:

* Power poles consume power, like an always-on lamp or similar. How much per pole is a game-balance question, but big poles should consume less even per pole than the others.
* The area of effect range of a big pole is set to be equal to its physical footprint. You can’t power anything directly off a big, you need to have one of the smaller ones as an intermediary.
* If restricting pole-pole connections is feasible for a mod, only allow big poles and substations to connect to big poles, and also change substation area of effect to match physical footprint. Move substations to be in the same tech node as big poles. Medium and small poles connect to each other and to substations.

Result is any efficient power transmission over distance has to go from generator to substation to a long set of big poles, to another substation, to a bunch of medium poles spanning the consumers. Because even the big poles cost power, player has to decide whether separate power networks or one big connected grid makes more sense for a particular map.

foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by foamy »

Conceptually that's okay, if restrictive, but it lacks a wide-area option for sub-distribution, like the current substations provide. And that would be a useful option since there are a bunch of layouts that medium poles don't work for; some replacement would be appreciated.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by posila »

Hannu wrote:
Tue Jul 21, 2020 4:53 pm
More complex yes, and that mod seems to be nice and interesting work. However, it looks more like some kind of fluid flow network than electric network. It is possible to reduce calculations significantly if some kind of storage is assumed in every node. Then next state can be calculated by simple matrix multiplication (under certain conditions). In realistic electric networks effects are immediate and linear system have to be solved at every time step. Or even non linear system, if such effects are taken into account (which may be important in real systems).
I don't know the algorithm, so out of curiosity - is the dimension of matrices you are talking about linearly proportional with number of nodes, edges between nodes or am I thinking in wrong direction here?

dmsilev
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Dec 19, 2017 4:50 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by dmsilev »

foamy wrote:
Wed Jul 22, 2020 5:23 am
Conceptually that's okay, if restrictive, but it lacks a wide-area option for sub-distribution, like the current substations provide. And that would be a useful option since there are a bunch of layouts that medium poles don't work for; some replacement would be appreciated.
Fair point. OK, leave substations as-is and introduce a new entity, "transformer", that can connect to large poles as well as substations/small/medium.

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by Hannu »

posila wrote:
Wed Jul 22, 2020 6:45 am
I don't know the algorithm, so out of curiosity - is the dimension of matrices you are talking about linearly proportional with number of nodes, edges between nodes or am I thinking in wrong direction here?
If circuit can be assumed to be an impedance network, finite speed of electromagnetic interaction, electromagnetic radiation and harmonics of fundamental frequency can be neglected, typically voltage in every node (power pole or pole of consuming or generating device) is calculated (node voltage method). if number of nodes is n admittance matrice is nxn. It is also possible to formulate equations to calculate currents through edges (loop/mesh current method). Straight transmission lines without branches, which are simply impedances in series, can be combined to one impedance which may be significant improvement in game.

https://en.wikipedia.org/wiki/Nodal_analysis

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by posila »

Hannu wrote:
Thu Jul 23, 2020 9:35 am
If circuit can be assumed to be an impedance network, finite speed of electromagnetic interaction, electromagnetic radiation and harmonics of fundamental frequency can be neglected, typically voltage in every node (power pole or pole of consuming or generating device) is calculated (node voltage method). if number of nodes is n admittance matrice is nxn. It is also possible to formulate equations to calculate currents through edges (loop/mesh current method). Straight transmission lines without branches, which are simply impedances in series, can be combined to one impedance which may be significant improvement in game.

https://en.wikipedia.org/wiki/Nodal_analysis
Thanks for elaborating on this. I know there are algorithms for matrix multiplication that have lower time complexity than O(N^3), but it is still larger than O(N^2), and that's just way too much time for such a fundamental mechanic as power distribution. Even if we spread it over one second instead of repeating it every single tick, it would still end up dwarfing everything else in the simulation, I think.

(Note: I am talking just on hypothetical level, there is no way we are going to add complexity into power distribution; but I think the idea of physics based power distribution is interesting, and probably large enough topic for standalone game)

wosthisdo
Inserter
Inserter
Posts: 21
Joined: Wed Sep 18, 2019 6:28 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by wosthisdo »

Thanks for the interest and replies guys (and sorry to OP for hijacking a bit). 'Oxygen Not Included' (currently being youtubed by veteran Factorio player Tuplex while he waits for 1.0) has a simplified and very much smaller implementation of limitations. https://oxygennotincluded.gamepedia.com ... r_Circuits

For now I think I'll just set some self-imposed limits on my transmission network and represent step-up/down with accumulators - which may skew my research path a little

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by eradicator »

posila wrote:
Thu Jul 23, 2020 11:46 am
I think [...] standalone [...] physics based power distribution [...] game [...] is interesting.
Today a factorio developer leaked information about the next game they're going to make: Electritorio confirmed.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by foamy »

dmsilev wrote:
Wed Jul 22, 2020 3:05 pm
foamy wrote:
Wed Jul 22, 2020 5:23 am
Conceptually that's okay, if restrictive, but it lacks a wide-area option for sub-distribution, like the current substations provide. And that would be a useful option since there are a bunch of layouts that medium poles don't work for; some replacement would be appreciated.
Fair point. OK, leave substations as-is and introduce a new entity, "transformer", that can connect to large poles as well as substations/small/medium.
That's basically ONI's process. You have two kinds of wire, with maximums on the amount of power in the grid before they take damage, and you connect/isolate grids via transformers and power switches. The current power load in a given grid, and what grid a given power pole is part of, are already known pieces of information in Factorio, so an implementation there -- which doesn't owe much to the detailed physics of electricity transmission, but would at least *look* saner -- might not require a tremendous amount of additional calculation.

User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by 5thHorseman »

foamy wrote:
Thu Jul 23, 2020 9:26 pm
That's basically ONI's process. You have two kinds of wire, with maximums on the amount of power in the grid before they take damage, and you connect/isolate grids via transformers and power switches. The current power load in a given grid, and what grid a given power pole is part of, are already known pieces of information in Factorio, so an implementation there -- which doesn't owe much to the detailed physics of electricity transmission, but would at least *look* saner -- might not require a tremendous amount of additional calculation.
Seems this would possibly be doable as a mod, maybe. Based on what I've seen of the Creative Mode mods that create magical energy providers and consumers.

DISCLAIMER: I don't know anything about modding.

Large power poles can hold literally any charge.
Medium power poles can hold, say, 10MW, whatever. That's a balance question. A good amount but not infinite.
Small power poles can hold less than that. Maybe 1MW. Maybe less. Again, that's a balance question. It should be a number that you won't likely reach until well after you can make Medium and Large power poles.
If a power pole is on a network where consumers are consuming more than it can hold, it blows. I don't know if the pole should get destroyed or just the wire connection. Either could be annoying depending, on the situation. Poles should be checked one at a time, slowly over time in game terms, so that when a grid is overpowered only one pole blows which would sever that grid's connection. Unless there are redundancies, in which case multiple poles will blow one at a time until that grid is sufficiently cut off.

New building: Transformer. Unlocks when you unlock the bigger power poles.
It does not propagate electric networks through it. You can end-run around one, but that would be bad.
It has X explicit connections to provider power networks. X could be as low as 1.
It has Y explicit connections to requester power networks. Based on the pole connected to it, it won't provide any more power than that pole can carry (but it will provide less).
For provider networks, it acts as a power consumer. For requester networks, it acts as a power producer. It consumes the power it needs to provide, unless there isn't enough in which case it provides less to each consumer.

I'm not saying I'd like this. I just think it's logically possible and doesn't seem any more processor intensive than current power generation systems. I don't know if Factorio runs any worse with 1000 individual power networks vs 1 world-girdling one, but I've never seen a complaint about it.

wosthisdo
Inserter
Inserter
Posts: 21
Joined: Wed Sep 18, 2019 6:28 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by wosthisdo »

I really like the transformer idea to impose the sort of discipline / 'realism' I had in mind. I can understand why the idea of over-power events causing damage would not be widely popular ;)

Since we don't have transformers yet and I can't work out any vanilla circuit network way of monitoring and controlling power on distribution network sections I'm going to fall back on self-imposed constraints and rely on brown-outs to tell me when I'm being greedy. This is what I'm going to try and, if it seems reasonable, I'll use it for my 1st 1.0 base.

1. Large power poles max at 500MW. (~ 4-reactor Nuc or ~280-boiler coal).
2. Large poles can only connect to power stations and sub-stations. (I'm assuming the step-up from 25kV to 400kV is built into the power station).

3. Sub-stations reduce to 132 kV and can feed up to 3 Medium pole lines each at 165MW max.
(I'd like to say only the heaviest industry could connect direct to medium - but I suspect that will make pole placement difficult).

4. Accumulators (standing in for transformers) drop to 11kV and can feed up to 2 small pole lines each at 80MW max.

5. Small power stations can feed Medium or Small pole lines directly, subject to 165 / 80MW limit on single lines.

I think this will scale roughly with the evolution of power generation technology and demand from early-game to at least rocket launch. I'll try it out and see.

[Edited to add] I routinely use power switches to, for example, cleanly toggle science production & research on and off, same for mining. With the new build I'll use more to potentially isolate the distribution network sections.
If anyone knows of a simple mod that allows power switches to output a value to the circuit network that is proportional to the power flowing through them I'd really like to hear about it. Thanks.

[Edited to add] Found it :D
https://mods.factorio.com/mod/power-combinator

scooter010
Inserter
Inserter
Posts: 22
Joined: Tue Apr 30, 2019 6:09 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by scooter010 »

I think, the OP has gone over solar way too fast.

Solar is easy in small dimensions.
Did u ever try to power your factory only with solar?

If u want to achieve this in a reasonable period of time, u have to do a lot of logistics work. I normally add extra production lines incl. Railway station, smelters an so on just for producing panels, grounding stations, logistics network stations and accumulators.

Then extra production of landfill. Then enough bots and/or transport everything to a temporary train station. Because solar fields are getting really big very fast. I don't need any walls. If biter start to fight through the solar field, it would take hours for them.

Much more complex than just printing 2 or 3 BP for the nuclear plant and covarex processing. And nuclear plants, steam engines and so on are included in the mall. Even 100 reactors are cheap in the endgame. Solar fields complexity scales in the endgame. Ur energy consumption increases faster and faster. U have to build everything and logistics for extending ur solar also even faster. But that part is not completely to automate. Going there, clear biters, transport landfill, transport solar and so on, remove rails, print solar fields.

It's like outposting

mrvn
Smart Inserter
Smart Inserter
Posts: 5699
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by mrvn »

In factorio the electric network has some priority. E.g. steam engines don't produce power if solar panels produce enough. Or assembler don't get any power if laser turrets need it all.

I wish there were a entity that would allow directing the flow of energy. Both the input and output terminal should have a priority setting.

So for example I want to take power from the emergency steam engines (so input priority high enough to draw from steam engines) and supply it to the network but only for laser turrets (output priority low enough so only laser turrets draw from it).

Even with just the existing priorities this new entity would allow creating virtually unlimited priority levels because by drawing from one priority and supplying it at another you can bump the priority back up and split it again over and over.

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

Re: A critique of Factorio’s power generation systems

Post by Qon »

mrvn wrote:
Tue Aug 04, 2020 3:21 pm
I wish there were a entity that would allow directing the flow of energy. Both the input and output terminal should have a priority setting.

So for example I want to take power from the emergency steam engines (so input priority high enough to draw from steam engines) and supply it to the network but only for laser turrets (output priority low enough so only laser turrets draw from it).
This seems pretty cool, and also pretty moddable. I think Transformers does exactly this.
Edit: with some edit maybe: https://mods.factorio.com/mod/Transform ... 0009d723bd

Post Reply

Return to “General discussion”