[1.1.46] Electric pole ghost removal creates weird connections between other poles

Bugs that are actually features.
lyvgbfh
Inserter
Inserter
Posts: 33
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

[1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by lyvgbfh »

Image

Fairly simple to reproduce. Place a ghost pole where it would connect to other, real poles. When you remove the ghost, the "connected" poles will each search for new connections despite not practically being connected to the ghost.
Attachments
boilers.zip
save. load without mods, as that's how it was tested and demonstrated.
(1.91 MiB) Downloaded 41 times

User avatar
Lou
Factorio Staff
Factorio Staff
Posts: 58
Joined: Mon Nov 30, 2020 10:50 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Lou »

Hello and thank you for the input.

I feel this is actually working correctly - having (even real) poles connected to each other even via a ghost is singalling "this is supposed to be a network". Therefore, upon removing ghost, its neighbours SHOULD try to recconect in a way to remain in one (before reconnection hypothetical) network.

If you want a behaviour where the real poles would remain disconnected, first disconnect the ghost before removing it.

mrvn
Smart Inserter
Smart Inserter
Posts: 5112
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by mrvn »

One thing I would say is a bug, or more a bad feature, is the amount of connections added. Connections per pole are limited and, especially with long distance power poles, a precious resource. Poles should not gain a wire if they are already in the same electrical network. Ideally they would choose the shortest connection to add.

lyvgbfh
Inserter
Inserter
Posts: 33
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by lyvgbfh »

Lou wrote:
Thu Dec 02, 2021 6:28 pm
I feel this is actually working correctly - having (even real) poles connected to each other even via a ghost is singalling "this is supposed to be a network". Therefore, upon removing ghost, its neighbours SHOULD try to recconect in a way to remain in one (before reconnection hypothetical) network.
You can see on the last step that the bottom poles actually become disconnected from the network of the other poles, the logic here especially with the amount of redundant connections added seems to be somewhat faulty. That being said, I understand if it's not *technically* a bug.

mrvn
Smart Inserter
Smart Inserter
Posts: 5112
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by mrvn »

lyvgbfh wrote:
Sat Dec 04, 2021 12:35 pm
Lou wrote:
Thu Dec 02, 2021 6:28 pm
I feel this is actually working correctly - having (even real) poles connected to each other even via a ghost is singalling "this is supposed to be a network". Therefore, upon removing ghost, its neighbours SHOULD try to recconect in a way to remain in one (before reconnection hypothetical) network.
You can see on the last step that the bottom poles actually become disconnected from the network of the other poles, the logic here especially with the amount of redundant connections added seems to be somewhat faulty. That being said, I understand if it's not *technically* a bug.
I believe that's just the poles trying to connect to poles that are maxed out and can't connect to any more poles. So the reconnect attempt fails and they remain split off. The amount of redundant connections made earlier is the problem.

lyvgbfh
Inserter
Inserter
Posts: 33
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by lyvgbfh »

mrvn wrote:
Mon Dec 06, 2021 4:40 pm
I believe that's just the poles trying to connect to poles that are maxed out and can't connect to any more poles. So the reconnect attempt fails and they remain split off. The amount of redundant connections made earlier is the problem.
Ah, that makes more sense the second time you told me. IMO it's worth addressing as a pretty annoying "papercut", trying to keep a clean grid throughout the game is a pretty frustrating experience.

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 716
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by FuryoftheStars »

lyvgbfh wrote:
Mon Dec 06, 2021 6:57 pm
mrvn wrote:
Mon Dec 06, 2021 4:40 pm
I believe that's just the poles trying to connect to poles that are maxed out and can't connect to any more poles. So the reconnect attempt fails and they remain split off. The amount of redundant connections made earlier is the problem.
Ah, that makes more sense the second time you told me. IMO it's worth addressing as a pretty annoying "papercut", trying to keep a clean grid throughout the game is a pretty frustrating experience.
To be fair, in a practical setup, you wouldn't have your poles that dense anyway, would you? :)

Pi-C
Smart Inserter
Smart Inserter
Posts: 1154
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Pi-C »

FuryoftheStars wrote:
Mon Dec 06, 2021 8:02 pm
To be fair, in a practical setup, you wouldn't have your poles that dense anyway, would you? :)
If you limit your "practical setup" to players placing poles, this may be right. Then again, there are mods… In BI, we have so-called Musk floor: tiles that produce electricity while also giving you a speed boost. Technically, this works by placing an invisible power pole on each tile, so poles maxing out their connections was a real problem there.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 716
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by FuryoftheStars »

Pi-C wrote:
Tue Dec 07, 2021 6:47 am
FuryoftheStars wrote:
Mon Dec 06, 2021 8:02 pm
To be fair, in a practical setup, you wouldn't have your poles that dense anyway, would you? :)
If you limit your "practical setup" to players placing poles, this may be right. Then again, there are mods… In BI, we have so-called Musk floor: tiles that produce electricity while also giving you a speed boost. Technically, this works by placing an invisible power pole on each tile, so poles maxing out their connections was a real problem there.
In that case, though, wouldn’t increasing the max number of connections and/or decreasing their wire reach work for that? (And make sense seems you’re talking about tiles?)

Pi-C
Smart Inserter
Smart Inserter
Posts: 1154
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Pi-C »

FuryoftheStars wrote:
Tue Dec 07, 2021 1:53 pm
Pi-C wrote:
Tue Dec 07, 2021 6:47 am
FuryoftheStars wrote:
Mon Dec 06, 2021 8:02 pm
To be fair, in a practical setup, you wouldn't have your poles that dense anyway, would you? :)
If you limit your "practical setup" to players placing poles, this may be right. Then again, there are mods… In BI, we have so-called Musk floor: tiles that produce electricity while also giving you a speed boost. Technically, this works by placing an invisible power pole on each tile, so poles maxing out their connections was a real problem there.
In that case, though, wouldn’t increasing the max number of connections and/or decreasing their wire reach work for that? (And make sense seems you’re talking about tiles?)
What I've done is listening to on_built_entity and cutting off excess connections. Both wire reach and supply area of the poles are reduced to 1. Just saying that such densely placed poles may have a use in real games. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 716
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by FuryoftheStars »

Pi-C wrote:
Tue Dec 07, 2021 2:28 pm
Just saying that such densely placed poles may have a use in real games. :-)
Yes, but that's modded and modding the wire reach (and/or coverage area) while you're at it for your new power pole entities solves that. Under vanilla, or even modded where the default/longer wire reach is needed, I'm just not seeing the "need" to spend the time (potentially making the connection code more complex) to fix this.

