Skip to content

Instantly share code, notes, and snippets.

View Anuken's full-sized avatar
👁️

Anuken

👁️
View GitHub Profile
@Anuken
Anuken / Home.java
Last active December 15, 2016 01:28
Ancient code. Proceed with caution.
package net.pixelstatic.Home;
import java.awt.image.BufferedImage;
import java.io.File;
import java.nio.ByteBuffer;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;

THE CURRENT WIP v7 EREKIR BRANCH PORTING GUIDE

Setup

This guide is intended for Java (and sometimes JSON) mods. If you are using JS, please don't - I very rarely use JS myself, and I can't give accurate instructions for porting.

Before you do anything, read the old v7 porting guide and make sure you have no deprecation warnings in your mod, because everything that was deprecated then has since been removed. I will not be covering deprecated API here.

How do I depend on the Erekir branch from JITPack or from Gradle?

@Anuken
Anuken / mindustry-fixed-timestep.md
Created June 26, 2026 15:25
Fixed Timestep in Mindustry

Fixed Timestep Overview

What does 'fixed timestep' even mean?

Currently, Mindustry runs building logic at the same rate as the game updates. If your game is running at 1000 FPS, blocks update 1000 times a second. If you're running at 60 FPS, they update 60 times, etc.

In order to compensate for the vast range of potential FPS values, blocks currently use delta time - the time between updates (frames in this case) - to scale values. For example, a conveyor must move items a certain distance each update. In theory, multiplying this movement distance by the delta time means that items move at the same (real world) speed, regardless of whether you are doing 1 or 100 updates a second.

The issue with this approach is that using delta time is not accurate. Updating a block twice at 60 FPS (1x delta) often gives different results than updating the same block once at 30 FPS (2x delta). There are many examples of this kind of behavior across different blocks, and it's impossible to complete eliminate usi