Skip to content

Rustcraft v0.0.4

Choose a tag to compare

@github-actions github-actions released this 03 Nov 15:58
· 738 commits to main since this release
2e768c2

Rustcraft v0.0.4: the first two waves of the optimisation pass over the whole code base (43 changes), each one reviewed, proven to change nothing the game or a server can see, and kept switchable. Unofficial and work in progress: keep backups of worlds you care about.

Faster, measured

Same PC, quiet machine, the v0.0.3 code and this release alternated launch by launch, median of 3 runs per scene:

Part of the game v0.0.3 v0.0.4 Change
Integrated server tick, village 1.72 ms 1.08 ms −37 %
Integrated server tick, Nether 0.72 ms 0.64 ms −11 %
Integrated server tick, forest 0.96 ms 0.87 ms −9 %
Integrated server tick, plains 0.77 ms 0.72 ms −7 %
Integrated server tick, 100 mobs 0.97 ms 0.90 ms −7 %
Integrated server tick, 1,000 mobs 7.29 ms 7.00 ms −4 %
Slowest ticks (1 %) during a TNT blast 71.8 ms 67.2 ms −6 %
World generator ready 130 ms 86 ms −34 %
Generation of a chunk 1.77 ms 1.53 ms −12 to −18 %
Loading until the world is drawn, new chunks 1.17 s 1.07 s −8 %
Save when leaving the world 150 ms 140 ms −3 to −8 %
Graphics card time per frame −4 to −9 %
Meshing time (blocks prepared for drawing) −2 to −18 %

Frames per second do not move (3,500 to 4,000 on this PC, limited elsewhere). Memory stays where it was (+10 to +25 MB out of about 1.4 GB). The redstone scene is unchanged, within the noise.

What changed underneath

  • Mobs: path search with a table of block types, one memo per search and reused buffers; a private mob list that prepares a shared spatial grid.
  • World generation: surface, ore veins and cave tops, the terrain around structures, jigsaw assembly, the density evaluator, exact sin/cos without a slow fallback, state tables built off the critical path.
  • Saves and regions: chunks read outside the region lock, one open file per region, only the changed header words written, NBT written without per-string allocations.
  • Client: name tags, the Tab list and the sidebar kept between frames, block entities reading their state once, the solo link's messages almost three times smaller, the world list read in the background, the structure block's air drawn by the graphics card, an audio engine and mixer without wasted work.
  • Network: compressed frames written in place.
  • Readability: the client's main file and the renderer are split into modules by concern.

Closer to the game

  • The predicate= option of entity selectors is honoured.
  • A duration of -0.5t rounds like the game, and the daylight detector reads the game's sine table.
  • Changes to kept entities reach the save, a teleport to another chunk moves the entity's save record, and entities placed by generated structures are saved.
  • Summoned decorations far outside the world round their position like the game.

Release files

  • The Windows checksum file now ends its line like the Linux one, so sha256sum -c works everywhere, and a job downloads the release and checks every file.
  • Builds use frozen inputs (--locked, actions pinned by commit) and the same commit gives byte-identical archives.

Known

  • In some worlds the player enters one game tick later than in v0.0.3 (about 50 ms). Its cause is being looked for.