Control Power Connections by Coloring Power Poles (with Lamps)

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Qon »

Gandalf prevents wires from crossing. The author hasn't updated it. But I'm fixing it now. Might upload to the portal after reading through the source properly.
Attachments
Gandalf_1.1.0.zip
(4.98 KiB) Downloaded 117 times
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by eradicator »

Hm... i'd think there are situations where you want them to cross. Like when mixing pole sizes (large+medium) or when actually crossing cables of different networks.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Qon »

eradicator wrote: Tue May 28, 2019 6:33 am Hm... i'd think there are situations where you want them to cross. Like when mixing pole sizes (large+medium) or when actually crossing cables of different networks.
Oh it allows that. It doesn't allow "quadrigrams" (?) from forming, "figure 8 wire connections" instead of convex quadrilaterals within 4 connected poles on the same network. Some longer chains and unconnected networks can cross. I might take a look at the first of those 2 and fix that since that's something you might also want to avoid.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by ssilk »

Well, besides such "non-crossing" utlity I don't see much use in that. Cause the main reason for me to create this suggestion was, that it can happen so super easy, that I accidentially connect a power-network with another. It makes - in my eyes - not so much fun to construct facilities that are working and then you blueprint it to some other place and it is destryed, cause some little pole is at the wrong place and connects you facility with the rest.

It makes no sense to do such hard work if we are not able to create universally useable blueprints.
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
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by eradicator »

ssilk wrote: Fri May 31, 2019 10:21 pm It makes no sense to do such hard work if we are not able to create universally useable blueprints.
Btw, i *am* 100% for storing copper wire in blueprints. I'm just sceptical towards weird hacky workarounds.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Chao
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Fri May 20, 2016 2:11 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Chao »

Perhaps if there is concern over the size of blueprints with wires included you could just make it a toggle that defaults to not included and default connection behaviour? Then only the small number of edge cases end up with a larger blueprint.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by ssilk »

I searched a while around in forum and blogposts, but I cannot find the exact reasons, Kovarex has posted then.

But I remember that he had hard technical reasons against storing wire connections in blueprints. Maybe it was the blueprint-size. But that is not really a problem.

I guess: If you store wire connections in blueprints, it is not clear, what to do, when you place a blueprint near many other poles. Think a bit about it and you will see, that there could be really strange situations happen, like there is no connection to the new part, even if the poles are near enough to connect. Which all are avoided, if you do it like now. And the issues with the curent behavior are high enough.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
mrvn
Smart Inserter
Smart Inserter
Posts: 5907
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by mrvn »

ssilk wrote: Fri Jun 07, 2019 9:07 pm I searched a while around in forum and blogposts, but I cannot find the exact reasons, Kovarex has posted then.

But I remember that he had hard technical reasons against storing wire connections in blueprints. Maybe it was the blueprint-size. But that is not really a problem.

I guess: If you store wire connections in blueprints, it is not clear, what to do, when you place a blueprint near many other poles. Think a bit about it and you will see, that there could be really strange situations happen, like there is no connection to the new part, even if the poles are near enough to connect. Which all are avoided, if you do it like now. And the issues with the curent behavior are high enough.
That would only happen if the power poles already have all their wires pre-set the blueprint. It is unlikely that poles on the outside of a blueprint will fall into that case. And if they do you can always remove some wires before making the blueprint.

An alternative would be to store a negative list. If any 2 poles in the blueprint are in range but don't have a wire then store that. Or explicitly store in every pole if it had it's wires altered by the user and only store them if so. That would cost memory on every altered pole, not just in blueprints though.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by ssilk »

But then you are at the same level as my idea: You add some information to poles to forbit connections. I add some information to poles (the lamp) to change the alogorithm how the poles connect to other poles.

I think that is the much more flexible concept, cause you don't need to add anything new to the game (reimplement storing cable connections within blueprints, etc.) - only an algorithm which looks, which connection-algorithm should be taken now, and the connection algorithms themselves.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
mrvn
Smart Inserter
Smart Inserter
Posts: 5907
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by mrvn »

ssilk wrote: Mon Jun 10, 2019 6:10 pm But then you are at the same level as my idea: You add some information to poles to forbit connections. I add some information to poles (the lamp) to change the alogorithm how the poles connect to other poles.

I think that is the much more flexible concept, cause you don't need to add anything new to the game (reimplement storing cable connections within blueprints, etc.) - only an algorithm which looks, which connection-algorithm should be taken now, and the connection algorithms themselves.
I would say you already have wires (red and green) stored in the blueprint. What's there to invent for copper wires? Just add a 3rd define for copper to the wire color enum and add a few lines of code to create the connection when placing a blueprint. So I don't buy the whole "Storing wires in the blueprint would be to difficult" argument.

