Energy Loss Over Distance
Moderator: ickputzdirwech
Energy Loss Over Distance
Are you considering putting in energy being lost when traveling large distances from the source? Seems like a simple concept that would lead to much more complex designs with relay setups connecting power storage units to get the most efficient use in a large factory.
Re: Energy Loss Over Distance
Yes, we are, but this would have to be programmed very well to make it fast enough in huge factories.
Note, that the Maximum flow problem doesn't have linear complexity (http://en.wikipedia.org/wiki/Maximum_fl ... #Solutions)
Edit: Hmm, by looking at the page, it seems that there are specialised approximate algorithms for electric network (not orientated graphs), this is our case, and these might have much better complexity.
I'm sorry if I'm too technical here, but maybe someone might have something to say about this.
Note, that the Maximum flow problem doesn't have linear complexity (http://en.wikipedia.org/wiki/Maximum_fl ... #Solutions)
Edit: Hmm, by looking at the page, it seems that there are specialised approximate algorithms for electric network (not orientated graphs), this is our case, and these might have much better complexity.
I'm sorry if I'm too technical here, but maybe someone might have something to say about this.
Re: Energy Loss Over Distance
I would imagine that there are many shortcuts that can be taken to calculate energy loss. It's a bad example, but in the Industrialcraft mod it's as "simple" as "anything past X blocks implies Y loss per block". At first glance, that sounds like a pretty light computation to make. IC2 screws it up though by doing that calculation thousands of times each tick, once per energy packet.
In Redpower2, a proper circuit is more or less simulated. Who knows how Buildcraft energy works...
Those are the only examples I can think of. Other games such as SimCity just ignore power losses (however they do keep track of water pressure).
I'll admit, I do like the idea of needing transformer substations and fun energy storage devices such as giant flywheels.
http://vyconenergy.com/pq/ups.htm Here's a small flywheel UPS designed for pretty much any place smaller than a hospital.
In Redpower2, a proper circuit is more or less simulated. Who knows how Buildcraft energy works...
Those are the only examples I can think of. Other games such as SimCity just ignore power losses (however they do keep track of water pressure).
I'll admit, I do like the idea of needing transformer substations and fun energy storage devices such as giant flywheels.
http://vyconenergy.com/pq/ups.htm Here's a small flywheel UPS designed for pretty much any place smaller than a hospital.
Re: Energy Loss Over Distance
I'm cleaning up the board from backward, so this gets revived.
The dev-team stated here and in other comments that they won't implement it. The reason is simply the big amount of calculation power.
This is right, if this is calculated per device and in real-time. I thought a bit and I think I found a way, how this might work. I try to describe the algorithm:
The basic idea is, to install a "blind-power" for each combination of "regions". The regions are 32x32 chunks. (*) See https://forums.factorio.com/wiki/inde ... tle=Region
The energy flow between two regions is measured and depending on distance a blind power consumer is installed into that network.
This is a more or less correct approximation, when we look at the numbers of devices in a region: there are under normal circumstances about 100-1000 in one region.
- this takes 1-10 seconds for one loop and can run in background.
- the game loops over the map in "regions" (32x32 chunks).
- it sums up all current producers and all current consumers in this region and per network.
- when it has calculated all, it calculates per network:
--- distance between two regions
--- the power exchange between two regions, therefore it
------ takes the current production, cuts away it's own consumption and if something is remaining it repeats that for all surrounding areas
------ if up to to four regions can deliver into another area, the consumption is middled over these four.
--- then it calcuates and installs an "invisuble power user" into the network for this combination region
--- region<->distance<->power-flow => resistance => blind power needed to bridge the resistance
--- in the power-info-screen this is shown as blind power usage.
(*) Well, that area is quite big (1024 x 1024 tiles), but in reality this loss is also measured in kilometers.
This has two reasons:
- in the early to middle game i won't be bothered with that. It doesn't bring anything - gameplay-wise.
- The blind power should become only a problem, if you expand into far regions.
- It can be softened, if we install power generators at that distant outpost. How would that work with narrower region-sizes?
And, well, 256 x 256 tiles (16 x 16 chunks) seems also appropriate. Maybe the regions overlap? I dunno, this is part of balancing.
- It may be also a useful idea, to define the regions not "fixed", more like "clouds", so that the number of devices inside is more or less equal for every cloud; that the regions differ in size and are not rectangular.
- Also a good idea might be to split the calculation for the regions for producers and for consumers...
- Maybe the number of connections between two networks play also a role. Resistance grows, if we transport much power over only one line...
The dev-team stated here and in other comments that they won't implement it. The reason is simply the big amount of calculation power.
This is right, if this is calculated per device and in real-time. I thought a bit and I think I found a way, how this might work. I try to describe the algorithm:
The basic idea is, to install a "blind-power" for each combination of "regions". The regions are 32x32 chunks. (*) See https://forums.factorio.com/wiki/inde ... tle=Region
The energy flow between two regions is measured and depending on distance a blind power consumer is installed into that network.
This is a more or less correct approximation, when we look at the numbers of devices in a region: there are under normal circumstances about 100-1000 in one region.
- this takes 1-10 seconds for one loop and can run in background.
- the game loops over the map in "regions" (32x32 chunks).
- it sums up all current producers and all current consumers in this region and per network.
- when it has calculated all, it calculates per network:
--- distance between two regions
--- the power exchange between two regions, therefore it
------ takes the current production, cuts away it's own consumption and if something is remaining it repeats that for all surrounding areas
------ if up to to four regions can deliver into another area, the consumption is middled over these four.
--- then it calcuates and installs an "invisuble power user" into the network for this combination region
--- region<->distance<->power-flow => resistance => blind power needed to bridge the resistance
--- in the power-info-screen this is shown as blind power usage.
(*) Well, that area is quite big (1024 x 1024 tiles), but in reality this loss is also measured in kilometers.
This has two reasons:
- in the early to middle game i won't be bothered with that. It doesn't bring anything - gameplay-wise.
- The blind power should become only a problem, if you expand into far regions.
- It can be softened, if we install power generators at that distant outpost. How would that work with narrower region-sizes?
And, well, 256 x 256 tiles (16 x 16 chunks) seems also appropriate. Maybe the regions overlap? I dunno, this is part of balancing.
- It may be also a useful idea, to define the regions not "fixed", more like "clouds", so that the number of devices inside is more or less equal for every cloud; that the regions differ in size and are not rectangular.
- Also a good idea might be to split the calculation for the regions for producers and for consumers...
- Maybe the number of connections between two networks play also a role. Resistance grows, if we transport much power over only one line...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Energy Loss Over Distance
Related threads:
https://forums.factorio.com/forum/vie ... f=6&t=8490 Idea for larger solar station and larger accumulator
https://forums.factorio.com/forum/vie ... nergy+loss A few ideas that could be implemented.
https://forums.factorio.com/forum/vie ... f=6&t=1261 Handling different electric networks (uh, thats by me? I think that isn't a good suggestion... so don't care about it! Maybe I should move it to won't implement?)
https://forums.factorio.com/forum/vie ... f=6&t=8490 Idea for larger solar station and larger accumulator
https://forums.factorio.com/forum/vie ... nergy+loss A few ideas that could be implemented.
https://forums.factorio.com/forum/vie ... f=6&t=1261 Handling different electric networks (uh, thats by me? I think that isn't a good suggestion... so don't care about it! Maybe I should move it to won't implement?)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Energy Loss Over Distance
Oh please, do us all a favor and don't implement energy loss. It'll only slow down the game, and it's easily counteracted by placing more Solar Panels and Accumulators.
Re: Energy Loss Over Distance
Or by introduction of High Voltage power lines - I hope this is the intention.
Re: Energy Loss Over Distance
Seriously: For the game-play this is currently not really needed. Even if I like the idea from the engineering standpoint.
I see that only, if it would be possible to built a Factory over thousands of tiles in reasonable time and you need to connect really distant outposts (>=1000 tiles away).
So I think, unless someone has a better idea, this will stay here.
I see that only, if it would be possible to built a Factory over thousands of tiles in reasonable time and you need to connect really distant outposts (>=1000 tiles away).
So I think, unless someone has a better idea, this will stay here.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Energy Loss Over Distance
Of course this is only relevant for spread out factories, but already you sometimes have far-away mining bases (maybe more notable when using something like the RSO mod).
As I see it, bringing energy loss to Factorio would mean you have to choose between a few options when making far outposts -
1. Build more energy production to cover for the losses.
2. Build localized energy production for each outpost.
3. Invest in high voltage transformers to convey energy to far away places.
Of course every option has it's pros and cons, but the point is - you get to choose, and I think this can have gameplay value.
As I see it, bringing energy loss to Factorio would mean you have to choose between a few options when making far outposts -
1. Build more energy production to cover for the losses.
2. Build localized energy production for each outpost.
3. Invest in high voltage transformers to convey energy to far away places.
Of course every option has it's pros and cons, but the point is - you get to choose, and I think this can have gameplay value.
Re: Energy Loss Over Distance
Yes, this adds gameplay-value, but having more things to think or setup or more items will make the game more complex, which reduces the gameplay-value.
I currently think, this is like a zero-sum in this case and so it's not enough yet. This might change.
I currently think, this is like a zero-sum in this case and so it's not enough yet. This might change.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Energy Loss Over Distance
Instead of going to all the trouble of actually measuring the distance over which electrical power is transmitted, you could simply give each Power Pole a drain. I suggest the same drain for all Power Poles, regardless of size, thus simulating that Big Power Poles are more efficient at long-distance transmitting by tranforming for voltage or whatever it is...
Re: Energy Loss Over Distance
I like this idea a lot. It is probably also possible to do by a mod, isn't it? But it would be nice in vanilla, too.Peter34 wrote:Instead of going to all the trouble of actually measuring the distance over which electrical power is transmitted, you could simply give each Power Pole a drain. I suggest the same drain for all Power Poles, regardless of size, thus simulating that Big Power Poles are more efficient at long-distance transmitting by tranforming for voltage or whatever it is...
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Energy Loss Over Distance
2 possible ways to do this "Simply".
First point though, I agree, to keep it "Simple", instead of calculating distance, do it by the number of poles instead.
1. Each power pole has a power drain value, similar to an inserter, or laser turret, they consume a small ammount of energy just for being connected to the grid. Although this is not that "Realistic", since it will draw power even when nothing is being used, it would only require adding a few tags to the pole entities, with a small ammount of internal coding to let them actually be parsed.
2. Each power pole has a drain percentage, each particular pole will have a certain ammount of extra power consumption added depending on how much power is passing through it. This would require a "Power flow route" to be calculated, and at each step starting from the drain, the current(power) calculated so the extra cost can be added. As you work your way through the route to the source. This drain stacks exponentially as you add more poles. This can be simplified (or optimised) if all poles use the same drain. If this is the case, a simple calculation at 1% per pole would be 1.01^n. with 100 poles, that's 1.01^100, or 2.7 times the power consumption. Even if you want to use the same value for every pole, this could still be in the lua files as a global. perhaps in the map settings? This only really starts to become complicated when you start to consider multiple sources of power. taking that into considering, it also goes against the recent solar panel optimisation that considers all solar panels in the block to be a single entity.
I'd vote for option 2.
First point though, I agree, to keep it "Simple", instead of calculating distance, do it by the number of poles instead.
1. Each power pole has a power drain value, similar to an inserter, or laser turret, they consume a small ammount of energy just for being connected to the grid. Although this is not that "Realistic", since it will draw power even when nothing is being used, it would only require adding a few tags to the pole entities, with a small ammount of internal coding to let them actually be parsed.
2. Each power pole has a drain percentage, each particular pole will have a certain ammount of extra power consumption added depending on how much power is passing through it. This would require a "Power flow route" to be calculated, and at each step starting from the drain, the current(power) calculated so the extra cost can be added. As you work your way through the route to the source. This drain stacks exponentially as you add more poles. This can be simplified (or optimised) if all poles use the same drain. If this is the case, a simple calculation at 1% per pole would be 1.01^n. with 100 poles, that's 1.01^100, or 2.7 times the power consumption. Even if you want to use the same value for every pole, this could still be in the lua files as a global. perhaps in the map settings? This only really starts to become complicated when you start to consider multiple sources of power. taking that into considering, it also goes against the recent solar panel optimisation that considers all solar panels in the block to be a single entity.
I'd vote for option 2.
Re: Energy Loss Over Distance
This is some kind of interesting idea. But this is just adding a constant resistor to the network. The original idea is, that the distance and the amount of current power flow in the cables creates a resistor (or drain, that is in the end really nearly the same).Peter34 wrote:Instead of going to all the trouble of actually measuring the distance over which electrical power is transmitted, you could simply give each Power Pole a drain. I suggest the same drain for all Power Poles, regardless of size, thus simulating that Big Power Poles are more efficient at long-distance transmitting by tranforming for voltage or whatever it is...
Well, the distance could be really replaced with the number of poles in a network. But it would be unfair, cause if I have two networks, and both contain the same number of poles, but in one network they are placed within some small circle (everything is concentrated around the central generators) in the other they are placed in a long row (basically transporting power from generator to a mining site or so), then I would like to have for the second much more drain.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Energy Loss Over Distance
This is simply a penalty for placing power lines too densely.Peter34 wrote:Instead of going to all the trouble of actually measuring the distance over which electrical power is transmitted, you could simply give each Power Pole a drain. I suggest the same drain for all Power Poles, regardless of size, thus simulating that Big Power Poles are more efficient at long-distance transmitting by tranforming for voltage or whatever it is...
Re: Energy Loss Over Distance
You are talking about replacing apples with oranges in an ice hockey match... you could earn a phd in comp.sci. making it work.Peter34 wrote:Instead of going to all the trouble of actually measuring the distance over which electrical power is transmitted, you could simply give each Power Pole a drain. I suggest the same drain for all Power Poles, regardless of size, thus simulating that Big Power Poles are more efficient at long-distance transmitting by tranforming for voltage or whatever it is...
I could see a possible implementation where clusters are created such that connecting far-off islands with long stretches of poles would introduce penalties to the exchange between those clusters. Doesn't really matter if you got a gigantic factory where everything gets 100% electricity, it's the far-away outposts that would struggle... especially if you limited the amount of power could be transferred through a single link.
Re: Energy Loss Over Distance
Ah. A the border of a cluster could be defined as the maximum distance from the center of the cluster. And this center of cluster could be calculated like so: All poles of a network are placed as a corn on a carton. And when I can balance this piece of carton the point is the center.Rakshasa wrote:I could see a possible implementation where clusters are created such that connecting far-off islands with long stretches of poles would introduce penalties to the exchange between those clusters. Doesn't really matter if you got a gigantic factory where everything gets 100% electricity, it's the far-away outposts that would struggle... especially if you limited the amount of power could be transferred through a single link.
It is then really simple: Every pole, which is outside of a maximum radius around this center drains massively power. Maybe rising with distance. And to avoid this, I need to split the networks. I can exchange power between the networks over transformer stations.
A side effect would be, that, if I begin to built an outpost, this will shift of course the center to another point, anywhere between former center and new outpost. Which also bring many poles out of the inner radius; your drain rises dramatically, not just the outpost creates drain, also the former inner factory, because of this shift.
Hmmmm. I don't know, if even this add more or enough game-value. I think it is not enough yet.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Energy Loss Over Distance
That's why, if you read what I sugested, I sugested a power flow route, so it counts the power poles of the shortest route (by number of poles) and multiplies the power required by the given formula.
Re: Energy Loss Over Distance
What is the shortest route for power? How will you calculate, how much power is running through a pole?
It will disable the ability to reduce the solar panels to "one big panel" and it multiplies the possibilities: 100 inserters getting the power from 100 solar panels. 10,000 connections. And now?
It will disable the ability to reduce the solar panels to "one big panel" and it multiplies the possibilities: 100 inserters getting the power from 100 solar panels. 10,000 connections. And now?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Energy Loss Over Distance
Indeed it's not an easy task to compute this. Remember that one machine may draw power from more than one generator, and may even draw from more than one cluster.