Energy Loss Over Distance

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Verbesity
Inserter
Inserter
Posts: 28
Joined: Sat Feb 16, 2013 6:12 am
Contact:

Energy Loss Over Distance

Post by Verbesity »

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.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Energy Loss Over Distance

Post by kovarex »

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.
User avatar
mngrif
Fast Inserter
Fast Inserter
Posts: 173
Joined: Wed Feb 13, 2013 10:44 am
Contact:

Re: Energy Loss Over Distance

Post by mngrif »

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.
My Silly Factorian Tricks
<_aD> OBSERVE SIGNAL ASPECT BEFORE CROSSING TRACK
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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?)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Metonymia
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat May 16, 2015 12:00 pm
Contact:

Re: Energy Loss Over Distance

Post by Metonymia »

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.
sillyfly
Smart Inserter
Smart Inserter
Posts: 1101
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: Energy Loss Over Distance

Post by sillyfly »

Or by introduction of High Voltage power lines - I hope this is the intention.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
sillyfly
Smart Inserter
Smart Inserter
Posts: 1101
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: Energy Loss Over Distance

Post by sillyfly »

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.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Energy Loss Over Distance

Post by Peter34 »

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...
JimiQ
Inserter
Inserter
Posts: 32
Joined: Tue May 13, 2014 9:52 am
Contact:

Re: Energy Loss Over Distance

Post by JimiQ »

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 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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Energy Loss Over Distance

Post by bobingabout »

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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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...
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).

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...
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3717
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Energy Loss Over Distance

Post by DaveMcW »

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...
This is simply a penalty for placing power lines too densely.
Rakshasa
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Sat May 31, 2014 7:21 pm
Contact:

Re: Energy Loss Over Distance

Post by Rakshasa »

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...
You are talking about replacing apples with oranges in an ice hockey match... you could earn a phd in comp.sci. making it work.

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.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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.
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.

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...
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Energy Loss Over Distance

Post by bobingabout »

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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Energy Loss Over Distance

Post by ssilk »

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? :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: Energy Loss Over Distance

Post by SHiRKiT »

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.
Post Reply

Return to “Ideas and Suggestions”