16 ms·
Microsoft open sources parts of Minecraft: Java Edition
- axiometry 8y agoWhy did they choose to implement various functional programming concepts from scratch? Were there really no suitable preexisting implementations at the time?
- grenoire 8y agoThis seems to only be the command engine itself, which by the way is the sorry excuse for modding support that Mojang put out after Notch's promises. Not particularly exciting, but Blaze3D seems a little more interesting.
- Sir_Cmpwn 8y agoTwo of the most boring parts of Minecraft, unfortunately. Both are something your average first year CS student could put together in a weekend or two. If I can indulge in some self-promotion, I have written mountains of code which implements many of Minecraft's behaviors down to the last detail, which may be a more interesting candidate for study: https://github.com/sircmpwn/truecraft https://github.com/sircmpwn/truecraft Seeing Balze3D open-sourced might end up being pretty cool, though.
- e1ghtSpace 8y agoNo way, Beta 1.7.3 is my favourite version. I'm going to have to try this.
- joshumax 8y agoIt seems more like they wanted to make the rounds on various blogs and news sites which will inevitably display something along the lines of "Minecraft is now open source!" In the end, based on what they've currently released it appears to be more of an advertisement than anything. With a huge mod community creating projects such as MinecraftForge, most of what is currently released by Mojang/Microsoft is largely irrelevant. If they release their game engine, however, that's a different story...
- kbumsik 8y ago> Two of the most boring parts of Minecraft, unfortunately. Both are something your average first year CS student could put together in a weekend or two. So sad that it's like average second year in my school's curriculum.
- throwaway180118 8y agoI'd really like to learn more about the concepts of this kind of game design. Where can I start?
- Sir_Cmpwn 8y agoIf it's my advice you're looking for, the only way I've done it is by studying someone else's game and attempting to replicate it 1:1. It's more an exercise in reverse engineering than in game design.
- lifeisstillgood 8y agoPerhaps a different phrasing of the question (certainly my view) would be "I could go create a (not 1:1 feature) game myself, as a project, and I would learn new stuff, but would I cover all the concepts built into Minecraft?" I would be interested in the syllabus that building a 1:1 minecraft would teach. So for example, "Minecraft creates the same world each time from a fixed X Byte salt, and uses these well known algorithms for generative landscape production"
- Sir_Cmpwn 8y agoAh, then some useful algorithms and keywords to study would be OpenGL, voxel rendering, A* pathfinding, cellular autonoma, perlin noise, etc. Red Blob Games has a lot of good articles covering many of these subjects, here's a few: https://www.redblobgames.com/pathfinding/a-star/introduction.html https://www.redblobgames.com/pathfinding/a-star/introduction... https://simblob.blogspot.com/search/label/noise https://simblob.blogspot.com/search/label/noise
- Reelin 8y agoIn addition to @Sir_Cmpwn's answer, the developer logs from Voxel Quest (@gavanwoolery on HN) and Seed of Andromeda are both excellent starting points for getting a general overview of what's involved in this sort of undertaking. Both of those games ended up releasing their full source code by the way, so you're also free to pick through every last detail if the logs aren't enough. Links: https://www.voxelquest.com/news/every-version-of-voxel-quest-ever https://www.voxelquest.com/news/every-version-of-voxel-quest... https://www.seedofandromeda.com/blogs https://www.seedofandromeda.com/blogs
- _hardwaregeek 8y agoAh yes, profunctor optics, an excellent topic for a freshman CS student's weekend project: https://github.com/Mojang/DataFixerUpper/blob/master/src/main/java/com/mojang/datafixers/optics/profunctors/Profunctor.java https://github.com/Mojang/DataFixerUpper/blob/master/src/mai...
- Sir_Cmpwn 8y agoDataFixerUpper looks more sophisticated on the surface, but it's egregiously overengineered, and tools accomplishing the same stated purpose could be made by a freshman with a couple of weekends to spare. It's also not particularly relevant to Minecraft, it's more of a general tool - so anyone hoping to learn about Minecraft from this will really learn more about Minecraft's annoying legacy baggage.
- LeifCarrotson 8y agoI think you underestimate how many weekends it would take a freshman - when I first took a CS course, I spent a solid few weekends working out array syntax, strchr and strncat, and how to best google compiler error messages. I was pretty proud of the text-based 2-player chess game for which I put in some late nights for my final project...a Minecraft renderer would have been a long way out.
- Sir_Cmpwn 8y agoThis isn't a Minecraft renderer I'm talking about. The Minecraft renderer would be the non-trivial project I said "might end up being pretty cool" if they open source it.
- stevekemp 8y agoWhen I went to university it was back in 94, and then people who took CS courses were pretty much self-taught programs already. Sure "theory-stuff" was often new, because of the self-taught nature of the under-graduates. (I knew what a stack was because I'd done assembly-language coding, but I had no name for something I'd "created" which was a linked-list. Funny story.) I assume nowadays with the internet people who want to code, can start early if they wish. Even if the lure of the outdoors is strong, and time is short. With that in mind I'd assume any first-year student could write a system for updating data-files according to simple rules, (i.e. datafixerupper), and manage a simple parsing-class of some kind which would let you tokenize and react to "/send foo bar" input.
- lghh 8y ago> Both are something your average first year CS student could put together in a weekend or two. Sometimes I see people and wonder which of these two things is true: 1. They have no idea what the average developer actually is. 2. They are lying to make it sound like they were elite when they were a freshman in college.
- Sir_Cmpwn 8y agoI did not go to college so I have to admit I'm not actually familiar with the average freshman's skill level. That being said, these are basic and well-understood problems solvable by the average, say, junior developer in the industry. Less of a reach?
- mclehman 8y agoFar, far lower than you're envisioning. There are certainly a lot of freshmen who could easily do something at this level, but the average freshman would be hopelessly lost (at least in my (recent) experience). By the way, excellent work on Sway. I've been meaning to jump to i3 forever, and decided to move to Wayland on my most recent install. I do have some bug reports to send your way, though, I should get on that.
- screye 8y agoAn average CS freshman knows how to write hello world and print Pascal's triangles on the command line. An above average freshman at an above average university can probably make Sudoku, Tetris or Brick breaker. Even the smartest students probably won't be able to make.minecraft in a weekend. Maybe as a semester long project. But not a weekend.
- LolNoGenerics 8y agoIt's not like they want to showcase their rocket science.
- Analemma_ 8y agoI notice that repo has commits ranging in age from 7 months to 3 years, so it seems to have taken you quite a bit longer than “a weekend or two”. Maybe tone down the arrogant trash-talking a bit.
- Sir_Cmpwn 8y agoAs I pointed out in a few other comments, the code that Microsoft has open sourced represents a tiny fraction of the Minecraft codebase, is only loosely related to Minecraft at all, and represents basic and well-understood problems in the industry.
- realSlavojTrump 8y ago>If I can indulge in some self-promotion, I have written mountains of code which implements many of Minecraft's behaviors down to the last detail, which may be a more interesting candidate for study It is an interesting case study. The code has failed to run for myself and the five other people i handed the project to with different configs. There are no tests that validate the project works. Its certainly work to be proud of, insofar as maybe its worked for some subset of people in the past. Edit: I was excited to work on this code and spent a healthy amount of time reading through all of it to find great places to contribute. After writing a small pr, mostly a throwaway to test the waters, I was greeted with unmitigated assholery by the main devoper and their irc crew. I kept the logs from an irc conversation i had about the pr as a reminder of how not to act towards developers on projects i work on.
- Sir_Cmpwn 8y agoWell, the code has been unmaintained for some time now, and only grows more stale (especially considering the .NET ecosystem has been in turmoil during that time). There are tests, though, but they only focus on the parts which are fragile or complicated: https://github.com/SirCmpwn/TrueCraft/tree/master/TrueCraft.Core.Test https://github.com/SirCmpwn/TrueCraft/tree/master/TrueCraft.... Edit: oh, I think I remember you. If I'm right, here's your pull request and the corresponding IRC logs: https://github.com/SirCmpwn/TrueCraft/pull/283 https://github.com/SirCmpwn/TrueCraft/pull/283 https://sr.ht/4tKr.log https://sr.ht/4tKr.log
- realSlavojTrump 8y agoIf there are tests and the project can still fail to run, is the test suite really good? Blatant and rude sarcasm: you dont need to answer because a freshman cs student would know the answer.
- deleted 8y ago[deleted]
- sytelus 8y agoIt’s quite amazing how fast kindergarteners gets addicted to Minecraft. Here is a suggestion: create special version of Minecraft for kids below 10yr old. Discourage killings, shootings (even for animals) and encourage building. This “Kids Edition” has great chance of selling hot!
- Pica_soO 8y agoThe hippys ideology failed miserable half a century ago. Hunting and killing is in our nature and removing it only ever resulted in removing the parts we found interesting from books, movies and games. My parents tryied that non-violence education nonsense- and even without movies and books, my brother and i found sticks to play spear and sword with. Is it that hard to deal with reality? If you want to prevent violent tendencies, then add a first aid weekend, where you help injured critters or humans- and tada, empathy grows, although you will never get the killer out of man.
- zamalek 8y ago> Both are something your average first year CS student could put together in a weekend or two. No unit tests in sight? Sounds about right.
- aw1621107 8y agoThe code is being open-sourced as MIT-licensed libraries. The libraries mentioned in the article are Brigadier [0], a command parser and dispatcher, and Data Fixer Upper [1], which is used to migrate older chunk data to newer versions of Minecraft. Apparently more libraries are in the pipeline to be open-sourced alone these two. One possibility is Blaze3D, which is a rewrite of the rendering engine that is planned on being included in Minecraft 1.14. [0]: https://github.com/Mojang/brigadier [1]: https://github.com/Mojang/DataFixerUpper
- kristianp 8y agoClickable links. If you indent text, that gets formatted as code. [0]: https://github.com/Mojang/brigadier https://github.com/Mojang/brigadier [1]: https://github.com/Mojang/DataFixerUpper https://github.com/Mojang/DataFixerUpper
- erikb 8y agoAlso the numbered quotation format is really without indentation. If I recall correctly in restructuredText you can do the same to do quotations correctly, and you could also put in strings instead of numbers, e.g. [<Author><Year>] (might need Sphinx, a library on top of resT, or maybe a bibtex plugin).
- aw1621107 8y agoAh, is that the case? I just remember picking up the indentations for references somewhere, and never really got around to finding out whether that was the right way to do things. Looks like I need to change that habit
- aw1621107 8y agoI knew about the indenting leading to formatting code; I've just been in the habit of indenting references like that, and didn't occur to me that that would break the clickable links. I'll have to keep that in mind in the future.
- Kenji 8y agoInstead of open sourcing code, they should fix the Aquatic update. All Minecraft versions after 1.13 are literally unplayable for me (mid to high end gamer PC) due to freezes. Every 5 seconds, the game freezes for two seconds for me. Increasing RAM for the JVM was useless. After the update, the game needed more than 3GB of RAM when before it ran just fine on 1GB (I have 16GB of RAM so no problem there, but the game still freezes). I have never seen more broken updates except with Skype - which, now that I think about it, makes perfect sense, considering it's also from Microsoft. Why would I use their game library when they ship such incredibly broken updates?
- yjftsjthsd-h 8y agoIf they open source that, then everyone else can fix their bugs. Of course, it would usually be wildly optimistic, but looking at with the mod scene has already done, I'm optimistic.
- myrandomcomment 8y ago1m people play the game with no issues. Did you open a support case? Did you open a bug? What’s the ID? Also giving more RAM to Java is a bad thing as GC can cause lag. I run 1.13.1 on an old AMD 2ghz under Windows 7 with a Nvidia cards from 2011 and get 30-90fps. Also runs fine on my 2017 MacBook and on an intel compute stick (i5, 4gb ram, Win10 on a 4K screen). Something else is your issue and you just see it in the game.
- Kenji 8y agoI updated my Nvidia graphics driver and that fixed the issue. It's probably a case of Minecraft using the OpenGL API wrong and the driver needing to compensate for this broken usage of the API.
- chungy 8y agoI would check to see if you have 32- or 64-bit Java installed. I've seen similar issues (years before 1.13 was a thing) due to 32-bit Java. Install 64-bit and should be good to go.
- yuhong 8y agoI remember BUILD 2015 when a Minecraft mod was used as a demo and the team complained.
- sleavey 8y agoOf note is the Minecraft website from 2011 [1], where Markus Persson said: "Once sales start dying and a minimum time has passed, I will release the game source code as some kind of open source. I'm not very happy with the draconian nature of (L)GPL, nor do I believe the other licenses have much merit other than to boost the egos of the original authors, so I might just possibly release it all as public domain." [1] http://web.archive.org/web/20110920065648/http://www.minecraft.net/game http://web.archive.org/web/20110920065648/http://www.minecra...
- scrollaway 8y agoMan I remember that. I was disappointed he didn't follow through, especially since Minecraft made him obscenely rich and there's really no reason to keep it closed source. Microsoft followed through where Notch couldn't. How about that...
- foota 8y agoI mean for what it's worth sales never really died out.
- SteveNuts 8y ago> Microsoft followed through where Notch couldn't. But this isn't the full source code.
- scrollaway 8y agoIt's more than Notch ever released? And it's my understanding there's more to follow.
- OnlyRepliesToBS 8y agospoon feeding is a trickle not in the spirit of open source
- naikrovek 8y agoThe entire source of Minecraft has been available to mod authors for quite some time.
- brylie 8y agoIt would be really cool if Minecraft, Minetest [0], and Terasology [1] development communities could somehow join together to create a cross-compatibility between their games. There are a lot of open-source developers in those communities who can combine efforts take voxel gaming to new heights. [0] https://minetest.net https://minetest.net [1] https://terasology.org/ https://terasology.org/
- fileeditview 8y agoHa came here to leave a link to Terasology. A classmate created it back in the study days. He went to work at a German game studio. The project was joined by more and more contributers and has become really impressive! Minecraft-like games are not really my thing but I recommend it to most people mentioning Minecraft :)
- Immortalin 8y agoMinecraft's deobfuscated source is publicly available for viewing for those who are interested through Minecraft's Mod Coder's Pack.
- jtl999 8y agoIsn't that just reverse engineering and cleaver renaming based on what the functions/variables actually do?
- naikrovek 8y ago"just"
- jtl999 8y agoSo your implying that it's not trivial. I acknowledge that. What I was implying is that a third party deobfuscation project by reverse engineering with minimal input from the original developers would presumably be different in terms of variable/function names, etc, comparing it to the original source.
- SquareWheel 8y agoIt's been deobfuscated, but it's not in the original unobfuscated form.
- bredren 8y agoWorked on a fairly major PvP minecraft community / mod website at the start of this year. Minecraft PvP is sort of a competitive set of modifications that build out entire networked games. The games use normal minecraft concepts like item consumption. Almost all "fighting" is done with swords, with people clicking their mouse very fast. All of the mods were based on 1.7.10, which is pretty far back, looks like 1.13.1 is the latest. There are still a lot of young people playing minecraft PvP, particularly outside the US. But you could tell even then that Fortnite was eating up younger players.
- jtl999 8y agoInteresting, but how much of this has been reverse engineered from decompiling the Java classes already?
- phit_ 8y agonothing, both these projects have been deobfuscated from the start and then recently released on Github
- userbinator 8y agoThat's what I thought too at first --- Java (and .NET) is so easy to decompile that having the original source is not so much of a big deal.
- thx4allthestuff 8y agoThank you for your hard work. I've enjoyed countless hours meditating while chipping away at blocks that later went towards my castles. Anything further that you choose to release, I thank you again. And thank you for providing the venue to allow me to connect with my little brother, for that I can never repay you.
- Cogito 8y agoBack when we were working on Bukkit, when Dinnerbone and the other three were aquihired? by Mojang, one of the main things they wanted to do was implement a proper modding interface into the game. Lots of things conspired to make that not happen, undoubtably including feature creep (because it was going to be the official mod api, it had to be correct not just good), but it finally looks like they're moving in that direction.
- travbrack 8y agoWhat is something one could develop with this source code that would have been more difficult or impossible before?
- kccqzy 8y agoAs some who loves the lens library in Haskell, this makes me in awe: https://github.com/Mojang/DataFixerUpper/tree/8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf/src/main/java/com/mojang/datafixers/optics https://github.com/Mojang/DataFixerUpper/tree/8b5f82ab78b30f... Profunctors, lenses, prisms, traversals… all there :)
- suprfnk 8y agoHonest question, if you look at this: https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf/src/main/java/com/mojang/datafixers/optics/profunctors/ProfunctorFunctorWrapper.java https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30f... Is that understandable to you? And does this really make solving some problems easier? I've dabbled a bit in Haskell, but never got further than functors, applicatives and monads, and I always wonder whether this kind of stuff really helps. (It probably doesn't help that Java is very verbose, especially compared to Haskell...)
- bjz_ 8y agoIt probably could do with some examples, and better docs, but it seems like they use this to update old chunks, which is a great use of lenses. But yeah, you'd have to weigh that up against how ugly it turns out to be in Java. It's not just because of the verbosity, it's the lack of being able to abstract over type-level functions that makes it quite icky to implement these abstractions in Java.
- kccqzy 8y ago> Is that understandable to you? Of course using lens in Java is going to have compromises and nothing is going to beat Haskell in readability for this kind of programs. As you pointed out, Java is verbose and that hurts the readability a lot. > And does this really make solving some problems easier? Whether this makes solving problems easier, I would say in Haskell, I routing compose half a dozen of optics to do a fold or update and it really makes things easier. I haven't read this Java version so I don't know whether the power-to-weight ratio here is similar.
- zarify 8y agoNot really that surprising since there seems be a lot of focus on things like Minecraft Education Edition, which isn't Java based. (Which, as a teacher, I am finding a fantastic tool for both introductory programming and other topics)
- jarym 8y agoI looked at DataFixerUpper - should I be surprised that there appears not to exist even a single test for this piece of engineering? Boggles my mind that someone would engineer something so sophisticated and not write even a high-level test script of some kind.
- IanSanders 8y agoThis comment is why people think twice before opensourcing their code
- jarym 8y agoMaybe.. but this is a VERY sophisticated data migration utility. It going wrong can mean crippled data! I am certain /some/ code must exist to allow the authors to verify it does what they want so my question is more: where is it?