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

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 390

  • @nicolaska1761
    @nicolaska1761 22 дні тому +1391

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

    • @TOZA
      @TOZA 21 день тому +65

      i agree with you, but even if server isnt doing anything and there is single afk player (on java edition; clean

    • @_-_o-o_-_
      @_-_o-o_-_ 21 день тому +329

      My Rust Minecraft server is thousands of times more performant than the official implementation. Sure, it only outputs "Hello, World", but it's a start.

    • @drewgazelka
      @drewgazelka 21 день тому +64

      I am the developer of Hyperion (one of the servers shown in this video), and I absolutely agree with you. I think the big advantage for Rust servers is having minigames/events that do not require a bunch of features but instead a bunch of performance. This is what I am trying to do to break the PvP world record.

    • @Kane0123
      @Kane0123 21 день тому +7

      I still take the same time to build a square mud house...

    • @Aoredon
      @Aoredon 21 день тому

      Who cares? You have to be dumb to not understand that Minecraft would be more efficient and performant in Rust.

  • @montytrollic
    @montytrollic 22 дні тому +866

    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.

    • @bruhrain
      @bruhrain 22 дні тому +19

      I was going to say this, but you beat me to it lol

    • @comradical
      @comradical 21 день тому +45

      I was also going to say that saying "the way lighting works in Minecraft is server-side" is a bit misleading. While there are certainly lighting calculations done server-side, these are necessary for light-level mechanics, Minecraft Client does its own lighting, and yes, this can cause a difference between what server thinks the lighting level is and what client think lighting level is. And abusing this server-side lighting implementation is how we build, or at least used to build, machines to suppress lighting updates, at least prior to some recent versions, to build things that the server thinks are unlit, while we are using portal blocks that technically generate light, that are not covered, so should be affected by day/night, but aren't...
      In fact, server-side light queue is how the most efficient (or boring) generalized mob farms worked: perimeter, remove bedrock, place obsidian at the lowest level, build a roof, build up a massive light update queue, update suppress slice portals in the spawn radius (or usually smaller radius, because it spawns too many mobs to handle), remove the roof, do all that before light update queue catches up, crash the server to clear up light queue. Voila, most efficient mob spawning with near instant mob removal from the overworld. The actual difficult part was to not void the mobs immediately and build a killing and collection system capable of handling the ridiculous amount of mobs coming through.

    • @StephanieHallberg
      @StephanieHallberg 11 днів тому

      we cant BENCHMARK minecraft mods ... as we have NO Minecraft apart from the Java version. We have people adding minecraft-variants blocks in a very very small replica of the very very shell of minecraft. We don't know how anything works in minecraft. its magic, and probably not possible to replicate in rust at all ^.^

    • @bruhrain
      @bruhrain 10 днів тому +5

      @@StephanieHallberg Decompilers exist, you can decompile minecraft which will generate source code from Java Bytecode, although it isn‘t near perfect, you can still get a good understanding of how it works.

    • @__Brandon__
      @__Brandon__ 10 днів тому +1

      @@StephanieHallberg for versions a couple years old we have a pretty good understanding of what is going on

  • @desLunes
    @desLunes 22 дні тому +392

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

    • @rooodis456
      @rooodis456 8 днів тому +3

      I guess my 2.5 year long covid world wasn't actually Minecraft then

    • @a.r.9689
      @a.r.9689 7 днів тому +2

      @@rooodis456 i guess so too

  • @David-gj6dc
    @David-gj6dc 22 дні тому +373

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

    • @zperk13
      @zperk13 21 день тому +15

      exactly! and it's not like it's fancy raytracing or anything that would be very expensive to run

    • @tigerboy4705
      @tigerboy4705 16 днів тому

      ​@zperk13
      I mean, its not raytracing .. but it still rather expensive iirc

    • @DotNetGuy-k9u
      @DotNetGuy-k9u 12 днів тому +10

      @@tigerboy4705 Minecraft lighting is computed via a flood-fill algorithm that propagates from the highest block point, down to the lowest block point unless stopped by an opaque block. This is a very expensive algorithm, hence why Pumpkin's performance is not very impressive considering they don't do this step.

    • @qualia765
      @qualia765 12 днів тому +1

      and plant growth

    • @tigerboy4705
      @tigerboy4705 12 днів тому

      @@DotNetGuy-k9u yeah exactly this! Forgot what exactly they used, tho I have seen some pretty impressive mods that cut down on this

  • @Meiallu
    @Meiallu 22 дні тому +239

    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.

    • @seannewell397
      @seannewell397 21 день тому +6

      idk, that the vanilla client launcher can connect to it is insane imho. Iterating to add features now has a benchmark and floor/ceiling to aim for to be competitive.

    • @Meiallu
      @Meiallu 21 день тому

      @seannewell397, I mean, it’s all done with packets and streams. If you know the data types, structure, and everything, you can do it. Minecraft is the most popular game in the world, and the whole protocol is available at wiki.vg. It’s still pretty impressive-the protocol is a pain, but if done right, it will be faster simply because it’s in Rust. However, I don’t think it’s fair to compare it to other things right now.

    • @tacokoneko
      @tacokoneko 17 днів тому +11

      as a minecraft veteran since 2010 who likes java, bedrock and minetest and is familiar with writing mods in java, data pack, c and c++, theo made a few missteps in this video, for example bedrock's client actually _is_ faster than java on slow embedded systems by a medium amount of frames, and most of the subtle behavior differences could definitely be considered "intentional differences" since in many cases it's difficult to argue that the java version's behavior isn't the "bug" rather than bedrock's, for example the Quasi-connectivity property of redstone in java is not present in bedrock, since in java it was originally an unintended edge case that was left in permanently to avoid breaking existing circuits.

    • @__Brandon__
      @__Brandon__ 10 днів тому

      @@Meiallu writing data to the disk and world Gen can both be done on another thread and aren't apart of the main event loop, I think it's fine. Same with lighting, it can be done on another thread just like it's done in the official server. The real question is will it scale when mobs are added, because all player and mob interactions are single threaded and that is why the official client hogs so many resources. Everything else isn't really that important when comparing servers except maybe redstone, but that's been shown to be fixable if you allow some breaking changes

    • @Meiallu
      @Meiallu 10 днів тому +1

      @Brandon The number of players on the server is crucial, and sometimes even more important than world generation. Even if you offload tasks like world generation, light calculation, and other processes to separate threads, it doesn’t change my point. While it may not lag like a single-threaded vanilla setup, it will still consume a lot of resources unnecessarily. Many people assume that just using Rust solves everything, but that’s not the case.

  • @StefanErwinBaumer
    @StefanErwinBaumer 22 дні тому +85

    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

    • @Kitulous
      @Kitulous 22 дні тому +7

      yeah, it's like I made a programming language that was faster than any other programming language but it was only faster because it didn't have any features.

  • @partykid4
    @partykid4 22 дні тому +251

    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 (Spigot/Paper/Sponge/Forge/Fabric) 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.

    • @juxuanu
      @juxuanu 22 дні тому +11

      One can only hope all community efforts consolidate into one project, and at some point Microsoft starts contributing to it.

    • @callowaysutton
      @callowaysutton 22 дні тому +6

      MC servers haven't been primarily single threaded in years. Spin up a modern Paper instance and you're going to see it eat at 4-10 cores. Also check out MultiPaper which horizontally scales MC

    • @isaac10231
      @isaac10231 22 дні тому +1

      If there's one group of nerds I would not ever doubt it's the capability of Minecraft devs. They've done insane things over the years.

    • @cotneit
      @cotneit 21 день тому +1

      Pretty sure that's not entirely the case because Minecraft had no issues using 100% of my 12700k. World gen (especially modded world gen) is basically a CPU stress test

    • @Varadiio
      @Varadiio 21 день тому +1

      At what point do people just replicate Minecraft's features in a newer engine? Would it be more work to rebuild its systems for multi-threading, or replicate the outward appearance of Minecraft with a language intended for multi-threading?

  • @samuelhulme8347
    @samuelhulme8347 22 дні тому +20

    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.

  • @magical_whale
    @magical_whale 22 дні тому +179

    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.

    • @ThylineTheGay
      @ThylineTheGay 17 днів тому +7

      yeah, even though minecraft's source code is pretty much public, it's a game with so many quirks and niche mechanics/bugs/features, and you'd have to port them all over without breaking things, but while still improving performance
      rust is sure cool, but it's not _magic,_ and i think people do underestimate how well languages like java can perform

    • @GabrielM01
      @GabrielM01 16 днів тому

      if its so hard why does papermc exists?

    • @magical_whale
      @magical_whale 16 днів тому +6

      @@GabrielM01 because papermc is based on spigot, which is based on bukkit, which is based on the vanilla minecraft server. They all try to extend the vanilla server (or improve performance) but they always had the base server already implemented for them

    • @GabrielM01
      @GabrielM01 16 днів тому

      @@magical_whale okay, then why is bukkit ever made? you can fork the vanilla server, they reverse engineered it, just like the rust guys can/will do

    • @magical_whale
      @magical_whale 16 днів тому +5

      @@GabrielM01 im not 100% on the mc server history, but bukkit (CraftBukkit) was made for more optimization and running bukkit plugins by decompiling the vanilla server, injecting their own code and recompiling it again. Allowing for more customization.
      The rust guys cant just take the vanilla server and build upon that, because a vanilla minecraft server in rust simply does not exist
      Bukkit had the ability to build upon the vanilla server, the rust guys cant

  • @larko2933
    @larko2933 21 день тому +13

    I mean there is literally nothing happening, no light calculation, no chunk generation, no chunk saving etc.. The benchmarks mean nothing and using pumpkin as a reference point for rust based implementation is kinda disrespectful for other implementations that actually got farther ahead..

  • @Adowrath
    @Adowrath 18 днів тому +7

    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).

  • @andrewgazelka
    @andrewgazelka 21 день тому +9

    I am the developer of Hyperion. Thank you for showing my hard work :)

  • @Ratstail91
    @Ratstail91 22 дні тому +72

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

    • @xgui4-studios
      @xgui4-studios 22 дні тому +12

      true, it isnt the fault of java

    • @Kane0123
      @Kane0123 21 день тому +5

      Java was the bottleneck preventing me from building stylish designs... right?

    • @wrongthinker843
      @wrongthinker843 21 день тому +3

      Why not both.

    • @NetherFortress-vl5fo
      @NetherFortress-vl5fo 19 днів тому

      In future I think they might switch

    • @Ralzone
      @Ralzone 17 днів тому +7

      @@NetherFortress-vl5fo They did, it's called bedrock version lol

  • @untitledgoose5526
    @untitledgoose5526 22 дні тому +134

    another buggy minecraft version on the way

    • @gorak9000
      @gorak9000 22 дні тому +6

      It's like standards? The greatest thing is how many there are?

    • @panzerofthelake4460
      @panzerofthelake4460 22 дні тому +2

      if Bemis - > Benis
      then
      then Pemis - > ???

    • @jonnyso1
      @jonnyso1 22 дні тому +3

      Considering its Rust, likely its another slightly less buggy minecraft version.

    • @white_145
      @white_145 21 день тому +6

      C++ version of minecraft is that way because of negligence. There are countless of problems that are so stupidly easy to fix and yet devs brush it off because "its happening 65k blocks away from spawn so no mobile player would go there". Pretty sure even with a small team *complete* version of the game will be easy to keep bugless

  • @BryanLu0
    @BryanLu0 22 дні тому +18

    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

    • @BryanLu0
      @BryanLu0 22 дні тому +3

      11:29 ??? Even if the server code wasn't well understood, redstone and command blocks are very well understood

    • @Kitulous
      @Kitulous 22 дні тому

      why obfuscate the code at all if you're going to release deobfuscation maps anyways?

    • @BryanLu0
      @BryanLu0 22 дні тому +4

      @@Kitulous It's standard practice, and reduces the file size.

    • @BryanLu0
      @BryanLu0 21 день тому

      @Testvvjnb-ci3zl I would think that Mojang tries to optimize their code the best they can

    • @nnnik3595
      @nnnik3595 10 днів тому

      @@BryanLu0 No they aren't we still discover new features in pistons and hoppers for example.
      2No2Name took 2 years to make optimized hopper mechanics in the lithium mod and it's 100k LoC iirc

  • @icxd8665
    @icxd8665 21 день тому +5

    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.

  • @bjoern_eberhardt
    @bjoern_eberhardt 13 днів тому +4

    I did rewrite an entire Minecraft client to Golang to make it faster. Especially it only consumed 10-20MB memory with 10MB binary size and 0.1-1% CPU. It wasn't 100% compatible with the packet formats, but mostly, so I had to ignore some packets. It was a great learning exercise.

    • @xusdom
      @xusdom 9 хвилин тому

      Hi. Nice idea. I thought about something like this. Is it hosted "somewhere"?

  • @rokasbarasa1
    @rokasbarasa1 22 дні тому +57

    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.

    • @skellious
      @skellious 22 дні тому +15

      Gotta make your redstone computer faster. Can't speed up the Redstone? Rewrite the universe!!

    • @Wilker_uwu
      @Wilker_uwu 17 днів тому +1

      i legit want a protocol-compatible free/open-source clone of the game, with artwork that isn't tied to Mojang, and every kind of stuff that it deserves to match with the mechanics of the original

  • @Krzysiekoy
    @Krzysiekoy 22 дні тому +14

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

    • @Varadiio
      @Varadiio 21 день тому

      I think it's also just the state being updated (simplistic py mockup below):
      # Some function would measure distance from light source in blocks and if

    • @nnnik3595
      @nnnik3595 10 днів тому +1

      @@Varadiio They do raycasts for most of the physics now but other than that it's a flood fill algorythm.

  • @zisumevoli96
    @zisumevoli96 11 днів тому +1

    A+ for content, i pray to the gaming gods we never have to deal with rusty games

  • @DearFox
    @DearFox 16 днів тому +2

    Alas, all these projects do not implement even 1% of the entire functionality of the vanilla server core. I would like someone to prove the opposite, but alas. I've tried quite a few similar projects. And usually their fate is the same: they are either abandoned, or they are libraries for creating servers where the vanilla behavior of the game does not make sense.
    What can I say, my boyfriend made a basic implementation of the minecraft protocol for fun using godot and gdscript. Yes, it only implemented displaying the server in the list of servers, but it was a kind of project for fun.

  • @andrewk2756
    @andrewk2756 22 дні тому +17

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

    • @belliel42
      @belliel42 22 дні тому +8

      100 = 1 core

    • @andrewk2756
      @andrewk2756 22 дні тому +2

      @@belliel42 okay, didn't know that, looks weird to me.

    • @KongStrongBoss
      @KongStrongBoss 13 днів тому +1

      @@andrewk2756 yeah macOS is weird

  • @aCrumbled
    @aCrumbled 16 днів тому +2

    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.

  • @blyxyas
    @blyxyas 12 днів тому +14

    0:30 Bedrock does indeed have much better performance, the main problem is that there are features that are not the same :/ But the performance increase is there, and is very noticeable

    • @Nekroido
      @Nekroido 10 днів тому

      I have 200+ fps vs 100ish, Bedrock vs Java Edition on my 7yr old laptop. The difference is very noticeable indeed

    • @nnnik3595
      @nnnik3595 10 днів тому

      Yeah but that is because those are 2 different games. Redstone isnt even remotely similar

    • @WolfiiDog13
      @WolfiiDog13 3 дні тому

      Used to be very noticeable, but ever since they changed to the Render Dragon engine, not only it got a lot more laggy, but it got a lot more buggy. It's a mess, and even though I like Bedrock, there's no doubt Java is a lot better

    • @nnnik3595
      @nnnik3595 3 дні тому

      @WolfiiDog13 RenderDragon is a engine that's multiple times better than Blaze3d according to modders

    • @WolfiiDog13
      @WolfiiDog13 3 дні тому

      @@nnnik3595 all I know is that the game feels a lot worse after the update that brought it

  • @HyperCodec
    @HyperCodec 9 днів тому +1

    The Minecraft in Minecraft thing is even more impressive when you realize they didn’t use a single command block to accomplish it

  • @Henry-sv3wv
    @Henry-sv3wv 8 днів тому +3

    >Making Minecraft 100x faster
    nobody cares if you don't port all mod packs to rust

  • @rasyasejati
    @rasyasejati 19 хвилин тому

    16:30 LMAOO EXACTLY, impressive it's gotten this far but annoying when you're looking for plugins
    minecraft mods and things are in the state of renaissance this past few years, and i love it, from graphic performance like sodium, and server side like pumpkin, im impressed with the community

  • @SammyForReal
    @SammyForReal 22 дні тому +22

    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.

    • @craemonmc
      @craemonmc 21 день тому +2

      You are right though I believe that you can and should improve your vanilla server with fabric for example! And for Minestom specifically: They state on their Github readme, that it isn't made to replace vanilla based servers but used "when it takes less time to implement every missing vanilla feature you want than removing every vanilla feature that will slow you down." So basically, as you said, for minigames and such (which there are already small, fully playable Minigame servers based on Minestom btw).

    • @SammyForReal
      @SammyForReal 21 день тому +4

      @@craemonmc Oh right, I should've specified that fabric servers are one of the best options too ^^
      All vanilla features plus performance improvements through mods (and of course modded features as well).

    • @craemonmc
      @craemonmc 21 день тому +1

      @@SammyForReal Vanilla macht im Vergleich zu Fabric sogar eigentlich gar keinen Sinn(jetzt so aus meiner Erfahrung mit diversen SMPs).

    • @Varadiio
      @Varadiio 21 день тому +1

      Yea the missing features I understand take time and effort. The mission statements are what turn me away. I've played enough complete overhauls of various games that break other mod functionality, and nearly every time I wish for one little thing or another. I wouldn't play it due to what it breaks with no willingness to change.

    • @najawin8348
      @najawin8348 21 день тому +1

      If you wanted to code this _specifically_ for neoforge or like a decent sized modpack with a dedicated fanbase (eg: GTNH), that _could_ work? But it would require working with the devs from the beginning of the project. But the GTNH devs, for instance, are absolute wizards, and this seems superfluous to what they're doing. And neoforge would be a massive, massive undertaking, as it would basically involve you inventing an entire new standard for server side mods / decently modifying an existing one.

  • @BryanLu0
    @BryanLu0 22 дні тому +6

    The server basically runs all the game logic, so it's not surprising that main game mechanics like lighting would be server side. 6:25

    • @sirdespin
      @sirdespin 22 дні тому +2

      Specially when lightning determines what mobs spawn

  • @BrittonWinterrose
    @BrittonWinterrose 20 днів тому +6

    Dude, thank you for making this video. Buddy is going to love it. He loves anything Minecraft.
    he’s going to remember all these facts and take them to school to make friends because all the kids talk about is Minecraft.
    it’s the digital LEGO; parents see it as engineering expression. Kids love it because it’s a canvas of expression.
    But he’s also going to learn lighting is hard, and that he will appreciate that kind of stuff in video games. He’s going to want to dive deeper in computer science and build his own server. And the friends he makes with the things he’s learned… they’ll be smart friends.
    vids like these activate his interests x intelligence x desire to succeed socially all at the same time.
    and the red stone video idea sounds like a good one too

  • @shad3ious
    @shad3ious 11 днів тому

    When you launch minecraft and play as a single player, the session is loaded up as a standalone game, mechanics that are replicated can still work on singleplay worlds. However, when you initiate the LAN settings in the pause menu. It reloads the world into a listen server. Making the main player the host and all other players a client. With the multiplayer instance of minecraft. It stands up a dedicated server. Making a session beacon for people to join. Making all players a client.

    • @lxdixd
      @lxdixd 8 днів тому +2

      Since 2012 singleplayer has also been hosted on a listen server

  • @xypheli
    @xypheli 11 днів тому

    Considering the projects you showed, I'm kinda proud to be a human rn, but also kinda humiliated that I most certainly will never in a thousnad years be able to achive something as genious as this.

  • @Nekroido
    @Nekroido 10 днів тому

    Only Theo can shove us a tutorial voxel game under the " killer written in Rust" sauce. Come on brother

  • @zekiz774
    @zekiz774 3 дні тому

    6:10 The lightling thing is very obvious when you consider that there are events like mob spawing are being influenced by the light level of the block. So the light calculation essentially has to be done on the server.

  • @StreetSurfersAlex
    @StreetSurfersAlex 21 день тому +10

    This is not comparable to real minecraft. Yours is missing critical features which would affect your comparison

    • @chaws314
      @chaws314 21 день тому +8

      yup. Lighting updates, Redstone, and Mob AI are the main killers of perf in every MC server I have run. Chunk generation is also a big perf killer, but most servers progenerate chunks.

  • @fx-modding
    @fx-modding 17 днів тому +3

    I've seen much faster versions written in Java. The second that you implement all the features required, rust isn't actually faster.

  • @salvehn
    @salvehn 22 дні тому +3

    for me it was Garry's mod with wiremod and Expression 2 programming language. definetly wouldn't become dev if didn't play them during school
    it was slow as well. can't wait for S&Box to add proper sandbox mode with similar stuff

  • @Kaptime
    @Kaptime 12 днів тому

    There is significant crossover between minecraft server hosting kids and twitch employees. One of the guys from my highschool computing class has worked at twitch pretty much since he left highshcool.

  • @ray73864
    @ray73864 22 дні тому +24

    Why would you think that the light should not be calculated on the server when playing server side? The server needs to know where to spawn mobs, etc...
    Also, I don't know about the server side, but Mojang has been releasing an obfuscation map for Minecraft for about a decade now at least.

    • @jonnyso1
      @jonnyso1 22 дні тому

      Ask the client to send current state to the server to figure out where to spawn mobs ? Something like that. I have no idea how any of that works but calculating light on the serve would not be my first attempt at it.

    • @the_cheese_cultist
      @the_cheese_cultist 22 дні тому +4

      ​@@jonnyso1 and how would you handle multiple clients?
      the server decides how to spawn mobs, so the server needs to make all relevant calculations for mob spawning, lighting included.

    • @jonnyso1
      @jonnyso1 22 дні тому

      ​@@the_cheese_cultist Why would that be a problem for multiple clients ? The server tells where a mob should spawn, the client can handle the rest. I'm actually really curious why they didn't do it like that in the first place.

    • @jonnyso1
      @jonnyso1 22 дні тому

      @@the_cheese_cultist Yeah, and the client can send that information to the server so the server doesn't need to calculate lighting itself, it would only need to figure out where to spawn a mob based on the information clients provide.

    • @the_cheese_cultist
      @the_cheese_cultist 22 дні тому +3

      @@jonnyso1 and the server needs to know where the mob spawned. so it has to have the lighting data.

  • @NubeBuster
    @NubeBuster 21 день тому

    I was working on a world generator and decided to profile the jvm to see what is making my generator take 8ms per chunk. I found that 6 or 7 ms was for light updates. I looked further into it and found a bug causing paper async lighting to submit hundreds of thousands of runnables to an executor service which was taking 80% of the cpu. I fixed that issue and now it's faster.
    This is in 1.8 though, so probably was already fixed in the newer versions.
    But the main takeaway is that lighting and chunk generation are the reason you see the 20x in cpu. I think you will probably get at best a 10x after these are implemented efficiently.

  • @pigeonprotagonist6357
    @pigeonprotagonist6357 22 дні тому +9

    World border has been added in the time it took to release this video

    • @klausburgersten
      @klausburgersten 21 день тому

      why world border is even a thing
      if a man wants to go to x minus one billion let the man go to the x minus one billion

  • @TopazTK
    @TopazTK 9 днів тому

    Hey, Minecraft has been my start in the development journey as well. If it wasn't for the mods I made for MC, I would not have stepped in KH.

  • @CrazyWinner357
    @CrazyWinner357 9 днів тому

    Rust devs rewriting something for worse and claiming its faster volume 199....

  • @codeChuck
    @codeChuck 22 дні тому

    You became a dev because you wanted to! I only played a little in this game and never hosted it :)
    I only watched some youtubers that played in team and created a world together, which was fun stream!

  • @milutinke
    @milutinke 12 днів тому

    As someone who is a maintainer of an open-source 3rd party headless Minecraft client, making a server is way harder than making a client, despite having all the protocol specs available. (If you're wondering, it's Minecraft Console Client).

  • @sky0kast0
    @sky0kast0 8 днів тому

    I certainly hope this pumpkin becomes a wagon and we can go to the ball.

  • @codeChuck
    @codeChuck 22 дні тому

    You are so smart! I could not even imagine how to host it :)

  • @infernoplayzgames1684
    @infernoplayzgames1684 17 днів тому

    I for one am excited for these new servers. The only issue is that I typically play modded MC more than I actually play Vanilla mc so I'll be waiting until an modded open source server becomes available.

  • @happieplantnl
    @happieplantnl 22 дні тому

    This video was so interesting, please release more nerdy technical minecraft stuff :)

  • @infinitivez
    @infinitivez 22 дні тому +2

    I need a server that can translate java opcode to whatever server code they're using or even an LUA intermediary layer, or some standardized concept that isn't going to fallout each time a new server project comes into being. Vanilla is all well and good, but I dare say, the people who really commit to keeping Minecraft alive, play modded.
    Now if we can refactor the client into Rust... We be cooking!

    • @Kitulous
      @Kitulous 22 дні тому +1

      rewrite jvm in rust

    • @infinitivez
      @infinitivez 21 день тому +1

      @@Kitulous You know what, I wonder just how viable an idea that might be.

    • @anhware
      @anhware 3 дні тому

      ​@@Kitulouswhat do you mean by that lol. Java and the JVM is already written in C????

  • @NighttimeJuneau
    @NighttimeJuneau 12 днів тому

    From my experience profiling a Fabric server, the heaviest parts besides world generation is entity and block ticking and the spawn system. A server that only has to run an immutable world, no block placement, updates, breaking, no entities, no spawns, no pathfinding and mob AI, yup, I bet it's gonna run smoothly. More seriously, mod support is the beating heart of Minecraft. Trying to establish a whole new platform that *all* mods would have to be rewritten for *in Rust*, yeah.
    Funny that Sammyuri's Minecraft in Minecraft project actually has more features right now.

    • @teakivy
      @teakivy 9 днів тому

      It is difficult to establish a new standard, but definitely possible! Fabric itself is relatively new, and yet now it’s arguably more popular than forge. Granted it is a lot easier to port an existing mod to fabric than it would be to port it to rust

  • @someguystudios23
    @someguystudios23 8 днів тому +1

    No plugins makes sense (takes a lot of work) but no derivatives?? You're right in saying that would be a deal breaker for many. They may as well just not even provide a download at that point.

  • @tsoruu
    @tsoruu 8 днів тому

    For minecraft, I just wish a single unified type of plugins/mods type (Paper's plugins, Forge's mods, etc) so plugin/mod devs could focus on their feature and optimization rather than implementing it in various ways.

  • @ramsey2155
    @ramsey2155 22 дні тому +2

    Now i can host a minecraft server on a cloudflare worker

  • @iEnis_
    @iEnis_ 7 днів тому +1

    the only thing missing now is someone needs to rewrite the client

  • @btarg1
    @btarg1 10 днів тому +1

    This is going to become a major meme in the MC Modding community I can just feel it
    Check out Folia if you want a fast server btw

  • @trustytrojan
    @trustytrojan 21 день тому +1

    the BIGGEST DOWNSIDE is lack of modding. i wont move over to any-other-language-rewrite unless mods/modloaders will work

  • @alskidan
    @alskidan 22 дні тому +1

    TBH when you don’t implement even a half of the features, it would be a shame to be on par or slower 😂

  • @evan_ry
    @evan_ry 22 дні тому

    Finally minecraft videos on Theo's channel!

  • @DearFox
    @DearFox 16 днів тому

    I'm looking forward to someone making a minecraft server implementation in assembler

  • @haable
    @haable 20 днів тому +1

    Not sure if ya talked about it in this video (I'm literally writing this after seeing like the first few minutes and the thumbnail) but there's this thing called MCHPRS (I think) which is a rewrite of the MC server in Rust for redstoners. MC High-Performance Redstone Server!

  • @debugger4693
    @debugger4693 21 день тому +1

    Lighting has to be server side because it affects gameplay, not only cosmetics.

  • @zack8247
    @zack8247 22 дні тому

    this is great, thanks for covering it theo

  • @LennoxDev
    @LennoxDev 11 днів тому

    There is no need in reverse-engineering minecraft since they provide their obfuscation mappings since years now. The only real challenging part in remaking the minecraft server software is the amount of game logic you have to reimplement that had been added over the years - without basing it on inefficient models. Minecraft itself just shares server and client code to almost 99% so there is no effort for them implementing the server-part.

  • @dragons_advocate
    @dragons_advocate 21 день тому +1

    To be fair: How little resources would an implementation in Java cost, if rewritten from scratch with the same feature set? I have the feeling all the "not done yet" parts are doing a lot of heavy lifting in this comparision; -- Making it entirely moot, except to score brownie points for Rust.

  • @maritaria
    @maritaria 16 днів тому

    I wish that for lighting they would set it globally to max instead of 0, while still not accurate at least you could see things.

  • @milk-dog
    @milk-dog 22 дні тому +2

    While these are cool for monogame server hosts to get more concurrent players, I don't ever see these being viable on large smps because of their own custom chunk generation. You basically have to pre generate the world as far as you want, which can take a lot of storage. Bedrock custom server software has the same problem.

    • @timespeed1580
      @timespeed1580 21 день тому

      I work with ferrumC, but I also know the pumpkin Devs, they have a branch working on live terrain generation atm

  • @griffinmartin6356
    @griffinmartin6356 17 днів тому

    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

    • @dan2800
      @dan2800 13 днів тому

      100k is way too much at that point you will have bottlenecks elsewhere like in networking or clients themselves

    • @griffinmartin6356
      @griffinmartin6356 12 днів тому

      ​ @dan2800 it is designed for large server events. You can easily buy a server that has even a 10 gigabit connection to support all that.
      one player usually uses about less than one megabit of connection. say they use one megabit that times 100k is 100k megabits or 100 gigabit. That certainly is a problem however its still possible. On top of that its assuming that every single player is constantly using that connection..

  • @TheDuzx
    @TheDuzx 8 днів тому

    Considering the community effort I think it's insane that Microsoft/Mojang hasn't just done it by now.

    • @309electronics5
      @309electronics5 2 дні тому

      It would take them a long time just like updates /s

  • @Jakobg1215
    @Jakobg1215 21 день тому +1

    Minecraft Java has deofiscation maps since around 1.14, so you have the entire source code but without comments or other stuff.

  • @NorthLaker
    @NorthLaker 7 днів тому

    Using Java is what makes modded Minecraft possible. And the mod space is *HUGE*! So any server that is programmed in such a way that it runs much faster will almost inherently be incompatible with all those mods. Hell, it's most likely the reason Mojang are so slow with updates in general, because they want to keep the mod space alive and not hinder them by constantly changing the entire codebase.

  • @4nyNoob
    @4nyNoob 22 дні тому +1

    as a professional minecraft player i would like to host my fabric world without slowdowns on my r9 5900x, it's almost embarassing to have lag on that CPU

  • @sad_man_no_talent
    @sad_man_no_talent 21 день тому +3

    100x performance but I got immediately turned off after no mod

    • @nnnik3595
      @nnnik3595 10 днів тому

      No Rust server will ever allow java mods.

  • @MerkieAE
    @MerkieAE 21 день тому

    Minecraft is my favorite open source project

  • @bonk1463
    @bonk1463 21 день тому

    Minecraft is so reverse engineered that I've actually built a few servers in completely raw NodeJS and Typescript. The Minecraft community is incredible in terms of coding.

  • @Pocketkid2
    @Pocketkid2 21 день тому

    I used to care about custom clients and servers, but then I started playing massive modpacks which can't easily be ported to these custom clients and servers...

    • @tux_the_astronaut
      @tux_the_astronaut 21 день тому

      Yeah id be nice tho if they would ever support mods cuz modded servers desperately need this

  • @Sekwah
    @Sekwah 11 днів тому

    While I tend to respect and enjoy your videos usually, I personally think this was a bad video. This would be like comparing two cars where one has the wheels missing and comparing them solely how fast the spedomiter says it gets to 60. Core components are missing so it is not a fair comparison in the slightest.
    Im glad you covered this project as its incredibly impressive though you talk about a lot of items with confidence but clearly do not know the first thing about which makes me personally question what I've trusted listening to your other videos. (Granted its been on projects I wouldn't touch vs were just interested in)
    While you are using sources a lot of the info you seem to personally add or interpretations are flawed or just seem unfair.
    This isn't to downplay the efforts of what these guys are doing as there is a LOT of work however here just a few of the issues for example with your video:
    * You explain how people have been reverse engineering the game like java decompilers haven't been a thing for almost the entirety of modding. Its possibly why one of the reasons modding exploded so drastically in the first place in mc as well as mojang even provide mappings nowadays to help tools decompile the game to near original source code.
    * You bashed minecraft's stability where the launcher. The issue it had was downloading a file which likely was a network issue, here you are comparing cargo to the launcher rather than the rust implementation of the server.
    * You bash minecrafts lighting being server side but don't seem to realise why it has to be done that way.
    Realistically for a project like this the best way to compare these would be to stress test and like for like for each feature that is fully implemented, though I understand you are not the one who ran or made the benchmarks.

  • @kdborg
    @kdborg 21 день тому

    Now they need to run Minecraft inside Minecraft inside Minecraft.

  • @RuleYourOwnGame
    @RuleYourOwnGame 11 годин тому

    This is not feasible from a development perspective. This can be useful for things like lobby servers, however those are already lightweight and not exactly worth optimizing. Having to trust one person (or, maybe a small team) to rewrite (more like remake) the entirety of the Minecraft Server isn't exactly a good idea considering the fact that there are so many things that play into just vanilla minecraft by itself. There aren't many use cases for these rewritten server software, let alone anything that *isn't* based off of Mojang's Minecraft server.

  • @BellCube
    @BellCube 17 днів тому +2

    A lot of comments are talking about how the server doesn't implement saving, lighting, or chunkgen, but the memory usage alone is a great indicator of progress. Minecraft has been regularly beaten by community mods also written in Java, so I don't doubt this project can be significantky faster once those features are added.

    • @SteffenF
      @SteffenF 17 днів тому +4

      i am sorry to say but this server is less then bare bones. this server does not even implement stuff thats written on the page it does. like other games minecraft client calculates and shows results to the player, sends the event and results to the server. server calculates events and says noooo. you can see that sometimes you break a block and it pops back into its place. because server says nooooooooooooo. pumpkin does not have block events, tile entities, entities, redstone, .....
      you are comparing an child to an adult, not seeing the fact that the sperm didn't even reach the egg.
      comparing the memory usage of doing nothing against a giant piece of software...?

    • @BellCube
      @BellCube 17 днів тому

      @SteffenF Oh? Dang, video misrepresented this massively then.

    • @SteffenF
      @SteffenF 17 днів тому +1

      @@BellCube sad to say this, but it happens really often. there are a lot of "mincraft clones" out there and a lot of "servers" that do less then the bare minimum. for example just rendeing the world static and proudly anounce how much fps they get. but if you start scraping just the surface you see the void.
      all functional servers are written in java... because they only extend the original server.
      and yes minecraft server is single thread because it gets stupid complex to interact with the world state in multithreadding.
      pumpkin does not even have simple block events. as far as i could see no logic server side for battle - therefore cheating.
      i did not test that thing but the amount of code is a sad excuse, and as far as i could see no magic happening there. i have not read every single line but yeah no... no logic serverside what when to do.

    • @BellCube
      @BellCube 17 днів тому +1

      @@SteffenF Doesn't shock me that it's common. Especially since the official MC server _is_ quite inefficient and has a lot of room to go.
      BTW-you may be interested in Purpur, a multithreaded Paper server that splits the load based on region files. Stable enough that 2b2t uses (or at least used) it in prod since they broke out of 1.12.

    • @SteffenF
      @SteffenF 17 днів тому

      @@BellCube this might work relatively well for vanilla only. i would want to stresstest this thing before saying something about that but if redstone is between regions.. how good is the handling of that? i personally only play heavy modded stuff. most of the time skyblock. therefore i guess i'm stuck with java 😁. i hate the bedrock edition with passion. redstone is so wired down there 😤 and noooo real mods 💀

  • @rudrecciah
    @rudrecciah 22 дні тому +1

    16:50 THATS OOMF 🔥🔥🔥🔥

    • @rudrecciah
      @rudrecciah 22 дні тому

      oh wait their site shows up earlier too 3:15 THATS OOMF 🔥🔥🔥🔥

  • @realmodpotato
    @realmodpotato 21 день тому

    theres been a ton over the years, namely valence and cuberite

  • @Michael-oc8ly
    @Michael-oc8ly 22 дні тому

    just more minecraft tech stuff please

  • @Rubberduckerino
    @Rubberduckerino 13 днів тому

    at this point minecraft should make their server code open source

  • @thoughtsuponatime847
    @thoughtsuponatime847 20 днів тому

    I refuse to play minecraft again until I can see the horizon. You need to be able to see the worlds people make. Loading more chunks is not the answer.

    • @MrMoon-hy6pn
      @MrMoon-hy6pn 11 днів тому +1

      Use a fabric client with sodium mod along with bobby or distant horizons for greater view distances?

  • @pikazap6672
    @pikazap6672 4 дні тому

    letsgo, minecraft in rust before gta6!

  • @MrEnder0001
    @MrEnder0001 11 днів тому +1

    "isint better performance wise"
    I love it when java can do 96 chunks min 30fps and 64 chunks min 60 fps on a 4070...

  • @sebastianramirez5781
    @sebastianramirez5781 11 днів тому +1

    what about bedrock do you think isn't as good as java for performance? tbh to me it runs A LOT better on my machine than java, I love the java version more because I grew up with it andI just prefer the java implementation on everything that works differently for the two versions, but you get so much higher render distance and FPS in bedrock in my experience.

    • @nnnik3595
      @nnnik3595 9 днів тому

      There is a few things which are poorly implement on bedrock - e.g. a lot of redstone actually performas worse once you run a decent amount of redstone.
      Also fps isn't remotely relevant - we are talking about the server

  • @MZZenyl
    @MZZenyl 18 днів тому +1

    6:33 Calling it "reverse engineered" is kinda inaccurate. The game's source code has largely been known for ages, as the game can be decompiled back to something that mostly resembles the input. One of the issues is that the game's code is obfuscated, however projects like MCP have done a lot of work to come up with good approximations of the original unobfuscated source code.
    For the most part, it is more just reading through semi-obfuscated code and trying to recreate it, rather than meticulously analyzing and recreating network packets (which is kinda the case for old Minecraft Classic versions, as deobfuscation of these mostly isn't a thing anyone has bothered doing).

    • @nnnik3595
      @nnnik3595 9 днів тому

      Also Mojang releases official deobfuscation maps now.

  • @chadjaax
    @chadjaax 21 день тому

    Imagine these juicy good performance was with clean code implementation that proved to make your program X times slower and the rewrite is to get rid of it.

    • @nnnik3595
      @nnnik3595 10 днів тому +1

      Lithium (an optimization mod) gets rid of a ton of clean code (Streams) in favour of more classical iterators for 20% of it's performance improvements.

    • @chadjaax
      @chadjaax 9 днів тому

      @@nnnik3595 Cool, so what I guessed is true.

    • @nnnik3595
      @nnnik3595 9 днів тому

      ​@@chadjaaxpartially.
      When I was the server admin of a larger tmc server we build a tree farm. It was really laggy.
      A tree farm creates mans moving blocks or so called b36s (Block 36).
      These blocks are placed by the engine to handle the animation of the movement. After the movement is done the movement is done they place down the actual block that moved.
      In order to handle blocks that do stuff Minecraft maintains a list of "ticking blocks" that do things every ingame tick.
      So in our tree farm we would add a ton of these b36s to a list and then iterate over them and during iteration remove them one by one.
      In our profiler this single ArrayList.remove took up 90% of the performance.
      When removing entries from an ArrayList all entries added after the entry you added needs to be shifted forward. And that happened for every b36 after it finished moving - simply put the big O of the list types remove operation messed everything up.
      LinkedLists made the game overall 20% slower but would fix this extreme case. A HashSet would mess up all of Minecraft's redstone since things aren't ordered anymore.
      The devs of Lithium (a performance mod) took 2 weeks to write a custom ordered collection for this specific problem.
      Mojang itself also added a different (but a slightly slower one than this) in their next update.
      Issues like this is where a lot of the servers performance goes bad.

    • @nnnik3595
      @nnnik3595 8 днів тому +1

      @@chadjaax It never shared my other reply but no - the remaining other 80% are from adjustments in the chosen datatypes or stuff like that.

  • @SkylerLinux
    @SkylerLinux 22 дні тому

    I remember when modded MC went from SP and MP to just mods

  • @foxxxy4963
    @foxxxy4963 19 днів тому

    Microsoft:
    wow thats a lotta code
    too bad im not readin em

  • @CatMeowMeow
    @CatMeowMeow 17 днів тому

    It's pretty cool, but also not new. I've seen Minecraft server implementation running on a Arduino. It was limited but it worked. Once it has (accurate) world gen I'll call it a breakthrough

  • @primefactors888
    @primefactors888 21 день тому

    i have a ram usage OCD, i think ,
    i have found my language
    i have found my people
    here i come rust

  • @nevork7578
    @nevork7578 21 день тому

    If Minecraft is written not in the goat language Java, then it is not a Minecraft

  • @abhemanyusarin8023
    @abhemanyusarin8023 15 днів тому

    The answer is not more Minecraft, but Minetest

  • @RedCrafter07
    @RedCrafter07 22 дні тому

    I'd love to see mod compatibility though, even though it would be extremely difficult...

    • @nnnik3595
      @nnnik3595 9 днів тому

      Not extremly ddifficult - Just unlikely for example I think it's more likely that our planet gets swallowed up by a black ghole tomorrow than there ever being mod support in those rewrites.

  • @artrix909
    @artrix909 21 день тому +1

    you forgot to link pumpkin in the description!

  • @Blackilykat
    @Blackilykat 16 днів тому

    For playing with few friends, preformance is really only an issue when on free server hosts (like aternos or minehut)
    Most (if not all) big servers will need to be able to mod the server
    I don't think there's much of a use case for this. Also it barely does anything right now and it's way too incomplete to compare to vanilla
    Also, it didn't compare with vanilla + optimization mods. Not too familiar with how much improvement there is on the server side, but I know they exist.
    And launch args are *really* common in minecraft servers to optimize gc. Which I don't think the benchmarks mentioned either?

  • @Azoraqua
    @Azoraqua 17 днів тому

    I don't want to bring it down, but truth be told:
    If it doesn't do much, nor allows for easy extension itself, what is it even worth? I mean, its resource utilisation is nice, but it's still unplayable in the grand scheme of things.