lyvgbfh
Inserter
Inserter
Posts: 33
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by lyvgbfh »

FuryoftheStars wrote:
Tue Dec 07, 2021 2:55 pm
Under vanilla, or even modded where the default/longer wire reach is needed, I'm just not seeing the "need" to spend the time (potentially making the connection code more complex) to fix this.
Even in vanilla, substation and large pole reach, or upgrade-plannering poles up a step both lead to cable spaghetti.

User avatar
Lou
Factorio Staff
Factorio Staff
Posts: 58
Joined: Mon Nov 30, 2020 10:50 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Lou »

mrvn wrote:
Fri Dec 03, 2021 1:20 am
One thing I would say is a bug, or more a bad feature, is the amount of connections added. Connections per pole are limited and, especially with long distance power poles, a precious resource. Poles should not gain a wire if they are already in the same electrical network. Ideally they would choose the shortest connection to add.
First, consider that in the given example player manually added 5 ghost poles into a setup of 16 existing poles in 7x7 space ... the amount of connections
is expected to be "excessive".

Now while i agree that connections slot could be a valuable resource, your proposed solution goes against the notion of a "grid".
9CfOwnGNmi.gif
9CfOwnGNmi.gif (1.65 MiB) Viewed 687 times
In the example, adding 4th connection to the central pole seems consistent with a "clean grid", while the diagonal wires smell like spaghetti

User avatar
Lou
Factorio Staff
Factorio Staff
Posts: 58
Joined: Mon Nov 30, 2020 10:50 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Lou »

lyvgbfh wrote:
Sat Dec 04, 2021 12:35 pm
Lou wrote:
Thu Dec 02, 2021 6:28 pm
I feel this is actually working correctly - having (even real) poles connected to each other even via a ghost is singalling "this is supposed to be a network". Therefore, upon removing ghost, its neighbours SHOULD try to recconect in a way to remain in one (before reconnection hypothetical) network.
You can see on the last step that the bottom poles actually become disconnected from the network of the other poles, the logic here especially with the amount of redundant connections added seems to be somewhat faulty. That being said, I understand if it's not *technically* a bug.
While (as mentioned earlier) the reason for the split is the amount of connections, I consider that amount to be natural for (as i mentioned earlier
) what is effectively 21 poles in 7x7 square, (and 4 of those poles, being removed in the process, cannot act as connection blocekrs).

I agree that splitting network that could be kept together is an issue, however there is no good solution (added value vs complexity vs performance vs not meesing with poles not involved) and there would still be cases where disconnect would be unavoidable (and probably even intended by the player).

User avatar
Lou
Factorio Staff
Factorio Staff
Posts: 58
Joined: Mon Nov 30, 2020 10:50 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Lou »

lyvgbfh wrote:
Wed Dec 08, 2021 7:16 am
FuryoftheStars wrote:
Tue Dec 07, 2021 2:55 pm
Under vanilla, or even modded where the default/longer wire reach is needed, I'm just not seeing the "need" to spend the time (potentially making the connection code more complex) to fix this.
Even in vanilla, substation and large pole reach, or upgrade-plannering poles up a step both lead to cable spaghetti.
Well, with upgrading poles some spaghetti should be expected in some cases (you are making grid effectively denser). Could you show some cases where you would consider keeping clean grid is unreasonably frustrating?

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 716
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by FuryoftheStars »

