Linked Energy Sources/Script-Controlled Electric Networks

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
braxbro
Inserter
Inserter
Posts: 35
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Linked Energy Sources/Script-Controlled Electric Networks

Post by braxbro »

Hi. I wrote a long preamble for why I'd like this, which is in a spoiler block below for brevity.
TLDR - Linked connections for both items and fluids exist - and for items, have for a while
As of right now, there are only two aspects (that I can think of) of an entity that can't be linked in this manner: energy sources and heat connections. The latter can be addressed, as far as I know, through 1.1-style internal heat connections for compound entity applications. (but not for pseudo-underground heat pipes or cross-surface heat connections; those in theory can be hacked together with two assemblers creating a dummy fluid and two reactor prototypes consuming it using linked fluid boxes to connect them and a script to disable the reactors above a certain heat cap)

The former cannot. The best you can do right now is integrate a power pole into your compound entity and forbid placing power poles such that their connection area overlaps with the entity, or use linked connections to put all the energy source stuff on another surface. (which doesn't work if one of the components needs to be at the location of the compound entity... such as, say, a lightning rod)

So I propose the creation of a linked energy source type that functions as an electric energy source that only connects via control-stage script. This energy source would be available for prototypes anywhere an electric energy source is available. (maybe it should be a runtime thing or a property of electric energy sources?) For a full list, in case others are unaware, you can look at the api reference for ElectricEnergySources.

This would enable many things that aren't currently feasible without Lua scripting, hopefully in a less intrusive manner than, for example, adding fluid energy sources to entities that can only use void or electric energy inputs, or adding optional fluid/heat outputs to generator prototypes that don't already support them.
Example ideas enabled as compound entities by linked energy sources
Sorry for the huge write-up. I just had a thought and it kept going and going like a clown/magician pulling a chain of handkerchiefs out of their sleeve...
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by BraveCaperCat »

It doesn't make any sense for there to not be linked energy sources. I mean, there's already linked belts, linked containers/chests and linked fluid boxes/pipes, why not linked energy connectors? (or linked energy sources, receivers, etc)
Last edited by BraveCaperCat on Fri Jan 03, 2025 9:31 pm, edited 1 time in total.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
curiosity
Filter Inserter
Filter Inserter
Posts: 560
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by curiosity »

BraveCaperCat wrote: Fri Jan 03, 2025 9:11 pm It doesn't make any sense for there to not be linked energy sources. I mean, there's already linked belts, linked containers/chests and linked fluid boxes/pipes, why not linked poles? (or linked energy connectors, sources, etc)
Poles can already be linked. But the OP explicitly explains that poles aren't a solution and why.

Actually, what might help with the OP problem, if not linked energy sources, is electric network categories. Entities from different categories don't connect. It makes the power pole solution viable.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by BraveCaperCat »

curiosity wrote: Fri Jan 03, 2025 9:23 pm
BraveCaperCat wrote: Fri Jan 03, 2025 9:11 pm It doesn't make any sense for there to not be linked energy sources. I mean, there's already linked belts, linked containers/chests and linked fluid boxes/pipes, why not linked poles? (or linked energy connectors, sources, etc)
Poles can already be linked. But the OP explicitly explains that poles aren't a solution and why.

Actually, what might help with the OP problem, if not linked energy sources, is electric network categories. Entities from different categories don't connect. It makes the power pole solution viable.
When I posted my reply, I hadn't read the actual original post. Instead, I read about it in a few sentences elsewhere, which linked here. Those few sentences (unlike the "quite a lot" amount of sentences used here) didn't explain that linked poles were different from linked energy sources or that they couldn't fulfil the same purposes.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
braxbro
Inserter
Inserter
Posts: 35
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by braxbro »

curiosity wrote: Fri Jan 03, 2025 9:23 pm
BraveCaperCat wrote: Fri Jan 03, 2025 9:11 pm ...
Poles can already be linked. But the OP explicitly explains that poles aren't a solution and why.

Actually, what might help with the OP problem, if not linked energy sources, is electric network categories. Entities from different categories don't connect. It makes the power pole solution viable.
They are a solution, the issue is that the constraints on that solution are terribly awkward to work with and unintuitive for the player overall.

If you don't forbid electric network stuff near the compound machine with the power pole in it, then they may be confused, for example, when they see their boiler lightning rod (which is an idea that I had for a mod I intend to make that this would facilitate) drawing a ridiculous amount of energy because their power poles were placed too close. And if you do, you make it terribly inconvenient to work around the compound entity, which sucks.

Having the ability to set electric network 'layers' of sorts would also fulfill this feature request, though, you are right. (Hell, even just being able to override electric network connections for electric energy sources directly would cover it, tbh.)
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by BraveCaperCat »

braxbro wrote: Fri Jan 03, 2025 9:46 pm
curiosity wrote: Fri Jan 03, 2025 9:23 pm
BraveCaperCat wrote: Fri Jan 03, 2025 9:11 pm ...
Poles can already be linked. But the OP explicitly explains that poles aren't a solution and why.

Actually, what might help with the OP problem, if not linked energy sources, is electric network categories. Entities from different categories don't connect. It makes the power pole solution viable.
They are a solution, the issue is that the constraints on that solution are terribly awkward to work with and unintuitive for the player overall.

If you don't forbid electric network stuff near the compound machine with the power pole in it, then they may be confused, for example, when they see their boiler lightning rod (which is an idea that I had for a mod I intend to make that this would facilitate) drawing a ridiculous amount of energy because their power poles were placed too close. And if you do, you make it terribly inconvenient to work around the compound entity, which sucks.

Having the ability to set electric network 'layers' of sorts would also fulfill this feature request, though, you are right. (Hell, even just being able to override electric network connections for electric energy sources directly would cover it, tbh.)
What if you made a power pole with a connection radius of 0 and a supply area of 1? (or more if that's not enough, it just needs to be able to cover the combined entity)
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
curiosity
Filter Inserter
Filter Inserter
Posts: 560
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by curiosity »

BraveCaperCat wrote: Fri Jan 03, 2025 10:25 pm What if you made a power pole with a connection radius of 0 and a supply area of 1? (or more if that's not enough, it just needs to be able to cover the combined entity)
It's not the power pole that's the problem, it's every other power pole with its own supply area.
braxbro
Inserter
Inserter
Posts: 35
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by braxbro »

BraveCaperCat wrote: Fri Jan 03, 2025 10:25 pm
braxbro wrote: Fri Jan 03, 2025 9:46 pm ...
What if you made a power pole with a connection radius of 0 and a supply area of 1? (or more if that's not enough, it just needs to be able to cover the combined entity)
Entities can connect to multiple electric networks at once, and have no means of prioritizing between the two. This can be most easily seen by placing accumulators bridging two disconnected power networks; they serve as a sort of flow control for power between the two networks as one network charges them and the other draws from them. The receiving network(s) can never receive more than the accumulators can discharge, and the charging network(s) can never contribute more than the accumulators can accept.
protocol_1903
Fast Inserter
Fast Inserter
Posts: 156
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by protocol_1903 »

+1, I've run into similar issues with compound entities that a generic linked energy source like the one mentioned would solve
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Linked Energy Sources/Script-Controlled Electric Networks

Post by BraveCaperCat »

braxbro wrote: Fri Jan 03, 2025 10:41 pm
BraveCaperCat wrote: Fri Jan 03, 2025 10:25 pm
braxbro wrote: Fri Jan 03, 2025 9:46 pm ...
What if you made a power pole with a connection radius of 0 and a supply area of 1? (or more if that's not enough, it just needs to be able to cover the combined entity)
Entities can connect to multiple electric networks at once, and have no means of prioritizing between the two. This can be most easily seen by placing accumulators bridging two disconnected power networks; they serve as a sort of flow control for power between the two networks as one network charges them and the other draws from them. The receiving network(s) can never receive more than the accumulators can discharge, and the charging network(s) can never contribute more than the accumulators can accept.
Yeah, I'm not very good with control scripting. Or electricity management. (best I can do is set a reactor to stop receiving nuclear fuel when it has too high a temperature or there's already fuel)
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
Post Reply

Return to “Modding interface requests”