Making Minecraft 100x faster (by rewriting it in Rust)

preview_player
Показать описание
Minecraft has a lot of servers. Most of them are pretty slow. What if we rewrote them in Rust though?

SOURCES

S/O Ph4se0n3 for the awesome edit 🙏
Рекомендации по теме
Комментарии
Автор

Yes the benchmarks shows a 20x perf gap, but if the 3 most demanding tasks are not currently available this benchmark means nothing

nicolaska
Автор

5:42 The reason why light gets recalculated on the server is due to logic tied to spawning mobs in dark places and so on.

montytrollic
Автор

Lights are server side because it decides whether mobs can spawn there are not, so actually not that crazy.

David-gjdc
Автор

You know someone is a true minecraft player when he says "Bedrock is a completely different game". Couldn't be better phrased.

desLunes
Автор

BREAKING NEWS: vanilla Minecraft server outperformed by re implementation that does basically nothing

Dont get me wrong, the re implementations (pumpkin and minestom) really help bring more efficient servers. But they can't and never will replace vanilla minecraft servers, solely because its just too difficult, you can get close, but it will never be exact.
Minestom for example is being use more for minigames and specific things that do not rely on vanilla behaviour that much.

magical_whale
Автор

The main problem for Minecraft servers isn't the RAM usage, it's actually CPU usage. The base game is still single-threaded, so the vanilla server and it's modded forms are all also still largely single-threaded. As Mojang has added stuff to the game, the demand on servers has outpaced the improvement in single-threaded performance of new CPUs, meaning servers can hold less and less people with every update.

The solution to this of course, is to multi-thread it. However, as you pointed out in your video, with how much stuff actually runs on the server that's no small feat. Modding the base server to be multi-threaded is basically impossible (there is actually a project called Folia that is **kind of** doing this, and has had great success, but isn't ideal and causes a lot of issues), so the only real choice is a complete rewrite.

I personally do not think we'll ever see a feature-complete rewrite of the server, at least not from the community. It's just too much work, and with the increasing frequency of updates maintaining it long term would be next to impossible.

partykid
Автор

I mean yea this isn't using many resources, but there's *so much* that this isn't doing, so while this is a neat project, it doesn't say much about the performance of any of the technologies involved


also on RAM use: when you see the empty server RAM use, you need to account for the fact that the JVM preallocates a bunch of empty heap space, so it'll be vastly bigger on an empty server, but gain almost no RAM use when the first player joins

StefanErwinBaumer
Автор

It's not actually that impressive, there is NOTHING hapenning, most of it is being used for world generation, and there is basically no world hapenning, no light (which is expensive as fuck, and also, theo, mobs depend on light so it does need to be calculated on the server) no saving, no nothing, it's just the player and a extremely basic world, for something like this i'd actually expect better performance, really, not really fair to compare that to paper, vanilla, etc.

Meiallu
Автор

Minecraft isn't just slow because of Java, it's legitimately badly coded, IMO.

Ratstail
Автор

I like how we all in the Rust community gravitated to minecraft for coding challenges. I myself have remade a simple minecraft single player in Rust.

rokasbarasa
Автор

another buggy minecraft version on the way

untitledgoose
Автор

There is a Java library for creating custom Minecraft servers without the features from the Vanilla Minecraft it has multithreading and gives you full control of the server. It’s called Minestom.

Very useful for minigame servers that don’t want all the vanilla features.

Edit: he did briefly show their website.

samuelhulme
Автор

While this project is impressive, I don't think this has the right goals. Is this a Vanilla Server? The best vanilla experience is with mojangs vanilla servers because of its features. So... is this a lite server that can be used for minigame servers etc? Wait nope, that's not their goal! And modded servers are impossible anyway due to the way mods are written and what they expect.

This is just a mess. An impressive mess, but still a mess.

SammyForReal
Автор

The reason Lighting is server-side is because it isn't just visual, it has gameplay effects - mob spawning and crops growing/breaking are the two major ones. You can't offload that to the client(s).

Adowrath
Автор

>9:58 I'm impressed, it's running and it's running well
>% CPU: 105
>???

andrewk
Автор

Hey Theo. As someone who has written my own server implementation, I'm gonna say that the most difficult part of the project was knowing which packets are server- and client-bound. Most of the packet on the wiki is incorrectly labels, so it's pure guess work.

icxd
Автор

6:40 Mojang has been releasing deobfuscation maps for 5 years now, although it's not everything (e.g. function arguments) it's definitely enough for deobfuscation

BryanLu
Автор

5:43 - not sure what you are sigh-ing about . This makes perfect sense given how the game works.

Krzysiekoy
Автор

As someone who works a lot with Minecraft plugins and server code, I wish there was a feature complete server rewrite. Because 1) Java can be a pain and just makes certain things harder than they need to be, and 2) The Minecraft server code is needlessly complex at times and lacks any documentation. 3) Sometimes things are obfuscated making getting simple tasks done way harder than they have to be. 4) Code, style, and naming lacks consistency so I always feel like I’m second guessing myself on how something should be done.

Most of these things have improved in recent years, as Mojang has been reworking things on the server side but there is still a long way to go.

aCrumbled
Автор

hyperion actually looks amazing as well. pumpkin is very very nice for just random vanilla servers but hyperion is focused on actual servers and pure performance. it literally is as threaded as it possibly can be. This means that you can simply increase your performance by having a threadripper or something similar. It does not have world gen and some other key features but it can support wayy too many players. I believe it might be 100k or more

griffinmartin