lyvgbfh wrote:
Wed Dec 08, 2021 7:16 am
FuryoftheStars wrote:
Tue Dec 07, 2021 2:55 pm
Under vanilla, or even modded where the default/longer wire reach is needed, I'm just not seeing the "need" to spend the time (potentially making the connection code more complex) to fix this.
Even in vanilla, substation and large pole reach, or upgrade-plannering poles up a step both lead to cable spaghetti.
Except again, substation and large pole you'd be placing further apart. Even upgrading small to large, they shouldn't be as dense as in your original pic. In your original pic, you could remove the entire inner circle of 8 poles and still have full power coverage. (Well, ok, the 1 center most tile might become unpowered, but a single pole or a shift of any of the outer poles 1 tile closer would solve that. There's no need for all 8 in the inner circle. They are redundant.)

mrvn
Smart Inserter
Smart Inserter
Posts: 5112
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by mrvn »

Lou wrote:
Wed Dec 08, 2021 11:29 am
In the example, adding 4th connection to the central pole seems consistent with a "clean grid", while the diagonal wires smell like spaghetti
A grid is wasteful on the number of connections, near 50% of the connections are unnecessary in a simple grid. More with diagonals.

The question is: Do you need the redundancy? New wires form when you deconstruct a pole. Should new wires form when one gets destroyed? If the later then there really would be no reason to have redundant connections.

I often enough run into problems with long distance power poles with train stations + circuit control. All 5 connections get easily used up by surrounding power poles when extra poles are needed to carry red/green wires and not just to give power coverage.

User avatar
Lou
Factorio Staff
Factorio Staff
Posts: 58
Joined: Mon Nov 30, 2020 10:50 am
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by Lou »

mrvn wrote:
Wed Dec 08, 2021 2:31 pm
Lou wrote:
Wed Dec 08, 2021 11:29 am
In the example, adding 4th connection to the central pole seems consistent with a "clean grid", while the diagonal wires smell like spaghetti
A grid is wasteful on the number of connections, near 50% of the connections are unnecessary in a simple grid. More with diagonals.

The question is: Do you need the redundancy? New wires form when you deconstruct a pole. Should new wires form when one gets destroyed? If the later then there really would be no reason to have redundant connections.

I often enough run into problems with long distance power poles with train stations + circuit control. All 5 connections get easily used up by surrounding power poles when extra poles are needed to carry red/green wires and not just to give power coverage.
I agree grid has redundant connections, but that is why it is called "grid" and not "snake" or "tree" :).

The logic of reconnecting neighbours after pole destruction is local: it does not look at networks and only relevant poles are the neighbours of the destroyed pole and neighbours of those - anything beyond that is irrelevant (for the current logic) - so it tries to connect neighbours in a way not to create triangles. The beauty and strength of this approach is the locality - to filter out connections deemed "redundant" would require more holistic approach.

As for your example, I cannot see any good solution (apart from self evident like making blueprints with big ples on the sides that are ready to connect to outside power connections on multiple sides), especially since your poles are basicly standalone networks, even wire-conservative algorithm would connect them.

The problem you described partly corresponds with IRL transmission (long distance, high voltage) vs distribution (local, lower voltage). Distribution grids often crate net-like grids and for emulating this in factorio it makes sense to just connect to many close poles. While in long distance transmission you want mostly a line of long-reach poles that have just a one (or a few) connection to the local grids - distinction that is not in base factorio (and for simplicity's sake probably wont be).

lyvgbfh
Inserter
Inserter
Posts: 33
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by lyvgbfh »

Lou wrote:
Wed Dec 08, 2021 11:29 am
In the example, adding 4th connection to the central pole seems consistent with a "clean grid", while the diagonal wires smell like spaghetti
I tend to agree on this point. The additional diagonal connections are the issue I run into most often with an "organic" (i.e. placed as needed) grid. Often times (and I'm only speaking for myself here), in trying to keep connections in straight lines/grid it becomes a frustrating game of cable cleanup. The logic, in my mind, that would make sense would be "connect at 90° angles, and fall back to diagonal angles if there are non-connected networks in range".

Image

Like, here, the grid is satisfied without the need for the additional connections. I sort of enforce this here, but to search for candidates and evaluate networks etc is pretty costly lua-side.


The above being said, some of the replies have me wondering if the behavior I detailed would be undesirable for some.

FuryoftheStars
Filter Inserter
Filter Inserter
Posts: 716
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: [1.1.46] Electric pole ghost removal creates weird connections between other poles

Post by FuryoftheStars »

Honestly, in the situations I can think of where power poles get legitimately jam packed, I think the look lends itself nicely with the whole industrial factory feel.
Screenshot 2021-12-08 224614.png
Screenshot 2021-12-08 224614.png (2.92 MiB) Viewed 565 times


Otherwise, I feel like this is nitpicking for OCD sake, and unless there's a near zero performance and development time to fix, I'm not for it.

Post Reply

Return to “Not a bug”