Page 1 of 1

Design Help Needed: Wireless Power

Posted: Sun Apr 18, 2021 9:57 am
by Rainboy
Hi, I'm the author of Wireless Power, which is a mod for universal wireless power transfer. The tesseracts that the mod adds to the game come with efficiency penalties as the cost for the convenience of wireless power. However, there's a fairly fundamental flaw with the mod: factorio's power transfer is always 'free' no matter how large the network. I understand the reasoning for this: it's quite computationally expensive to calculate the costs for any realistic power transfer that tries to model the resistance of the wires.

So that brings me to my problem. This mod was designed with rail world in mind, where you have some central base and then many mining outposts. I'd like some way to mechanically encourage users of my mod to actually use tesseracts for these outposts beyond just the convenience factor. Thus, I need some UPS-efficient way to cause long chains of power poles to be very inefficient, without causing too much of an efficiency nerf to the normal factory - even if said factory is fairly large.

Design goals:
  1. UPS efficient algorithm. Ideally, only run mod scripts on entity placement/removal.
  2. Very inefficient to power machines which are very distant from the main power generation.
  3. Much less inefficient to power large groups of machines which are relatively close together.

Initially, I've come up with a few ideas which are, in my opinion, pretty sub-optimal. I suspect some variation of these will end up being the best I can manage, but I'm interested in hearing what else people can come up with.
  1. Mechanically cause power drain via a set of modules which are automatically inserted into machines which are far away from power generation.
    Drawbacks: Consumes a module slot for any machine deemed 'far away,' adds a bunch of nonsense code to make sure the modules can't be removed or end up in anyone's inventory, fails to hide what's going on from the user.
  2. Mechanically cause power drain via an invisible entity connected to the network. Many such entities would be created to handle different 'tiers' of power consumption, and a script would handle figuring out which one was connected to each electric network.
    Drawbacks: tier system is not very fine-grained, can't really handle machines which are off, need to figure out an algorithm to calculate which tier to use.
  3. As a middle ground between the above two, mechanically cause power drain via invisible entities connected to each machine or each power pole.
    Drawbacks: many more entities in the game, still can't handle machines which are off or power poles which are unused.
Thoughts?

Re: Design Help Needed: Wireless Power

Posted: Sun Apr 18, 2021 10:33 am
by GrumpyJoe
Not put much thought into it while having breakfast :lol:

But what about hidden energy consuming entities in large power poles?
A lamp that's always on, assemblers auto set to a void recipe
Call them cable resistance.

It would make the power draw through fake resistance linear and I'm not an electrical engineer, so I don't know how accurate a non tiered system would be, but that could be a start?


Another idea: limit possible cable connections.
If that is possible.. Maybe makes for a mod Interface request.
Make LPP only connectable to themselves and a transformator like entity that could look like a substation and has a hidden entity that draws power. That transformator could then be hooked up to subnets of substations and MPP without actually splitting power networks

Re: Design Help Needed: Wireless Power

Posted: Sun Apr 18, 2021 12:13 pm
by Rainboy
GrumpyJoe wrote: Sun Apr 18, 2021 10:33 am Not put much thought into it while having breakfast :lol:

But what about hidden energy consuming entities in large power poles?
A lamp that's always on, assemblers auto set to a void recipe
Call them cable resistance.

It would make the power draw through fake resistance linear and I'm not an electrical engineer, so I don't know how accurate a non tiered system would be, but that could be a start?


Another idea: limit possible cable connections.
If that is possible.. Maybe makes for a mod Interface request.
Make LPP only connectable to themselves and a transformator like entity that could look like a substation and has a hidden entity that draws power. That transformator could then be hooked up to subnets of substations and MPP without actually splitting power networks
I don't hate the idea of limiting consumption to large power poles (where large is anything that has less than 5x5 supply area). It might warrant some experimentation, but I worry that it will be quite difficult to balance since this approach does not take any machines into account. Mining outposts can be fairly energy intensive, especially with speed modules; a linearly increasing (with distance only) cost would have to be fairly steep to make outposts favor tesseracts over power poles - to the point that I expect it would discourage the use of large power poles altogether.

Your idea of limiting cable connections intrigues me. I think that would require an interface change, but it would be a way to isolate large from medium poles.