Cloned entities ignore conditions for their first tick

Things that we don't consider worth fixing at this moment.
Atraxi
Inserter
Inserter
Posts: 21
Joined: Sun Aug 14, 2016 11:43 am
Contact:

Cloned entities ignore conditions for their first tick

Post by Atraxi »

When cloning some entities the new copies appears to ignore any conditions for their first tick. Primarily an issue for mods, but the underlying issue is entirely reproduced in vanilla 1.0 with the editor.
I've tested belts and inserters, and interestingly pumps don't appear to be affected. I haven't tested it on any other entity types yet.

Before cloning:
Inserter before.png
Inserter before.png (500.98 KiB) Viewed 2420 times
After cloning:
Inserter cloned.png
Inserter cloned.png (428.72 KiB) Viewed 2420 times
Before cloning:
Belt before.png
Belt before.png (579.32 KiB) Viewed 2420 times
After cloning:
Belt cloned.png
Belt cloned.png (574.25 KiB) Viewed 2420 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14627
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Cloned entities ignore conditions for their first tick

Post by Rseding91 »

That's working correctly. The circuit network has no values the first tick because the live state of the network is not cloned: just the entities are.
If you want to get ahold of me I'm almost always on Discord.
Atraxi
Inserter
Inserter
Posts: 21
Joined: Sun Aug 14, 2016 11:43 am
Contact:

Re: Cloned entities ignore conditions for their first tick

Post by Atraxi »

Just to clarify in case it helps modders attempt a workaround, when you say "has no values" do you mean null or undefined rather than just zero'd out? As the intended before and after state in the demo setup is that the network has no signals with the entities configured to be inactive in any feasibly reachable state.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14627
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Cloned entities ignore conditions for their first tick

Post by Rseding91 »

Atraxi wrote: Fri Sep 04, 2020 4:04 pm Just to clarify in case it helps modders attempt a workaround, when you say "has no values" do you mean null or undefined rather than just zero'd out? As the intended before and after state in the demo setup is that the network has no signals with the entities configured to be inactive in any feasibly reachable state.
I mean it's a completely new circuit network and has no live values. Everything sends their state during the creation tick and then the next tick it gets swapped into the live values and the system repeats itself. It's now circuit networks work.
If you want to get ahold of me I'm almost always on Discord.
sparr
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Cloned entities ignore conditions for their first tick

Post by sparr »

If the network had no values then the "value < 0" filters would keep things disabled, but the demonstrations here are of "value < 0" filters being true and/or ignored for the first tick. This seems to be something more than just the values not being present.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14627
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Cloned entities ignore conditions for their first tick

Post by Rseding91 »

sparr wrote: Fri Sep 04, 2020 6:04 pm If the network had no values then the "value < 0" filters would keep things disabled, but the demonstrations here are of "value < 0" filters being true and/or ignored for the first tick. This seems to be something more than just the values not being present.
The belt is active for the first tick and updates independent from the control behavior. In the same way if you create-entity a belt and in the same tick create the control behavior and set the condition it still updates once before the control behavior disables it.
If you want to get ahold of me I'm almost always on Discord.
sparr
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Cloned entities ignore conditions for their first tick

Post by sparr »

OK. Thanks for clarifying that. It still feels like a misbehavior, but at least knowing what's causing it behind the scenes makes it more predictable. Is there any way to explicitly and unconditionally prevent such an entity from operating on tick one from within the mod that creates it, to give the conditions time to take effect?
Post Reply

Return to “Won't fix.”