Page 1 of 1

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

Posted: Fri Dec 20, 2024 3:28 pm
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

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

Posted: Sun Feb 16, 2025 10:08 am
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 28 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 373 times
Actual:
Circuit wiring around reactors has additional wires
green-circuit-wiring-messed.jpeg
green-circuit-wiring-messed.jpeg (159.97 KiB) Viewed 373 times
Hope this helps

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

Posted: Thu Mar 06, 2025 11:14 am
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...

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

Posted: Thu Mar 06, 2025 11:40 am
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.

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

Posted: Thu Mar 06, 2025 11:53 am
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

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

Posted: Thu Mar 06, 2025 11:58 am
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.