Skip to content

Advanced

A group symmetrical to «Basics», only from the other end. “Basics” is what you need before the instructions; this is what sits on top of them and belongs to none of them.

There is no need to read it in order, and no reason to: each lesson answers a question that arises by itself once a program stops fitting in your head.

  1. @counter: a jump as a valueA jump is not only jump. The number of the next line sits in a variable, and it can be calculated
  2. Inside a numberThere is one number type in mlog — double precision. Hence both the 53-bit limit and 0.1 + 0.2 ≠ 0.3
  3. Labels instead of line numbersA line number in a jump is a choice, not an obligation. In the text form the target can be called by name
  4. Time: @time, @tick, @secondTick, second, minute and millisecond — one and the same time in four forms. Which one you pick depends on the task
  5. What an instruction costsA processor has no «expensive» and «cheap» lines: it counts them by the piece, and the pieces per tick are exactly @ipt
  6. Packing dataThere are few slots in memory, and a unit has exactly one flag. Several numbers have to be folded into one
  7. Several processorsOne processor is one queue of lines. Two run in parallel — and that is the only way to speed up without changing the block
  8. Limits and the game's editorA thousand instructions, four hundred buffer characters, 256 draw commands — limits are worth knowing before you hit them
  9. The fine printA collection of places where intuition fails: comparisons with a tolerance, null instead of infinity and objects equal only to themselves

All of «Basics» and at least one instruction group in full. The lessons here assume you have written programs and run into something specific.

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.