Skip to content

Codex Logic Factory Controller

CaptainGummiball edited this page Nov 10, 2026 · 1 revision

Factory Controller

The Factory Controller runs your machines for you. You tell it "make 64 steel plates" or "always keep 500 plates in stock"; it plans every step down to the raw materials, takes the inputs from the storage network, has Machine Interfaces deliver them to free machines and collects the products. It can also start and stop Rift mining programs to keep raw materials in stock.

Setting it up

  1. Build a storage network with a Storage Controller (see The Storage Network).
  2. Put a Machine Interface at every machine that should work for the factory and link each one to that Storage Controller.
  3. Link the Factory Controller to the same Storage Controller with the Quanta Linker: Factory Controller first, then Storage Controller.
  4. Give it energy: it takes energy on every side.
  5. Right-click it, pick an item and press Make or Stock target.

The controller finds its machines by itself: every machine behind a Machine Interface of its network whose chunk is loaded. The Machines tab lists them.

Energy

It draws logic.factoryEnergyBase (default 32, allowed 0–100000) E/t, plus logic.factoryEnergyPerJob (default 8, allowed 0–100000) E/t for every job that runs, into a buffer of 20,000 E. Without enough energy, or while a Grid Monitor sheds it, it plans and starts nothing new; machines that already work go on.

Orders and jobs

  • Make: an order for a number of an item. It is planned once and leaves the list when its last job is done.
  • Stock target: "keep this many in stock". Every logic.factoryStockSeconds (default 10, allowed 1–300) seconds the controller compares the free amount in the network with the target and plans what is missing. A target stays until you remove it; a new target for the same item replaces the old one.

Every step of a plan becomes a job: one recipe, a number of runs, at one machine. A job goes through these states:

  1. waiting: until a free machine of the right kind and tier exists and all inputs for all its runs are free in the network. Then it reserves them: nobody can take them out of the network any more.
  2. delivering: the Machine Interface fills the machine with the reserved inputs.
  3. running: the machine works; the interface takes the products into the network.
  4. done: once the interfaces have taken the expected amount, or the machine has stood idle for 200 ticks after the last delivery.

At most logic.factoryJobs (default 8, allowed 1–64) jobs deliver or run at the same time, one per machine. The controller works every 0.5 seconds.

The planner

From "N of X" the planner builds the steps the linked machines can run, in an order where every step's inputs exist before it starts:

  • It uses the machine recipes of QNet (and of data packs and foreign machines, see Foreign Machines), not crafting-table recipes. Recipes of the Assembly Complex that need several stations in order are not planned.
  • Stock comes first: inputs that the network already has are taken from there. For a Make order the stock of the wanted item itself is not used; you get N new pieces.
  • A machine type must be linked at the recipe's tier or higher.
  • By-products and surplus of earlier steps count for later ones. Chance outputs never count.
  • A recipe that needs its own product on the way is not used.
  • At most 8 steps in a row and 256 steps in one plan.

When a plan is not complete, the order shows why and is tried again later:

Problem Meaning
missing … Neither the stock nor the machines can provide this.
too many steps in a row (at most 8) The chain is too deep; make the intermediate product first.
plan too large (at most 256 steps) Order less at once, or make intermediate products first.
Not reachable (unloaded, out of range or gone) The Rift gate of a stock target cannot be driven.

The screen

The header shows "Jobs 2 / 8" (running of possible). At the bottom a red line says "Link it to a Storage Controller with the Quanta Linker." while it is not linked or its network is not reachable.

Orders tab

  • Search field and the list of everything the linked machines can make (and what linked Rift programs bring in). "Nothing to make: link machines through Machine Interfaces." when the list is empty.
  • The order panel of the picked item: the plan preview ("missing …", "… from stock", "… runs for …"), the amount with -64, -1, +1 and +64 (1 to 1,000,000), Make and Stock target, and the Source button when a Rift gate can bring the item.
  • Open orders and jobs: every job with its machine or state and a progress bar, and Make orders that have a problem. x cancels the whole order, for a job of a stock target the target too (so the x of a stock target shows only for an admin): reservations are released, deliveries stop; what a machine already has stays there and finishes.

Targets tab: every stock target with "stock / target" (green when reached, amber below, red with a problem), its source and x to remove it. "No stock targets yet." when there are none.

Machines tab: every machine with its tier and "working" or "free". "No machines: put Machine Interfaces at machines and link them to the storage network." when there are none. Below it the button "Computers may order: off" or "Computers may order: on".

Rift tab: the linked Rift gates as cards (see below).

Action Role needed
Open the window Viewer
Make, cancel a Make order, start or stop a Rift program Operator
Stock targets (also removing one with the x of its job), computer orders, linking Admin

Rift gates as sources

A stock target can name a Rift gate instead of the machines: the gate's job program then runs while the target is below and stops (closing the rift) once every target of that gate is reached.

  1. Select the Factory Controller with the Quanta Linker, then use the linker on a Rift Gate Controller: "Rift gate at … linked to the Factory Controller." Sneak-use on the gate unlinks it.
  2. Set up a job program at the Rift console. Its Matter Receiver must deliver into the same storage network.
  3. In the Orders tab pick an item the program brings in, switch Source to the gate and press Stock target.

What the Matter Receiver already holds counts as stock. The controller only stops a program it started itself; a program you start by hand is left alone, and pressing Start or Stop on a card takes the gate out of automatic control until a target needs it again.

A controller drives at most 4 gates ("The Factory Controller drives four Rift gates at most."); the Rift tab shows a card for each of them, and below the cards how to link one while fewer than 4 are linked. Linking needs the admin role at the controller and at the Rift complex; a gate without a complex gives "This Rift gate has no complex yet."

Each card shows "Gate 1", AUTO while the controller drives it, the gate's position, a lamp while the rift is open, the program's entries as a bar and a status line: "Idle · program of … addresses", "Running …/…: … · …", "No program: set one up at the Rift console" or "Not reachable (unloaded, out of range or gone)". The Start / Stop button runs the program by hand.

Computers

With CC: Tweaked the controller is a peripheral of the type qnet_factory. Computers may always read; they may order and cancel only while the button in the Machines tab says "Computers may order: on". See ComputerCraft.

In the world

Eight lamps on the front show the running jobs; three gears under the glass top turn while jobs run.

Building it

Redstone Comparator Redstone Comparator → Factory Controller

Tip

Start small Link one Crusher with a Machine Interface and order a few dusts. The Orders tab shows the plan before you press Make, and the Machines tab shows whether the machine is found.

Note

Reservations A job reserves its inputs for 24,000 ticks. The terminal shows reserved amounts and does not hand them out; a Storage Interface does not offer them to pipes.

QNet Codex

Getting Started

Energy

Processing

Rift

Storage

Logic

Reference

Items and Blocks

Clone this wiki locally