Several processors
One processor is one queue of lines. Two run in parallel — and that is the only way to speed up without changing the block
Two processors and a cell between them. The top one takes the readings off the store and puts them into memory, the bottom one reads them out of there and prints the sum. Each is busy with its own job and runs at its own speed.
Why split
Section titled “Why split”For speed. A hundred-line program in a micro processor gets through an iteration once every
fifty ticks. Cut it in half, place two processors — and each half will run twice as often. That
is the only way to speed the work up without changing the block:
setrate only lowers the speed.
For order. A separate processor for the turrets, a separate one for the factory, a separate one for the display: each small, each understandable, and one breaking does not bring the rest down.
For links. A processor’s link range is limited: a micro processor reaches ten tiles. A base is wider — so there will be several processors out of sheer geography.
What they exchange
Section titled “What they exchange”| Way | Good for |
|---|---|
| a memory cell | numbers and objects, many and for a long time |
| reading a neighbour’s variables | one or two values, with no extra blocks |
| a global flag | a “yes/no” between world processors |
| a unit’s flag | a mark that has to travel with the unit |
| the building itself | when the neighbour can see the same store anyway |
A cell is the most ordinary option: it is visible to both, it survives an edit to the program and it holds sixty-four values.
Who waits for whom
Section titled “Who waits for whom”Nobody. The processors are not synchronised: each runs in its own turn, whenever a tick falls to it. Two things follow from that.
How many you can have
Section titled “How many you can have”Many. The game happily holds hundreds of processors, and what usually runs out is not the game but the person: ten processors talking through a single cell are hard to debug.
The sensible middle is to split by job, not by lines: one processor is responsible for one thing entirely and does not climb into anybody else’s.
Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.