Everything that runs on electricity is a pole! / Physical Electrical Network
Posted: Sat Jan 14, 2017 2:39 am
by EditorRUS
So starting from 0.13 many things can be connected to circuit network and that got me thinking: if you can connect data wires to things and they will transmit signals just fine, why not trying connecting actual power wires in similar way? In real life you don't shove poles everywhere to power a huge and dense facility, you create an intra-network.
What
Basically the idea goes like this: instead of using poles to wire things up, you actually wire things up yourself and use poles only as a dummy item for wires.
Each item basically acts like a pole (hence the title) with certain wiring range (determining it is worth a discussion on its own, so more on it later).
Each item basically acts like a pole (hence the title) with certain wiring range (determining it is worth a discussion on its own, so more on it later).
Examples
Now, why would you prefer wiring something yourself rather than leaving it as is? I can provide a number of reasons:
1) Power switch is currently very cumbersome to use. The reason for it is because unless you specifically make your electrical network modular, your poles will probably power many things and this system will get extremely complicated after a while. It's like shitcode: you can write more shitcode to existing shitcode, but don't you even try reading this or try understanding how it works.
With this system the matter becomes much more trivial: if you can define what things should be connected to what and provide power exactly the way you want them, you can easily add a power switch to the system as a bridge.
For example, suppose we want to have a system like this:
With current system creating this will be a nightmare, especially if you decide to do that to an existing system, but if you can wire things yourself, then it's not that bad. This is obviously a very general example and you can have switches inside each block too. Say, you want to power down assemblers with all the inserters and other stuff to avoid wasting power with idle consumption when . Boom, you can easily do that. Well, you can do it now too, but it's still going to be a nightmare.
2) Allowing modular power. This is a much more real example:
Yeeeah... good luck trying to do something like this.
3) Currently there is no good way to measure how much electricity is in your system and prioritize things to be powered as such. This becomes CRITICAL when your power consumption becomes so high your coal miners can't provide enough coal to keep the boilers running. Of course you can restart your factory easily, but come on, doing things manually is for plebs, gentlemen create self-sustainable factories that only require human intervention when yet another ore patch runs out.
Sometimes you want to keep your logic and basic power facilities running when there is a severe lack of electricity.
Something like this might be trivial to implement.
1) Power switch is currently very cumbersome to use. The reason for it is because unless you specifically make your electrical network modular, your poles will probably power many things and this system will get extremely complicated after a while. It's like shitcode: you can write more shitcode to existing shitcode, but don't you even try reading this or try understanding how it works.
With this system the matter becomes much more trivial: if you can define what things should be connected to what and provide power exactly the way you want them, you can easily add a power switch to the system as a bridge.
For example, suppose we want to have a system like this:
With current system creating this will be a nightmare, especially if you decide to do that to an existing system, but if you can wire things yourself, then it's not that bad. This is obviously a very general example and you can have switches inside each block too. Say, you want to power down assemblers with all the inserters and other stuff to avoid wasting power with idle consumption when . Boom, you can easily do that. Well, you can do it now too, but it's still going to be a nightmare.
2) Allowing modular power. This is a much more real example:
Yeeeah... good luck trying to do something like this.
3) Currently there is no good way to measure how much electricity is in your system and prioritize things to be powered as such. This becomes CRITICAL when your power consumption becomes so high your coal miners can't provide enough coal to keep the boilers running. Of course you can restart your factory easily, but come on, doing things manually is for plebs, gentlemen create self-sustainable factories that only require human intervention when yet another ore patch runs out.
Sometimes you want to keep your logic and basic power facilities running when there is a severe lack of electricity.
Something like this might be trivial to implement.
Wiring range
Now about the wiring range for consumers. It's a little bit complicated to decide on this, but I think I know what should decide the reach: nominal power consumption. That is to avoid linking solar panels and taking all challenge from them. If some machine is a power generator, this machine MUST use poles for wiring.
If some machine only consumes power, then we might find wiring range edge half-size for this machine simply by taking a square root of 1/100th of its power usage in kW and flooring the value. For example, if some machine consumes 100kW, then its wiring range is 1 as floor((1/100 * 100)^0.5) = 1. A machine that consumes 300 kW also creates a 3x3 area for wiring nearby devices. Be aware that you need to use nominal power consumption, that is without any modules and modification, as if you just placed it on the map.
Laser turrets consume 2.4 MW of electricity so they provide a whopping 9x9 wiring area.
Poles are an exception and provide the usual wiring range according to their tier and stuff. Poles therefore become a way to transmit power over long distances, but not actually what makes devices near them tick. For apparent reasons old system must also be left because not always do you need to wire things yourself and separate networks. By using a certain combination of keys (Ctrl-Left click?) you can automatically wire all devices in pole's reach area.
If some machine only consumes power, then we might find wiring range edge half-size for this machine simply by taking a square root of 1/100th of its power usage in kW and flooring the value. For example, if some machine consumes 100kW, then its wiring range is 1 as floor((1/100 * 100)^0.5) = 1. A machine that consumes 300 kW also creates a 3x3 area for wiring nearby devices. Be aware that you need to use nominal power consumption, that is without any modules and modification, as if you just placed it on the map.
Laser turrets consume 2.4 MW of electricity so they provide a whopping 9x9 wiring area.
Poles are an exception and provide the usual wiring range according to their tier and stuff. Poles therefore become a way to transmit power over long distances, but not actually what makes devices near them tick. For apparent reasons old system must also be left because not always do you need to wire things yourself and separate networks. By using a certain combination of keys (Ctrl-Left click?) you can automatically wire all devices in pole's reach area.
Implementation ideas
TO DEFINE AND DESCRIBE
1. Electrical Network behaves like a slightly modified circuit network
2. Electrical Network is a new network in itself which allows to, say, limit the amount of power that should be provided to a device
1. Electrical Network behaves like a slightly modified circuit network
2. Electrical Network is a new network in itself which allows to, say, limit the amount of power that should be provided to a device
How it should work
So the system works similarly to circuit network. You select copper wire, you click at one thing and connect it up to some other thing and they connect. The range is defined by wire reach area, obviously.
But there is one difference: You can select some device and click Ctrl-Left Click if you have copper wire selected and it will connect all devices within reach to this device. Say, if you have an assembler surrounded by inserters and an accumulator just for the hell of it. You select this assembler, click Ctrl-Left Click while having copper wire selected and BAM! all those inserters and the accumulator are connected to the assembler. This also should work for poles to allow legacy behavior.
But there is one difference: You can select some device and click Ctrl-Left Click if you have copper wire selected and it will connect all devices within reach to this device. Say, if you have an assembler surrounded by inserters and an accumulator just for the hell of it. You select this assembler, click Ctrl-Left Click while having copper wire selected and BAM! all those inserters and the accumulator are connected to the assembler. This also should work for poles to allow legacy behavior.
Issues and possible solutions
[quote="ssilk"]I'm not sure, but would say the reason not to implement this is the clutter of wires you'll get. So mainly a graphical issue: it will not look good. :)[/quote]
This is a trivial one. Poles should always show connected wires but intranetwork (that is, wires that are connected to some device other than a pole) is only shown when you have copper wire selected. We'll pretend that those wires are underground. Try selecting a train stop near rails and you'll see what I mean.
This is a trivial one. Poles should always show connected wires but intranetwork (that is, wires that are connected to some device other than a pole) is only shown when you have copper wire selected. We'll pretend that those wires are underground. Try selecting a train stop near rails and you'll see what I mean.