Repository navigation
Codex Logic 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.
- Build a storage network with a
Storage Controller (see The Storage Network). - Put a Machine Interface at every machine that should work for the factory and link each one to that Storage Controller.
- Link the Factory Controller to the same Storage Controller with the
Quanta Linker: Factory Controller first, then Storage Controller. - Give it energy: it takes energy on every side.
- 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.
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.
- 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:
- 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.
- delivering: the Machine Interface fills the machine with the reserved inputs.
- running: the machine works; the interface takes the products into the network.
- 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.
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 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 |
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.
- 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. - Set up a job program at the Rift console. Its Matter Receiver must deliver into the same storage network.
- 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.
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.
Eight lamps on the front show the running jobs; three gears under the glass top turn while jobs run.
| Redstone Comparator | Redstone Comparator | → |
||
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
- Welcome to QNet
- The First Machines
- Tiers and Components
- Energy, Fluids and Gases
- Building Plants
- The Quanta Linker
- Teams and Rights
- Upgrades and Plant Modules
Energy
- Energy Overview
- Basic Dynamo
- Thermoelectric Generator
- Stirling Generator
- Geothermal Heat Exchanger
- Solar Array
- Wind Turbine
- Solar Thermal Field
- Industrial Boiler
- Steam Turbine
- Gasifier
- Natural Gas and the Gas Derrick
- Gas Engine
- Gas Turbine
- Fission Reactor
- Nuclear Fuel Cycle
- Advanced Reactor Model
- Centrifuge Cascade
- Tokamak
- Little Star
- Micro Black Hole Plant
- Hawking Reactor
- Capacitor Bank
- Battery Hall
- Molten-Salt Store
- Gravity Store
- SMES
- Dimensional Store
- Process Heat
- Electric Heater and Heat Exchanger
- Incidents and Safety
- Radiation
Processing
- Crusher
- Induction Furnace
- Metal Former
- Assembler
- Plant Processor
- Farming Station
- Tree Harvester
- Electrolyzer
- Air Separator
- Chemical Reactor
- Industrial Centrifuge
- Crystallizer
- Tunnel Furnace
- Foundry
- Chemical Plant
- Assembly Complex
- Agricultural Facility
- Particle Facility
- Quantum Facility
- Matter Reconstructor
- Deep Core Extractor
- Plant Speed Modules
- Materials and Recipes
Rift
- The Rift
- Building the Complex
- Structure Parts
- Rift Gate Assembly
- Power Injection Array
- Stabilization Tower
- Coordinate Computation Array
- Dimensional Observatory
- Extraction Array
- Matter Receiving Facility
- Linking the Complex
- Running the Rift
- The Rift Console
- Research and Signals
- The Research Tree
- Mining
- Sectors and Diminishing Returns
- The Job Program
- Rift Map Table
- Command Terminal and Monitors
- Rift Materials
Storage
- The Storage Network
- Storage Controller
- Storage Units
- Storage Access Terminal
- Storage Interface
- External Storage Interface
- Bulk Tank
- Warehouse
- Linking Storage
Logic
Reference
Items and Blocks
- Advanced Circuit
- Ash
- Basic Circuit
- Bio Fertilizer
- Biomass
- Block Die
- Block Mold
- Casting Basin
- Charged Quantum Crystal
- Coal Dust
- Conductive Alloy Ingot
- Conveyor
- Copper Coil
- Copper Dust
- Copper Plate
- Copper Wire
- Creative Battery
- Creative Gas Tank
- Deepslate Lead Ore
- Deepslate Lithium Ore
- Deepslate Uranium Ore
- Efficiency Upgrade
- Emergency Vent
- Energy Cell
- Energy Transformer
- Exotic Matter
- Field Emitter
- Field Stabilizer
- Fluid Tank
- Gas Compressor
- Gas Tank
- Gear Die
- Gear Mold
- Generator Coil
- Gold Dust
- Gold Plate
- Heat Exchanger Tubes
- Induction Coil
- Industrial Frame
- Ingot Mold
- Iron Dust
- Iron Plate
- Irradiated Residue
- Laser Optic
- Block of Lead
- Lead Ingot
- Lead Ore
- Lithium Carbonate
- Lithium Dust
- Lithium Ore
- Machine Frame
- Nugget Mold
- Parallel Upgrade
- Pattern Card
- Plant Fiber
- Plate Die
- Plate Mold
- Polymer Sheet
- Precision Alloy Ingot
- Precision Frame
- Pump
- Quanta Linker
- Quantum Crystal
- Quantum Frame
- Quantum Processor
- Range Upgrade
- Raw Lead
- Raw Lithium
- Raw Uranium
- Refractory Bricks
- Rod Die
- Rod Mold
- Rotor Blade
- Rotor Shaft
- Sensor Module
- Servo Motor
- Silicon
- Silicon Boule
- Silicon Wafer
- Solidified Melt
- Speed Upgrade
- Stabilized Matter
- Steel Blend
- Steel Dust
- Steel Gear
- Steel Ingot
- Steel Plate
- Steel Rod
- Superconductor Wire
- Uranium Dust
- Uranium Ore
- Wire Die
- Yield Upgrade