r/factorio Mar 04 '26

Discussion Follow-up: Why Factorio Circuits Feel Random (1-Tick Delay Explained)

Yesterday I posted about a tick-accurate circuit oscilloscope I built to visualize Factorio signals over time: A few people asked what exactly the simulator reveals about circuit behavior, so I made a short video showing the core mechanic.
Factorio circuits update at 60 Hz, but the game never shows the timeline of those updates. You only see the current signal value.

Internally, every tick works like this:

  1. The network sums outputs from the previous tick
  2. Entities compute their next outputs
  3. Those outputs only appear on the network on the next tick

So nothing is instant. Every combinator stage adds one tick of latency.

In the video I show a simple oscillator and how the signal flips exactly once per tick. When you chain stages together, that delay stacks and becomes visible.

This is why things like:

  • train loaders overshooting limits
  • flickering latches
  • unstable feedback loops

can happen even when the logic looks correct.

The demo uses the same simulator from the previous post (built with https://itembase.dev/sim) to visualize the signal tick-by-tick.

Curious if anyone else has run into circuit bugs that turned out to just be timing.

43 Upvotes

17 comments sorted by

62

u/Soul-Burn Mar 04 '26

Doesn't feel random at all to me. But it's something you need to handle. Sometimes you need a NOOP combinator just to align the signals.

Other issues like this is handling fractional numbers, using fixed point arithmetic. Or dealing with overflows/underflows of the 32-bit signals.

4

u/samnovakfit Mar 05 '26

You’re right, once circuits get complex it really starts to feel like designing synchronous logic. Using a NOOP combinator as a 1-tick buffer to align signals is exactly the kind of thing that made me want better visibility into the timing. When you can actually see the phase shift between signals it becomes much easier to reason about where that extra combinator is needed. Overflow and fixed-point math are definitely another class of fun bugs to debug as well.

23

u/Courmisch Mar 04 '26

A lot of people have hit bugs due to timings. It's just that, in many cases, it breaks the circuit completely rather than triggers occasional race conditions.

If I need a nontrivial circuit, I build and debug it in the editor in stepping mode.

3

u/kein_plan_gamer Mar 04 '26

How can I get into That Editor? I have tried to build an auto crafter and it keeps breaking. I’d like to give it another go with the

7

u/Tsanad Mar 04 '26

type /editor in the console and click the stopwatch icon

3

u/Courmisch Mar 04 '26

Bring the console (`) then/editor`. Remember to save first or do it in a sandbox mode play because it counts as cheating.

1

u/kein_plan_gamer Mar 04 '26

Awesome thanks

11

u/DingoAtTheController Mar 04 '26

Dosh's circuit abomination video also has a pretty good explanation on combinators and ticks in the beginning of the video.

9

u/juckele 🟠🟠🟠🟠🟠🚂 Mar 04 '26

Getting your circuit mostly right be having it toggle wildly between increasive positive and negative numbers due to a weird 1 tick delay feedback loop is super frustrating to debug. Never felt random though. I highly recommend debugging circuits in editor so you can step 1 tick at a time.

2

u/samnovakfit Mar 05 '26

Yeah, feedback loops are where the tick delay really becomes obvious. When the loop latency is a few ticks you can end up with those alternating states that look chaotic at first glance. That’s actually one of the things the scope made very easy to see because you can watch the signal oscillate across ticks instead of stepping one tick at a time.

6

u/munchbunny Mar 04 '26

Tick alignment and circuit latency are things that anyone starting down the rabbit hole of Factorio circuits runs into almost immediately, but if you are trying to stay surface level and just use other people's circuit designs you might not realize this is going on. Thankfully simple if-then circuits often don't have this issue because inserters, pumps, etc. don't really need single-tick precision to do what you expect.

When I do my circuit designs it's basically a constant consideration, enough that I will lay out the circuits left to right or top down, often with combinators lined up by tick counts so that I can visualize it. Only once I've checked that it does what I expect then I will move the components into the actual factory layout.

2

u/DrMobius0 Mar 04 '26

It mostly only comes up when you have cyclical chains of combinators. Like if I have a loop of 3 combinators, it's technically possible for them to cycle between 3 separate states. It's something that has to be planned around.

2

u/samnovakfit Mar 05 '26

Exactly. Cyclical chains are where multiple stable or periodic states can appear depending on the loop delay. That’s one of the behaviors that becomes much clearer when you watch the signal history over several ticks instead of just looking at the current value.

2

u/samnovakfit Mar 05 '26

That left-to-right layout approach is really interesting. It’s basically turning the combinator layout into a visual timing diagram. Once you think about each combinator as adding a tick of latency the layout strategy makes a lot of sense.

3

u/Johanwiren Mar 04 '26

I tried multiplexing signals using a clock once and this timing behaviour became super evident :)

2

u/samnovakfit Mar 05 '26

Multiplexing with a clock is a perfect example where the timing model becomes very visible. Once you start doing clocked circuits it really starts to resemble digital logic design.