Limits and the game's editor
A thousand instructions, four hundred buffer characters, 256 draw commands — limits are worth knowing before you hit them
The limits you run into
Section titled “The limits you run into”| What | Limit |
|---|---|
| instructions in a program | 1000 |
| labels in the text form | 500 |
| characters in the print buffer | 400 |
draw commands before drawflush |
256 |
| a processor’s links | by the block’s radius, not by count |
| slots in a memory cell | 64, in a memory bank — 512 |
A thousand instructions is a lot: nobody writes that many by hand. The people who hit it are those who assemble a program with something else — a compiler or a generator.
The game’s editor and everything else
Section titled “The game’s editor and everything else”The processor window is a block editor: dragging, dropdowns, jump arrows. It is good while the program fits in your head, and agony when it has three hundred lines.
That is why it has a second door — “Edit code”: the same thing as text. In it:
- a program can be pasted in whole from the clipboard;
- labels work instead of line numbers;
- bulk changes are easy — search and replace in any text editor.
How to move a program
Section titled “How to move a program”| Where to | How |
|---|---|
| to another processor on the same map | copy the text through “Edit code” |
| to another map | the same — text is not tied to a map |
| together with the blocks | as a schematic: the processor is copied along with its program and links |
A schematic is the only way to move a program with its links: the names cell1, duo1 are
preserved in it if the blocks move along. Text copied on its own remembers no links at all: you
will have to set them up again, and the order will be different.
What the game’s editor does not have
Section titled “What the game’s editor does not have”- a search through the program. In three hundred lines you have to look with your eyes;
- comments that survive. You can write a comment: in the text form the game skips everything
after
#to the end of the line. But open the program as blocks and save it, and the editor assembles the text anew — out of blocks — and the comments disappear along with the labels; - a debugger. There is only the variable window; there are no breakpoints and no stepping
through lines — you have to imitate them yourself, with
waitand printing to a message block; - an edit history. There is no undo: erased is erased.
Hence the habit of the experienced: keep the program as text outside the game, edit it in an ordinary editor and paste it in whole.
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.