factorio-blueprint-tools icon indicating copy to clipboard operation
factorio-blueprint-tools copied to clipboard

Tile feature does not copy power lines

Open Wh1spr opened this issue 3 years ago • 2 comments

When tiling a blueprint, power lines do not get copied. This results in blueprints where you need to re-place all power lines.

Wh1spr avatar Dec 06 '21 18:12 Wh1spr

Thanks for the report. As in: it only add the lines wihin the tiles but not between the tiles or not at all?

christoph-frick avatar Dec 06 '21 18:12 christoph-frick

I see two kind of problems currently:

  • If there are no connections, tiling will not create them
  • If there are connections, they will at best extend around the starting tile

The problem is due to poles knowing the connections they have and the tiling would have to a) have to fix the connections for the new tiles and b) ideally should establish connections between the tiles.

The problem with a) is the internal referencing of :neighbours [1] to local entity numbers. A super naive/aggressive workaround could be to just add neighbours from each pole to each other pole and let factorio figure things out. The nicer approach would be just reconnect all poles, but we would have to extract the max connecting distance for the different "pole-ish" things.

A simple example showing the problem:

0eNqd0NtqwzAMBuB30bU94qxZN79KCSUHkQls2fgwGorffXa6i0FhF7syP0ifJN9hNhl9IE6g7xB58jI5uQVaW76BHgTsoFVXBExzdCYnlK3ME2+gU8gogBbHEfSlArTxZFpr2j2CBkpoQQBPtiWLK2Ur0eCSAi3SO4NQZeIV6yxVRgHIiRLhwzvCfuVsZwy14G9JgHexNjv+Wb57eaxf3zqFkbbP2eXQ7H4s4snv/+mfnn01tmOO8/WvTxbwhSEeQv+uTueP/jyoQb2+daV8A3Thg9E=
{:blueprint
 {:snap-to-grid {:x 5, :y 10},
  :absolute-snapping true,
  :icons
  [{:signal {:type "item", :name "medium-electric-pole"}, :index 1}],
  :entities
  [{:entity_number 1,
    :name "medium-electric-pole",
    :position {:x 0.5, :y 0.5},
    :neighbours [2]}
   {:entity_number 2,
    :name "medium-electric-pole",
    :position {:x 0.5, :y 4.5},
    :neighbours [1]}], 
  :item "blueprint", 
  :version 281479275151360}}

Which turns into

0eJydk91qwzAMhd9F186I06Tp/CqjjPyITJDIxj9joeTdZ2e7GLSM1FdCIH3nHIFu0M8BjSX2oG7guDOF18VkaUz9FyhZClhT2QR0vdNz8FikOUM8gfI2oAAaNDtQb5FAE3dz2vWrQVBAHhcQwN2SugVHCkuBMw7e0lAYPSNEMvGISWy7CkD25Al/eHuzvnNYerRx4H+SAKNdXNb86758aXb7sUYVRpo+eh1sYlfXTdzxq0x+fc+Xj/inJ/nNk/7rTP5R/03mfeTRAOdcgaMJ2swLHU5wyRV4nCA+xP5C6s+nCvhE63ZEdZF1+1q1jWzk6Vxu2zdAAkQ2
{:blueprint
 {:snap-to-grid {:x 10, :y 10},
  :absolute-snapping true,
  :icons
  [{:signal {:type "item", :name "medium-electric-pole"}, :index 1}],
  :entities
  [{:entity_number 1,
    :name "medium-electric-pole",
    :position {:x 0.5, :y 0.5},
    :neighbours [2]}
   {:entity_number 2,
    :name "medium-electric-pole",
    :position {:x 0.5, :y 4.5},
    :neighbours [1]}
   {:entity_number 3,
    :name "medium-electric-pole",
    :position {:x 5.5, :y 0.5},
    :neighbours [2]}
   {:entity_number 4,
    :name "medium-electric-pole",
    :position {:x 5.5, :y 4.5},
    :neighbours [1]}
   {:entity_number 5,
    :name "medium-electric-pole",
    :position {:x 0.5, :y 10.5},
    :neighbours [2]}
   {:entity_number 6,
    :name "medium-electric-pole",
    :position {:x 0.5, :y 14.5},
    :neighbours [1]}
   {:entity_number 7,
    :name "medium-electric-pole",
    :position {:x 5.5, :y 10.5},
    :neighbours [2]}
   {:entity_number 8,
    :name "medium-electric-pole",
    :position {:x 5.5, :y 14.5},
    :neighbours [1]}], 
  :item "blueprint", 
  :version 281479275151360}}

christoph-frick avatar Feb 11 '22 16:02 christoph-frick