Skip to content

Rustcraft v0.0.5

Choose a tag to compare

@github-actions github-actions released this 07 Nov 20:55
· 532 commits to main since this release
a2783a0

Rustcraft v0.0.5: the last two waves of the optimisation pass over the whole code base (43 changes) and a series aimed at large TNT explosions (7 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, v0.0.4 and this release alternated launch by launch, two runs per scene (three when two runs disagreed), 1600 × 900:

Part of the game v0.0.4 v0.0.5 Change
Heap of 1,728 TNT set off at once: frames per second 2,727 3,550 +30 %
Heap of 1,728 TNT: worst second of the blast 699 to 711 frames 982 to 1,085 frames +40 to +53 %
Heap of 1,728 TNT: worst server tick 412.7 ms 43.8 ms −89 %
Heap of 1,728 TNT: slowest frames (1 %) 1.28 ms 0.83 ms −35 %
64 TNT every 5 s: slowest ticks (1 %) 63.7 ms 11.2 ms −82 %
64 TNT every 5 s: worst server tick 248.4 ms 23.7 ms −90 %
64 TNT every 5 s: frames per second 3,158 3,468 +10 %
Dropped items: frames per second 1,712 2,069 +21 %
1,000 mobs: frames per second 929 1,066 +15 %
Integrated server tick, redstone 2.56 ms 1.42 ms −45 %
Integrated server tick, cave 1.61 ms 1.08 ms −33 %
Integrated server tick, new world 0.99 ms 0.67 ms −33 %
Integrated server tick, plains (render distance 12 / 32) 0.73 / 1.20 ms 0.55 / 0.84 ms −25 / −30 %
Integrated server tick, ocean 0.58 ms 0.43 ms −25 %
Integrated server tick, forest, village, Nether, crowd −15 to −18 %
Integrated server tick, 1,000 mobs 6.99 ms 5.94 ms −15 %
Slowest frames (1 %), cave / plains at 32 0.59 / 0.61 ms 0.48 / 0.51 ms −19 / −16 %
Memory of the process −6 to −19 % (380 MB less at render distance 32)
Save when leaving the world −5 to −16 %
Time until the player is in the world 560 to 610 ms 480 to 551 ms −5 to −14 %

Frames per second elsewhere stay where they were or move up a little (−1 to +5 %; 3,500 to 4,200 on this PC).

What changed underneath

  • Explosions: one ray walker for explosions and wind bursts; the visible part of the entities hit by a blast read on one shared cell cube, with an air shortcut; the blasted objects weighed together in one pass; decorations hit by a blast read in place.
  • Integrated server: block ticks cost what is simulated rather than what is loaded; commands keep functions parsed, macros parsed once, command blocks and /schedule without repeated work, selectors without an allocation per entity; trial spawners, vaults and monster spawners without per-tick copies; villages, iron golems and raids with bounded distances and searches by species; animals, menus, advancements, projectiles, portals and the End fight without repeated scans or copies; ground items and orbs merging without wasted work; collisions reduced to the useful extent of the shapes.
  • Light: shorter propagation queues, seeds drawn from the read, sky sources computed once per column, zone reads and writes without per-cell work, uniform light layers shared instead of copied.
  • World generation: one generator per dimension, its seed-free parts built once; terrain fill, noise kernel and data file reading without wasted work.
  • Client display: blocks remeshed only where they are seen, like the game, with a cache of the previous meshes (partly compressed) and each face copied once; draw lists with a per-column cache and a hierarchical field-of-view test; primed TNT and ground items prepared without per-entity rework; particles, entities and block entities tested against the view in one structure; entity angles and animations through the game's sine table; sign and display text sharing the glyph pool; clouds rebuilt off the main thread; crosshair targeting through the game's entity search; one upload ring for the per-frame data; the graphics context opened in the background at startup and kept across F3+T.
  • Memory and hashing: chunks kept once for saving instead of twice, direct allocator calls, the remaining slow hashing replaced, and a code check that keeps it out.
  • Measurement: counters of the render, the slowest server tick broken down, the title screen and menus measured, and a new bench scene, a heap of 1,728 TNT set off at once.

Closer to the game

  • A villager killed in its bed wakes up first, so the bed is freed.
  • A vex keeps "no gravity" in its save.
  • Mobs standing still no longer resend their data and position every tick.
  • Short damage tag and damage type names resolve like the game.
  • Commands read and write furnaces, brewing stands, jukeboxes, decorated pots and crafters live; clone and block predicates see their live data; a crafter never disables an occupied slot.
  • The local player's head turns smoothly between ticks; axolotls and gliding follow the game.
  • Particles inside glowing blocks take the game's light.
  • Villagers hold a door open only for the fellows they perceive.
  • A projectile caught by a dimension change in the middle of a tick keeps its tick.
  • Biomes changed by /fillbiome reach the next save.
  • World generation: noise settings always keep their spawn targets, and a reused chunk fills its skipped air.
  • Chat messages from players wait until the options are applied.

Known

  • Opening a world, the world generator is ready up to 22 ms later than in v0.0.4 (56 ms at render distance 32), and the world opens up to 16 ms later; the player still enters the world sooner overall. Being looked into.
  • The one-tick delay at world entry noted in v0.0.4 is gone: the player enters 30 to 80 ms sooner than in v0.0.4.
  • Some optimisations stay off by default until they are proven or fixed, among them the light of new chunks resolved by tiles (with it, a world generated on a very busy machine was not always saved the same way). Nothing to do on your side.