logoalt Hacker News

everforward10/13/20241 replyview on HN

> - Runs at 1 million ticks per second thanks to MCHPRS server - which is 5.8 kHz clock speed

I had to go look into this, because that's shockingly fast. The latest Intel CPUs have a 6.2 GHz clock rate when TVBing, so each Minecraft tick runs in ~1,000 CPU cycles. Each thread handles 65k surface blocks (256x256 plot), so that means each cycle is processing upwards of 10 surface cycles in the most lenient circumstances I can think of.

I went to go look into how on Earth they're doing that with all this Redstone around; there are some docs at [1] if anyone else is curious. It looks like they have some kind of Redstone "compiler" that converts the Redstone blocks into a graph, and execution happens on that graph.

That's crazy impressive. It does make using Minecraft feel a little silly, to me and perhaps only me. They have an input step where they basically parse the map, convert it to a graph that seems to resemble the AST of an LLVM IR, and then execute it. It makes Minecraft feel like a very awkward scripting language to me; why stack 16k Redstone cubes manually just so they can parse it into an IR instead of just scripting generating the IR or something like that?

1. https://github.com/MCHPR/MCHPRS/blob/master/docs/Redpiler.md


Replies

verdverm10/13/2024

Minecraft has a unique and diverse community, it's what gives it the staying power

I would imagine they used one of many tools for copy/paste in Minecraft, especially with the repetitive nature of the components.

Mojang (and now Microsoft) have taken ideas from the community to make the game better. It would be interesting if they incorporated the Redpiler idea, because redstone can get laggy

show 1 reply