For most players, building solutions for common problems—balancing oil, toggling between solar and coal with an RS latch, or setting train limits based on inventory, is pretty straightforward. And honestly, that’s already more than enough for a functional factory.
But then there are those of us who want more: Building computers, state machines, automalls, and other increasingly complex systems.
When I first set out to design a serious automall, I ran into a wall. My builds quickly became cluttered with one-shots, 1-tick delays, input insulators, and other timing hacks. I was spending more effort managing signals than actually implementing logic. It wasn’t scalable, and it definitely wasn’t clean.
What I realized was that I didn’t just need a solution. I needed a system. Something structured that could break problems into clear, sequential steps, manage complexity, and make designs easier to reason about.
After digging through existing approaches and experimenting with my own ideas, I eventually landed on a flexible method that worked for me.
This guide is an attempt to explain that system.
The Core
At the heart of this system are four combinators:
- A constant combinator for global variables — the Variables Combinator (VC). Toggling this combinator also acts as a full system reset/on-off switch.
- A constant combinator for global constants — the Constants Combinator (CC).
- A memory cell that tracks all declared variables and ignores all other signals.
- An arithmetic combinator that multiplies all signals by -1.
The Data Bus
The system uses two wires:
* Green wire — carries all global variables and constants. Undeclared signals may also exist here, as long as they don’t interfere.
* Red wire — read-only, containing the negative of everything on the green wire. This is produced by the fourth core combinator.
Variables
To declare a variable, assign it a value of 1 in the VC. Once declared, any instance of that signal on the data bus will be tracked by the memory cell.
To change a variable, output the difference between the desired value and the current value onto the green wire for one tick. (More on this shortly.)
Constants
Any signal defined in the CC is continuously present on the data bus.
Timers
Any signal declared in both the VC and CC becomes a timer.
The value in the CC determines how much the signal increments (or decrements) each tick.
Since timers are also variables, they can still be written to directly.
The Instruction Pointer (IP)
The instruction pointer is simply a timer that increments once per tick. It controls sequencing and timing across the system.
I use the S signal as the instruction pointer.
On/Off Behavior
The entire system is designed to reset when the VC is turned off.
Turning it back on restarts everything from a clean state—similar to rebooting a computer.
Manipulating Variables
All variable updates follow a single pattern:
X = X + (something)
or shorthand: X += (something)
This reflects how Factorio’s memory cells work. A stored value is continuously fed back into itself. Any additional signal is added on top of that existing value. For example, if the memory cell holds X = 5, and you input X = 1, the result becomes X = 6.
Examples
X = 45 → X += 45 - X
X = 0 → X += -X
X = Y → X += Y - X
X++ → X += 1
The right-hand side of the += expression is what you output onto the green wire.
This is where the red wire becomes extremely useful: since it already contains -X, you can easily cancel out a variable’s current value while applying a new one.
Incrementing, decrementing, or resetting variables can be done with a single combinator.
Multiple independent operations can often share the same combinator.
Assigning a literal value (e.g. X = 45) is also straightforward with one combinator.
Example Image: When S == 5, Set X to 45, increment Y by 1
More complex assignments (e.g. X = Y) typically require two steps:
Use an arithmetic combinator to compute the difference (Y - X → X)
Use a decider combinator to output the result at the correct time, usually gated by the instruction pointer
Example Image: When S ==6, set Z equal to X How to Use This Guide
From here on, this guide shifts from explanation to demonstration. The above explanation, paired with a few "code samples", should
provide a better understanding on how you could leverage this system for your own creations.
Below is a blueprint containing several examples (nested for loop, Fibonacci sequence generator, prime number generator, and more). Most combinators include descriptions.
I recommend exploring it in a sandbox map with god mode, all technologies unlocked, and the editor enabled. Using the editor’s time controls to pause and step forward tick-by-tick makes it much easier to follow what’s happening.

