[2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Things that has been reported already before.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 756
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

[2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Post by Hares »

Steps to Reproduce
  1. Deploy blueprint one (train stop to the right) outside of the network in non-rotated position (train head to the left)
  2. Deploy blueprint two (train stop to the left) outside of the network in non-rotated position (train head to the left)
  3. Delete both blueprint ghosts
  4. Undo the deletion
Expected:
  • Both BPs reverted to their initial state
Actual:
  • Blueprint one (train stop to the right) has extra wires on the selector combinator
  • Blueprint two (train stop to the left) has no such extra wires
Blueprints:

See Also
Possible duplicates. Root cause might be the same even though this has slightly different form.
Click to expand the recording
Attachments
2024-12-20 18-20-06.mp4
(18.37 MiB) Downloaded 26 times
targetsan
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Jan 05, 2021 7:47 pm
Contact:

Re: [2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Post by targetsan »

Encountered similar bug in editor mode

Save file to repro bug on:
circuit-wiring-messed-after-delete-undo.zip
Save file which reproduces issue
(822.16 KiB) Downloaded 17 times
1. Delete whole powerplant with deconstruction planner
2. Undo deletion with Ctrl+Z

Expected:
Circuit wiring around reactors (power poles hexagon) is normal
green-circuit-wiring-ok.jpeg
green-circuit-wiring-ok.jpeg (158.98 KiB) Viewed 270 times
Actual:
Circuit wiring around reactors has additional wires
green-circuit-wiring-messed.jpeg
green-circuit-wiring-messed.jpeg (159.97 KiB) Viewed 270 times
Hope this helps
DemRat
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Jan 06, 2015 2:41 pm
Contact:

Re: [2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Post by DemRat »

Yeah, I have observed this a lot when building complicated circuitry. This is really annoying, as it completly breaks any readability. It effectively makes "undo" unusuable in that scenario, because every undo is immediately followed by like half a minute of figuring out which wires I need to remove again...
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3799
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Post by boskid »

I will consider this a duplicate of 118468. Core of the issue is that for undo wires to work, wires must be recorded during the action that removed entity and electric pole rewiring on removal is not happening when entity is marked to be deconstructed. When entities are marked to be deconstructed, wires are not yet removed and rewired so it cannot remember what wires will be created due to rewiring, it is the construction robot that arrives and deconstructs electric pole that causes rewire to happen. This action can no longer access undo of a player. Only case that maybe could be considered is removal of ghost electric poles as they never go into to-be-deconstructed state and are immediately removed so maybe at least those could record wires that were added due to electric pole rewiring.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 756
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: [2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Post by Hares »

boskid wrote: Thu Mar 06, 2025 11:40 am I will consider this a duplicate of 118468. Core of the issue is that for undo wires to work, wires must be recorded during the action that removed entity and electric pole rewiring on removal is not happening when entity is marked to be deconstructed. When entities are marked to be deconstructed, wires are not yet removed and rewired so it cannot remember what wires will be created due to rewiring, it is the construction robot that arrives and deconstructs electric pole that causes rewire to happen. This action can no longer access undo of a player. Only case that maybe could be considered is removal of ghost electric poles as they never go into to-be-deconstructed state and are immediately removed so maybe at least those could record wires that were added due to electric pole rewiring.
Can it be made so entities drop their wires the moment they are marked to be deconstructed instead of actually being deconstructed? Other entities stop to work immediately they are marked, so it's consistency :D
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3799
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.27] Undoing blueprint deletion results in redundant wires within that blurprint

Post by boskid »

Hares wrote: Thu Mar 06, 2025 11:53 am Can it be made so entities drop their wires the moment they are marked to be deconstructed instead of actually being deconstructed? Other entities stop to work immediately they are marked, so it's consistency :D
No. Consistency does not apply here. Other entities when cancel deconstructed will connect back to other entities as the connections are position based (like 2 belts connect when they are next to each other). Wires are not position based. If you would order deconstruction of an entity and other player would cancel deconstruction then wires would be gone.
Post Reply

Return to “Duplicates”