The way I would implement this is to place the blueprint, add all the red, green, copper wires. And then run the normal electric wire algorithm but only allow connections between a pole from the blueprint and one outside the blueprint. That last part would take some magic.

Note: I do like your colored poles idea too. But that isn't enough. The problem the coloring doesn't solve is when you have more poles within reach than a pole has connections. You can take a blueprint of a perfectly fine setup and due to the build order the electrical grid suddenly splits into parts because different poles got connected. People won't color every pole to make sure there is only one way to connect the poles, or at least only equivalent ways. Most of the time you don't even realize you created a difficult case because that would require counting potential wires as you place poles every time.

So as a compromise:

1) store copper wires in the blueprint.
2) on placement first add all the stored wires (this would include manually added wires between poles of different colors too).
3) add your pole colors.
4) run the electrical algorithm to connect more wires

By adding all the wires from the blueprint you ensure the result is always at least as connected as it was before. By coloring the poles you prevent stray connections between networks that should remain separate. Win win.
Darinth
Filter Inserter
Filter Inserter
Posts: 323
Joined: Wed Oct 17, 2018 12:17 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Darinth »

Rather than a lamp... what about the ability to just directly color-code electric poles? A setting on them similar to how you can set the stack sizes manually on inserters. The only issue is that it means click on a power pole would now bring up a settings menu for it rather than the power graph for that power network, which would add an additional click to bring up the power graph. Putting a lamp next to a pole just seems like a bit of a hack.
mrvn
Smart Inserter
Smart Inserter
Posts: 5907
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by mrvn »

Darinth wrote: Sat Jun 15, 2019 8:06 pm Rather than a lamp... what about the ability to just directly color-code electric poles? A setting on them similar to how you can set the stack sizes manually on inserters. The only issue is that it means click on a power pole would now bring up a settings menu for it rather than the power graph for that power network, which would add an additional click to bring up the power graph. Putting a lamp next to a pole just seems like a bit of a hack.
I already suggested that. And the click can bring up the power menu and the color picker.
Chao
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Fri May 20, 2016 2:11 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Chao »

ssilk wrote: Fri Jun 07, 2019 9:07 pm I guess: If you store wire connections in blueprints, it is not clear, what to do, when you place a blueprint near many other poles. Think a bit about it and you will see, that there could be really strange situations happen, like there is no connection to the new part, even if the poles are near enough to connect. Which all are avoided, if you do it like now. And the issues with the curent behavior are high enough.
My answer to this would be that if you have elected to store your connections within the blueprint (it should be a checkbox to include them) then none will connect outside the blueprint. If you have elected to include connections then you likely have specific requirements for a small, complex blueprint in which case you may need to make decisions anyway, or have a relatively large blueprint with interleaved networks in which case you have minimal extra work or could even ensure your blueprint has a pole or two overlap for tiling anyway.
mrvn
Smart Inserter
Smart Inserter
Posts: 5907
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by mrvn »

Chao wrote: Sun Jun 16, 2019 6:06 pm
ssilk wrote: Fri Jun 07, 2019 9:07 pm I guess: If you store wire connections in blueprints, it is not clear, what to do, when you place a blueprint near many other poles. Think a bit about it and you will see, that there could be really strange situations happen, like there is no connection to the new part, even if the poles are near enough to connect. Which all are avoided, if you do it like now. And the issues with the curent behavior are high enough.
My answer to this would be that if you have elected to store your connections within the blueprint (it should be a checkbox to include them) then none will connect outside the blueprint. If you have elected to include connections then you likely have specific requirements for a small, complex blueprint in which case you may need to make decisions anyway, or have a relatively large blueprint with interleaved networks in which case you have minimal extra work or could even ensure your blueprint has a pole or two overlap for tiling anyway.
I just thought about what ssilk wrote some more.

The case you stipulate is that you have wire connections in the blueprint. And because of that the poles from the blueprint won't connect to poles that already exist before placing the blueprint. But that would mean the poles inside the blueprint have all their wire slots already filled. Now think about your suggestion. The poles from the blueprint would connect to existing poles. That means there aren't enough free connections left to connect the poles inside the blueprint the same where as before. So the blueprint might just as well split in two.

Either case the result will be broken. Which case is more likely? I don't know. Personally I have never ever had a blueprint not connect to the outside. I had blueprints fail to connect internally occasionally. And removed wires always come back.

