[2.0.43] Splitting a Circuit Network causes Update without Ticking

Bugs that are actually features.
eugenekay
Filter Inserter
Filter Inserter
Posts: 687
Joined: Tue May 15, 2018 2:14 am
Contact:

[2.0.43] Splitting a Circuit Network causes Update without Ticking

Post by eugenekay »

Today in "Editor Mode shenanigans", I was working on a Combinator based contraption and found unexpected behavior with Constant Combinators - they can produce an Output signal on tick 0.

What did you do?
  • Create an empty Scenario
  • Create a Circuit Network containing at least 4 connected entities, including 1 Constant Combinator
  • Disconnect the middle entities such that the Circuit Network is "split" in half
What happened?
Circuit Network 1 has been "Updated" - Power Poles & Decider Combinators can see the Output from the Constant Combinator. No Game Tick has occurred.
Screenshot 2025-04-06 002205.png
Screenshot 2025-04-06 002205.png (904.15 KiB) Viewed 381 times
Screenshot 2025-04-06 002240.png
Screenshot 2025-04-06 002240.png (75.75 KiB) Viewed 381 times
Circuit Network 2 (with no Constant Combinator) has no Signals, as expected.

What did you expect to happen instead? It might be obvious to you, but do it anyway!
Circuit Network 1 and 2 would remain empty until "Tick Once" is used.

Does it happen always, once, or sometimes?
If there is a Constant Combinator on any segment of Disconnected Circuit Network.


This seems like a very small corner case in Circuit Network dis/connect handling, since everything will update to the expected value on the first/next Tick..... and the Deciders don't do anything without Electricity anyway.

Thank you for reading!
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4118
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.43] Splitting a Circuit Network causes Update without Ticking

Post by boskid »

Thanks for the report but that is working as intended. Usually by the end of tick its circuit network that holds values used in next tick however when wires are removed, values were copied onto both circuit networks created and when wires were added back, values were added together. Both of those are needed for memory cells to not be corrupted but this means if there is more than one wire change between entity updates, memory cells will get corrupted (you can check this in 1.1 where it will fail). Because of this, when wires are removed there is a bonus circuit network update happening that is required so the values on circuit network do not get corrupted by multiple wire changes.
eugenekay
Filter Inserter
Filter Inserter
Posts: 687
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: [2.0.43] Splitting a Circuit Network causes Update without Ticking

Post by eugenekay »

boskid wrote: Sun Apr 06, 2025 5:58 am Thanks for the report but that is working as intended. Usually by the end of tick its circuit network that holds values used in next tick however when wires are removed, values were copied onto both circuit networks created and when wires were added back, values were added together. Both of those are needed for memory cells to not be corrupted but this means if there is more than one wire change between entity updates, memory cells will get corrupted (you can check this in 1.1 where it will fail). Because of this, when wires are removed there is a bonus circuit network update happening that is required so the values on circuit network do not get corrupted by multiple wire changes.
This makes sense! I was not sure if this was a Special Case as-described, or a forgotten Corner of the “disconnect” logic, since the behavior was so surprising.

If the Decider Combinators were powered, would they Update as well? I don’t think that is possible to achieve on the 0th Tick, even with an Electrical Energy Interface and a Gobal Electric Network enabled. I may actually be able to use this mechanism positively in this Scenario - I am trying my hand at a Large Combinator Creation, and it might be nice to be able to check the Logic without normal entities (ie, Inserters and Assemblers) experiencing a Tick as well.

Have a great day!
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4118
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.43] Splitting a Circuit Network causes Update without Ticking

Post by boskid »

No. Decider combinators only update in control behaviors update step. Bonus update is only for circuit networks so updatable control behaviors are not affected. Constant combinator is implemented as non updatable control behavior so whenever it is enabled or disabled, it changes its output values immediately which you would notice propagated when circuit network gets extra update. Similarily chest control behavior is non updatable so it changes output values immediately as part of contents change, it has to because its non updatable.

This bonus circuit update is only because game update is always doing control behavior update first and circuit network update second so at the end of normal tick, values are on wires. When wires are changed as part of player actions, values on wires cannot be trusted so bonus circuit update simply computes new values based on current control behavior outputs and as you notices, if the current outputs are changed then you will get new circuit values without full game tick.
eugenekay
Filter Inserter
Filter Inserter
Posts: 687
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: [2.0.43] Splitting a Circuit Network causes Update without Ticking

Post by eugenekay »

boskid wrote: Sun Apr 06, 2025 3:42 pmWhen wires are changed as part of player actions, values on wires cannot be trusted so bonus circuit update simply computes new values based on current control behavior outputs and as you notices, if the current outputs are changed then you will get new circuit values without full game tick.
Got it!

This makes it all “connect” for me: it is only the pre-computed Values (Constant Combinators, or Chests which I had not considered) which are being affected here, so there should not be any way for this to cause a game Effect, before the next Tick occurs.
Post Reply

Return to “Not a bug”