Page 1 of 1

[0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Sun Mar 17, 2019 8:55 pm
by kosievdmerwe
Under some conditions the power connections aren't updated when you quick replace a small electric pole with a medium electric pole.

Note that the poles to the left and the right are required, if you don't have them this doesn't repro. (Doing some more testing since making the screenshots, it appears that the only requirement is that the small electric pole has one connection already.)

I discovered this when I tried to upgrade some poles in my mining setup.

Steps to repro:

1. Build this setup (belts are there to make the spacing clear):
20190317134517_1.jpg
20190317134517_1.jpg (1.29 MiB) Viewed 7373 times



2. Prepare to quick replace the small pole with a medium pole (Note the ghost shows a connection between the top and bottom row of poles):
20190317134532_1.jpg
20190317134532_1.jpg (1.18 MiB) Viewed 7373 times



3. Do the quick replace and notice the connection wasn't made:
20190317134541_1.jpg
20190317134541_1.jpg (1.26 MiB) Viewed 7373 times


3A. This is what I expected to end up with (If you delete and place the medium pole again, this is what you end up with):
20190317134549_1.jpg
20190317134549_1.jpg (1.27 MiB) Viewed 7373 times

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Sun Mar 17, 2019 10:13 pm
by TruePikachu
I have noticed this too, but I also recall reading about it here, which leads me to believe this might be a duplicate of something NaB.

EDIT: 55121 - NaB, though there's still an issue where the wires that otherwise would have been created are shown when hovering the medium pole over the small one, but not created when the pole is actually plopped.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Sun Mar 17, 2019 10:22 pm
by tehfreek

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Sun Mar 17, 2019 10:35 pm
by kosievdmerwe
TruePikachu wrote:
Sun Mar 17, 2019 10:13 pm
I have noticed this too, but I also recall reading about it here, which leads me to believe this might be a duplicate of something NaB.

EDIT: 55121 - NaB, though there's still an issue where the wires that otherwise would have been created are shown when hovering the medium pole over the small one, but not created when the pole is actually plopped.
Yeah, this is either a bug with the ghost showing you connections that won't be made or the fact that those connections aren't made when the fast replace happens.

And since I haven't reached the 5 connections per pole limit, I feel the bug is that the connection wasn't made.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Sun Mar 17, 2019 10:37 pm
by TruePikachu
The connections not being made is considered NaB, I'm fairly certain (as it could create undesired links between two power networks in the face of electric switches), while I don't recall any official statement regarding the preview wires (which is why I consider them still an issue).

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 2:13 am
by kosievdmerwe
TruePikachu wrote:
Sun Mar 17, 2019 10:37 pm
The connections not being made is considered NaB, I'm fairly certain (as it could create undesired links between two power networks in the face of electric switches), while I don't recall any official statement regarding the preview wires (which is why I consider them still an issue).
I think trying to optimize for not connecting power networks is the wrong optimization to make especially for small to medium upgrades. I understand keeping the existing connections the same, but 99% of players will likely never do something weird with deliberately having partitioned power networks.

If you're doing partitioning (for backup power or whatever), you almost certainly know what you're doing and likely aren't quick replacing small power poles to begin with. For most other people, I'm willing to wager that they'd want everything to be on the same network.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 10:29 am
by Twinsen
What's a realistic situation when you want to replace small to medium electric poles?
Because if you need them to connect that would mean they were't connected properly in the first place, which would be strange.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 10:31 am
by kovarex
I consider this a bug, they should connect, I actually encountered it several times, where I upgraded the pole, it shown that it will connect, but in the end it didn't. So I had to manually mine the pole and build it again on the same place to make it connect.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 10:56 am
by bobingabout
I think the issue is less of "It shouldn't connect because it wasn't before", or "It should connect because it's in range" and more about "It should connect, because the preview tells you it will".

Changing the preview to not show it will connect would be as much a fix as making it connect, as long as there is consistency between the preview and the result.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 12:02 pm
by kovarex
But changing the preview can wrongly give you the impression, that the wire can't reach there, while it can now.
If we wanted to be super precise, we can add connection only to poles that are further then the previous distance on fast-replace, but I don't consider it to be worth it.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 12:16 pm
by ManaUser
While I don't recall encountering this problem myself, I definitely quick-replace small poles with medium sometimes and obviously I do that when I want to make a connection that wasn't previously there. Example situation would be I've got a block of smelters or assembling machines wired with small poles (which is how I usually do it) and notice that they're almost, but not quite close enough to connect to the nearest power source. So I replace the closest pole with medium, maybe do the same on the other side and presto...

Again, I haven't encountered this bug as far as I can recall, but it doesn't seem like an unusual situation.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 1:57 pm
by _Attila_
Since this is a quick replace, the connections should be kept as is - even though new ones could be made - AND the ghost should always show what will actually be done if the item is actually placed. imho

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 3:42 pm
by TruePikachu
_Attila_ wrote:
Mon Mar 18, 2019 1:57 pm
Since this is a quick replace, the connections should be kept as is - even though new ones could be made
This logic doesn't actually hold up in all existing circumstances of quick-replace; all same-tier belt replacements (e.g. belt->splitter) technically modify connections.
_Attila_ wrote:
Mon Mar 18, 2019 1:57 pm
the ghost should always show what will actually be done if the item is actually placed
This I 100% agree with; if you're given a preview of what should happen, that's what should happen. The only places where a preview can diverge from what actually happens are in non-functional ways (e.g. belts in a blueprint not being displayed with curves) -- all functional differences produced (e.g. wire connections) should be shown.


Something else to check with the pole fast-replace is the behaviour of circuit network wires; their previous connections should persist through fast-replace (carrying the same signals they had before), and the wires should remain in the preview.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Mon Mar 18, 2019 4:09 pm
by kosievdmerwe
Here's the actual case where I discovered the bug:
20190318085827_1.jpg
20190318085827_1.jpg (1.32 MiB) Viewed 7251 times
I was expanding my mining setup by adding more rows of miners above the row with wooden poles. As a compromise between coverage and density I left a one wide gap between the rows of miners.

Now my problem is that I want to connect the top row of miners to the bottom row's power grid. From experience elsewhere in my base I know that medium electric poles can span the distance.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Thu Mar 21, 2019 1:23 pm
by Twinsen
Changed in Version: 0.17.17
- Fast replacing power poles will keep existing connections but also try to connect to further away power poles if possible.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Thu Mar 21, 2019 4:08 pm
by kovarex
Based on the code, it is not only "further away", but any valid connections on top of those inherited by the fast-replace. It is almost he same in most cases, but doesn't need to be.

Re: [0.17.14] Fast replacing small electric pole with medium doesn't update connections

Posted: Fri Mar 22, 2019 3:40 pm
by gacekssj4
Will it merge 2 different electrical networks into one if they're near? Not sure if that would be issue tho...