Also consider that when placing a blueprint you see the wires connecting (or not if that is the case) to the outside. Currently, unless I'm mistaken, that is only a potential wire placement as wires are added dynamically as entities are placed. But if wires are stored in the blueprint they would have to be stored in ghosts, too, and then what you see when you place the blueprint will be exactly what you get when it gets build in whatever order the bots manage. What you see if what you get. Works for me.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by darkfrei »

How about to add autoconnection for the same poles only? Small to small only, medium to medium, large to large.
Only 4 autoconnection per pole and the last one in reserve for the player connected poles.
The rest must be connected manually or with blueprints.
mrvn
Smart Inserter
Smart Inserter
Posts: 5907
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by mrvn »

darkfrei wrote: Mon Jun 17, 2019 10:17 am How about to add autoconnection for the same poles only? Small to small only, medium to medium, large to large.
Only 4 autoconnection per pole and the last one in reserve for the player connected poles.
The rest must be connected manually or with blueprints.
That seems rather arbitrary. I have lots of cases where I use multiple pole sizes. Especially using a medium pole to connect things where a small pole wouldn't reach.
Darinth
Filter Inserter
Filter Inserter
Posts: 323
Joined: Wed Oct 17, 2018 12:17 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Darinth »

mrvn wrote: Sun Jun 16, 2019 9:21 am
Darinth wrote: Sat Jun 15, 2019 8:06 pm Rather than a lamp... what about the ability to just directly color-code electric poles? A setting on them similar to how you can set the stack sizes manually on inserters. The only issue is that it means click on a power pole would now bring up a settings menu for it rather than the power graph for that power network, which would add an additional click to bring up the power graph. Putting a lamp next to a pole just seems like a bit of a hack.
I already suggested that. And the click can bring up the power menu and the color picker.
Sorry, will acknowledge I didn't read through the entire topic. I like the idea. Should serve most purposes really well.
User avatar
Masterpintsman
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Feb 02, 2016 10:03 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by Masterpintsman »

Main problems (apart from optics) with copper auto-attaching to poles are the topology changes, both unwanted connections to other poles (that circumvent power switches) and disconnections (around full poles). That leads to making duplicating layouts that have special power needs (like viewtopic.php?f=6&t=70996#p432071 or viewtopic.php?t=47949#p343798 as examples) next to each other manual labor intensive and unfun, from having to manually untangle them.

To solve this there needs to be a way to control auto-linking (both to the outside and inside) of the placed blueprint, without introducing a need to manually connect all placed blueprints to have them powered.
The suggested 'coloring' of the poles feels strange, but how about we color the copper wire?

Thus: What about a new wire type (blue?) that connects power, replacing the automatic copper wire when manually stringed between two poles (also giving a visual clue of that connection being deterministic), that behaves blueprint-wise identical to green and red (by being restored as-is) but disables further automatic connection of copper wire to any pole that is carrying that kind of cabling?

Wouldn't that allow to create and blueprint the power wire setups (that wouldn't change in topology or optics (as the 'blue' wire positions would be persisted) without breaking any existing functionality?
mrvn
Smart Inserter
Smart Inserter
Posts: 5907
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by mrvn »

Masterpintsman wrote: Sun Sep 15, 2019 12:47 pm Main problems (apart from optics) with copper auto-attaching to poles are the topology changes, both unwanted connections to other poles (that circumvent power switches) and disconnections (around full poles). That leads to making duplicating layouts that have special power needs (like viewtopic.php?f=6&t=70996#p432071 or viewtopic.php?t=47949#p343798 as examples) next to each other manual labor intensive and unfun, from having to manually untangle them.

To solve this there needs to be a way to control auto-linking (both to the outside and inside) of the placed blueprint, without introducing a need to manually connect all placed blueprints to have them powered.
The suggested 'coloring' of the poles feels strange, but how about we color the copper wire?

Thus: What about a new wire type (blue?) that connects power, replacing the automatic copper wire when manually stringed between two poles (also giving a visual clue of that connection being deterministic), that behaves blueprint-wise identical to green and red (by being restored as-is) but disables further automatic connection of copper wire to any pole that is carrying that kind of cabling?

Wouldn't that allow to create and blueprint the power wire setups (that wouldn't change in topology or optics (as the 'blue' wire positions would be persisted) without breaking any existing functionality?
How would that ever connect to anything? Any blue wire would isolate the involved poles from all others.

You need something so a pole can have a blue wire but also auto-connect to the rest.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Control Power Connections by Coloring Power Poles (with Lamps)

Post by ssilk »

You would never want to place wires for a whole area, that's hundrets of wire-connections.

And from the modding aspect: the wires are not entities, which means the game draws them completly automatic.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Post Reply

Return to “Ideas and Suggestions”