Slashdot Mirror


Microsoft Open Sources Parts of Minecraft's Java Code (kotaku.com.au)

Four years after Microsoft acquired Minecraft developer Mojang, the company has decided to open source some of Minecraft's Java code. According to Kotaku, Microsoft and Mojang released two parts of Minecraft's Java code in library form, so that "anyone can pick them up and use them in their own game," says Lead Engineer Nathan Adams. From the report: For now, there's just the two libraries: "Brigadier," a "command parser and dispatcher"; and "DataFixerUpper," designed for "incremental building, merging and optimization of data transformations ... [to convert] the game data for Minecraft: Java Edition between different versions of the game." While the news doesn't mean much for players, it will be a boon for interested programmers and developers, keen to see the guts of Minecraft. The plan is to open source more components in the future, though no time frame is specified. For now, if you want to check out Brigadier or DataFixerUpper, both can be found on Mojang's GitHub page.

41 of 79 comments (clear)

  1. Remember the promise to open the whole thing? by drinkypoo · · Score: 4, Interesting
    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    1. Re:Remember the promise to open the whole thing? by Anubis+IV · · Score: 4, Informative

      Have sales died? Last I heard, it was still going strong.

    2. Re:Remember the promise to open the whole thing? by JediJorgie · · Score: 1

      How about we get back to your snarky ass when "sales start dying"?

      They just announced that Minecraft now has 70M+ active players each week. If releasing the code was 100% based on Notch's statment, they would not even have released what they just did.

    3. Re:Remember the promise to open the whole thing? by Not-a-Neg · · Score: 1

      The "Super Duper 4K" upgrade that was announced nearly 2 years ago (okay, a year and a half) has been delayed repeatedly. Microsoft is attempting to keep people interested in the game while they continue to delay the only thing worth a damn that Minecraft fans are waiting for.

      --
      -==- Buy a Mac and leave me alone!
    4. Re:Remember the promise to open the whole thing? by drinkypoo · · Score: 1

      How about we get back to your snarky ass when "sales start dying"?

      Son, you have missed the whole point. And there was even already a response along the same lines, which was also rebuffed, which you also missed. Maybe this whole internets thing is not your bag.

      Notch gave up control to Microsoft instead of giving it up to the users. That means he can never fulfill his promise. That means it was bait and switch. HTH, HAND.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  2. Re:I'd love to see by drinkypoo · · Score: 2

    I'd love to see the whole thing released, then better graphics produced so it everyone uses that instead of the crappy MS version.

    You can already have better graphics. Even without modding you can change out the shaders, for example, and the textures.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  3. Recently started modded play with Stoneblock by Maxo-Texas · · Score: 2

    Minecraft sees so primitive and shallow compared to modded Minecraft.

    They should really back up a truck full of money to the mod community and get some of that code added to the main code base.

    The glacial pace of current development is stunting the game.

    There is a rich deep world of play out there in the modded community.

    --
    She was like chocolate when she drank... semi-sweet at first and then increasingly bitter.
    1. Re:Recently started modded play with Stoneblock by Maxo-Texas · · Score: 1

      Yup.

      And it's just so boring.

      You can beat the game in a week tops.

      Minecraft says, "40 new slabs, walls and stairs!" Meanwhile, I just found in modded minecraft there are *hundreds* of new slabs, walls and stairs. Heck, cobble stone alone has about 30 different textures you can chisel it too.

      And there's an upgrade path which takes more than a few days to max out.

      And lots of new tools/tinker toys to puzzle over.

      I've played the game for 7 years. I think it's just too simplistic and the pace of development is too slow. By 2 years in, I was chafing at the constraints. In my own game/servers I was doing custom command blocks to implement longer leveling/upgrade paths and new functionality.

      Minecraft could and should have the functionality of tinker's construct by now. It's a billion dollar product. The team is too small.

      I honestly don't see how I could go back to vanilla minecraft at this point.

      --
      She was like chocolate when she drank... semi-sweet at first and then increasingly bitter.
  4. It's java...why not decompile? by twdorris · · Score: 1

    Isn't Java practically open source by design? What has kept the unwashed masses from decompiling already?

    1. Re:It's java...why not decompile? by jeremyp · · Score: 2

      Last time I tried to decompile it, it turned out the code was obfuscated. You can decompile it, but that's the easy part.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    2. Re: It's java...why not decompile? by spongman · · Score: 1

      Decomposing Java is as easy as downloading Mcp and running a batch script. Trivial.

    3. Re: It's java...why not decompile? by spongman · · Score: 1

      Download mcp.

    4. Re:It's java...why not decompile? by Hognoxious · · Score: 1

      Today I learned that Tata & WipeNo run all their code through a decompiler.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    5. Re:It's java...why not decompile? by johnsie · · Score: 1

      Why bother? Just make a clone with the same functionality and then you wont have to be stuck maintaining someone else's crappy code.

  5. Re:I'd love to see by Lije+Baley · · Score: 1

    Yeah, I wish they'd sell it to EA and then they could sell me a new version every year or so with slightly better graphics and...hopefully...ROYALE.

    --
    Strange things are afoot at the Circle-K.
  6. Re:I'd love to see by ArchieBunker · · Score: 1

    It's not hard to imagine what the source is like. Take every way you know to make efficient code and do the opposite.

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
  7. Poor craftsmanship by skoskav · · Score: 3, Informative

    These code bases have a serious issue with readability and maintainability. They seem to frequently write massive methods with deep nesting, and not even leaving some API or class documentation for posterity.

    It's the kind of gobbledygook code that I only see from freshly-graduated programmers and in competitive coding puzzles. Mojang should spend a few days to set up some static code analyzing tool like SonarQube.

    1. Re:Poor craftsmanship by drinkypoo · · Score: 1

      These code bases have a serious issue with readability and maintainability. They seem to frequently write massive methods with deep nesting, and not even leaving some API or class documentation for posterity.

      Notch wasn't much of a programmer, he was better at design. He left but the legacy of crap code persists. That's why there are several clones which are technically superior to minecraft. Unfortunately, almost nobody plays them, so if you want to play with large numbers of strangers you play minecraft anyway.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    2. Re:Poor craftsmanship by DRJlaw · · Score: 1

      Mojang should spend a few days to set up some static code analyzing tool like SonarQube.

      Mojang should spend $150K/year to have you do it. Then remind you that after working on it for years you'll have made a few hundredths of a percent of what they did from "gobbledygook."

    3. Re:Poor craftsmanship by skoskav · · Score: 1

      That seems pretty cool. Thanks for the link. Unfortunately it's annoyingly difficult to figure out how to use it in that repository -- or even if it works -- as there are neither documentation nor unit tests.

    4. Re:Poor craftsmanship by skoskav · · Score: 1

      I suppose that was a bit of hyperbole. However, the actual issue with that method in particular is that it performs several tasks that can be placed into named concepts -- i.e. methods:
      * Fetch nodes to loop through
      * Parse a node
      * Determine if a node meets some criteria
      * Recursively parse sub-nodes
      * Sort the resulting nodes

      The recursive call complicates refactoring though, but the simple act of learning the "Extract to method" shortcut in their IDE could do tremendous good for readability here.

    5. Re:Poor craftsmanship by skoskav · · Score: 1

      I'm not sure if you're aware of what static code analysis is, but it does not necessitate a re-write. Refactoring is something every developer should do, treating it like the Boy Scout Rule. It's as much about cleaning up existing code as it is about not adding new litter.

    6. Re:Poor craftsmanship by DRJlaw · · Score: 1

      I'm not sure if you're aware of what static code analysis is, but it does not necessitate a re-write. Refactoring is something every developer should do, treating it like the Boy Scout Rule [deviq.com]. It's as much about cleaning up existing code as it is about not adding new litter.

      I'm not sure if you understand that "not... a re-write" is quite inconsistent with "refactoring" and even "cleaning up existing code." You've run the gamut from nothing to ground-up reconstruction in the space of two sentences.

      Craftsmanship is only a principal goal for hobbiests. There are many other concerns and goals in most projects, and craftsmanship can validly be subordinated to them. Especially when you're writing a game and not a general purpose library.

    7. Re:Poor craftsmanship by skoskav · · Score: 1

      I'm not sure if you understand that "not... a re-write" is quite inconsistent with "refactoring" and even "cleaning up existing code." You've run the gamut from nothing to ground-up reconstruction in the space of two sentences.

      It seems to me that you are arguing against a position I am not taking, and perhaps vice-versa. Your first post seemed to me to speak of spending years re-implementing their code base, and I disagreed with that approach, instead trying to clarify that the existing code can be progressively cleaned up with the guiding help of a static analyzer.

      Craftsmanship is only a principal goal for hobbiests. There are many other concerns and goals in most projects, and craftsmanship can validly be subordinated to them. Especially when you're writing a game and not a general purpose library.

      I would instead suggest that craftsmanship should be a discipline for engineers. Hobbyists in my experience tend to forgo tests, documentation and maintainability. A game like Minecraft is a long-term money-making project that needs to be maintained for at least a decade. Working with low test coverage and poorly-written code will inevitably lead to bugs and slow feature progression.

    8. Re:Poor craftsmanship by DRJlaw · · Score: 1

      Your first post seemed to me to speak of spending years re-implementing their code base, and I disagreed with that approach...

      No, it was another way of expressing this, to someone who does not appear to have any comparable experience leading project with a wide audience, much less one that is commercially successful.

      ...instead trying to clarify that the existing code can be progressively cleaned up with the guiding help of a static analyzer.

      Oh... so the "It's the kind of gobbledygook code that I only see from freshly-graduated programmers and in competitive coding puzzles" quip was merely a gratuitous insult.

      Working with low test coverage and poorly-written code will inevitably lead to bugs and slow feature progression.

      You have no idea what the test coverage is. Your unidimensional vision of "craftsmanship" does not compel the conclusion that their code is "poorly written."

      Their code is fit for purpose. They've succeeded wildly beyond your measure. Effortlessly criticizing their gift makes you look arrogant, envious, and cheap.

      It's open source now. Fix it yourself.

    9. Re:Poor craftsmanship by skoskav · · Score: 1

      No, it was another way of expressing this, to someone who does not appear to have any comparable experience leading project with a wide audience, much less one that is commercially successful.

      That AC is right in a way; Mojang should do what Mojang wants. But I still think you're gravely overestimating the cost in time and money of setting up e.g. SonarQube into the build pipeline. Granted, I haven't worked on games that sell 150+ million copies, but my experience as a senior developer in various projects and teams -- from security programs installed by ~10 million end-users, to games that at their height were played by ~500,000 yearly -- has taught me some lessons, ones that largely echoes one of my favorite authors on programming, Robert C. Martin, who in the introductory chapter of Clean Code writes:

      Over the span of a year or two, teams that were moving very fast at the beginning of a project can find themselves moving at a snail’s pace. Every change they make to the code breaks two or three other parts of the code. No change is trivial. Every addition or modification to the system requires that the tangles, twists, and knots be “understood” so that more tangles, twists, and knots can be added. Over time the mess becomes so big and so deep and so tall, they can not clean it up. There is no way at all.

      As the mess builds, the productivity of the team continues to decrease, asymptotically approaching zero. As productivity decreases, management does the only thing they can; they add more staff to the project in hopes of increasing productivity. But that new staff is not versed in the design of the system. They don’t know the difference between a change that matches the design intent and a change that thwarts the design intent. Furthermore, they, and everyone else on the team, are under horrific pressure to increase productivity. So they all make more and more messes, driving the productivity ever further toward zero.

      The only ways I've experienced successful long-term projects with happy developers is to introduce an objective code quality measure into the build pipeline, limiting bad code buildup. Checks that e.g. put a limit on nesting and cyclomatic complexity, and demand a certain level of code coverage by tests are relatively easy to follow, and do a tremendous good.

      Oh... so the "It's the kind of gobbledygook code that I only see from freshly-graduated programmers and in competitive coding puzzles" quip was merely a gratuitous insult.

      Nope, that was comparing what I saw in the examples I posted to what I've experienced in the past. The clarification I mentioned later was directed at you. But if my comment was seen as an insult then I feel bad, as it was intended as snark.

      You have no idea what the test coverage is. Your unidimensional vision of "craftsmanship" does not compel the conclusion that their code is "poorly written."

      I have some idea. DataFixedUpper and LegacyWrapper have zero percent coverage, and brigadier has an unknown amount of coverage because they don't measure it.

      Their code is fit for purpose. They've succeeded wildly beyond your measure. Effortlessly criticizing their gift makes you look arrogant, envious, and cheap.

      It's open source now. Fix it yourself.

      My effortless criticism for why I thought their code seemed to lack in quality even came bundled with a tip on how to remedy it. The tip was perhaps moreso a cautionary tale for fellow Slashdotters to use static code analysis, as I wasn't expecting Mojang to be reading this story submission anyway. Again, if my snark was seen as a gratuitous insult then I will try to make myself clearer in the future.

    10. Re:Poor craftsmanship by sproketboy · · Score: 1

      Wahhh. Cry to mommy.

  8. Re: More interestingly by spongman · · Score: 1

    Does mine test have any content, though? Like the multitude of mod packs, total conversions, and countless ctm/adventure & creative/building maps available for Minecraft?

  9. Just in time by Trogre · · Score: 1

    Just in time for Oracle to screw it all up and start charging for Java licences.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  10. Re: More interestingly by drinkypoo · · Score: 1

    Does mine test have any content, though? Like the multitude of mod packs, total conversions, and countless ctm/adventure & creative/building maps available for Minecraft?

    There is nowhere near as much for minetest as there is for MC, but there are mods for it which provide most of the functionality you would expect. The big problem is the lack of players.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  11. Re:You are intentionally missing the point. by DRJlaw · · Score: 1

    You are intentionally avoiding the point.

    If sales have not died down, then the condition has not been met.

  12. Re:You are intentionally missing the point. by Anubis+IV · · Score: 1

    I’m all for holding people accountable, but it sounds like you’re suggesting “the point” is that we should be upset at someone for NOT breaking their word. I cordially disagree and would like to suggest that you are intentionally being obtuse if you would suggest otherwise.

  13. Re: More interestingly by VanessaE · · Score: 1

    *clears throat*

    There is a good selection of content - in the form of mods (at least a few hundred, but I can't give you an exact count), mod packs, texture packs, and what we call "sub-games", which can be anything from minor changes to a complete overhaul of the game play.

    All mods/modpacks are open source, written in Lua. The engine supports acceleration via LuaJIT, and the modding API can be enhanced/expanded with libraries such as luasocket (for example, IRC for command and control, or to link several servers' chats together via a common #channel). Most mods are true FOSS, but the exact licenses naturally vary by author.

    Mods run on the server (or server-process); a basic client modding API is present as well, which individual players may take advantage of if they want. Such mods are installed by the player, and only alter their client's behavior - what one player has installed has no appreciable effect on anyone else or on the server (or that's the intent of client-supplied mods anyway). Server-supplied client mods are on the engine road map. Unlike MC, players do not have to mod their clients to match a server's mods, and they are free to install any mods they want for their own, single-player use, regardless of what their favorite servers have.

    If you can think of it, there's a good chance a mod exists to supply it, except that our mods can't change the engine or shaders (there's generally no need to do so in the former case, and the latter is currently a controversial topic).

    There's a good selection of public game servers as well. Couple hundred at the moment on the public list (the number varies), plus however many private/unlisted ones there are.

    Servers (or single-player mode) can operate in creative or survival mode, and the latter can be anywhere from easy to hardcore. Hybrid operation is possible too (i.e. some level of survival, with creative rights given to selected individuals, as the admin sees fit).

    The standard Minetest package comes with a command-line server application, plus the client can be used to host a server from one of the user's local worlds (using whatever mods that world is configured to use).

    The client features an in-game mini-map, and external utilities exist to generate large overviews, even interactive pan/zoom maps, such as this one on my website.

    Both the engine core and the default game content (which is itself a sub-game) are under active development, though the developers would surely appreciate more contributions.

    Get it from the official website or get the engine source from the official Github repository. The default sub-game comes with the package on the Minetest website, or get it from its official Github repository. Note: on both repos, the "master" branch is "unstable" development leading up to 5.0.0. Visitors will probably want the "stable-0.4" branch. Oh, and no, that's not a typo - the version scheme changed after the 0.4 series, to drop that leading zero.

    Android and iOS clients exist, too, but I make no recommendations one way or another on those.

    We also have an active discussion forum, which also serves as a prominent place to release new content. There's also the official Minetest content database, another place new content can be released.

    Full disclosure: I'm a prominent member of the Minetest community: modder, texture pack author, and server operator (two easy survival, two creative, one nostalgic, plus a couple that I host for friends). So I'm a little biased. :-)

    Note: if someone tells you to use some links other than what I gave above, disregard that person's links and claims.

  14. Re: More interestingly by VanessaE · · Score: 1

    Minor edit: l now they're called just "games" instead of "sub games". Meh, guess I forgot :-P

  15. Re: More interestingly by VanessaE · · Score: 1

    s/I now/I guess now/

  16. Re: More interestingly by VanessaE · · Score: 1

    oh, and it's http://forum.minetest.net./ Slashdot ate my link

  17. Re:Is it the Infiniminer part? by Megane · · Score: 1

    False. The first demo video of Minecraft was posted May 13, 2009. Infiminer source was released May 16, 2009. Obviously Notch had been working on his code for at least a few weeks before then. As you can probably tell, 16 is greater than 13.

    Unfortunately that video, "Cave game tech test" by Nizzoch (F9t3FREAZ-k) is "not available in your country". This and this seem to be re-posted copies of it. I can't watch the original via Hooktube, but at least the date and description shows:

    Cave game tech test
    Published by Nizzotch on Wed, 13 May 2009 17:47:26 GMT

    This is a very early test of an Infiniminer clone I'm working on. It will have more resource management and materials, if I ever get around to finishing it.

    It currently runs at about 700 fps for a 256x256x64 tile map.

    You can follow development on my blog: http://notch.tumblr.com/

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  18. Re: Piece-meal, spoon fed open source? Is this a j by Megane · · Score: 1

    Microsoft's endgame

    Porting it to C#/.NET?

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  19. Open source by TJHook3r · · Score: 1

    Would have been even better to open source the whole thing! The Pi edition is obviously welcome but is so old as to be off-putting for young coders. It would be like offering a free version of FIFA soccer that only has goalkeepers.

  20. Re: Piece-meal, spoon fed open source? Is this a j by drinkypoo · · Score: 1

    Porting it to C#/.NET?

    I'm about 95% sure that they will do a complete rewrite in C#/.NET and offer it only for Windows and Xbox, eventually. And then do everything they can to absolutely kill the Java version, as it will represent competition.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  21. Re:How the hell is that complex code to you? by skoskav · · Score: 1

    I don't yet meet your arbitrary criteria, but one of my favorite programming authors that I just cited on the subject of maintainable code has been programming since 1969, and dedicates chapters to explaining and demonstrating why code such as that which I linked to is a bad idea, and how easy it is to write much better code.

    Get back to me when you have been coding for 50 years, and written Minecraft in Haskell. =)