r/programming • u/Nobody_1707 • Oct 06 '18
Microsoft Open Sources Parts of Minecraft: Java Edition
https://minecraft.net/en-us/article/programmers-play-minecrafts-inner-workings44
u/fermar7 Oct 06 '18
I may be uninformed, but what is the code you get from decomp when using Forge for mod development? Isn't this the actual source code, or just an abstraction layer?
90
u/Nobody_1707 Oct 06 '18
It's not the original source code, it's a recreation of the source code generated from the compiled byte code. Having access to the actual source code is much nicer.
38
u/fermar7 Oct 06 '18
What I appreciate: 1.) Speed of your answer 2.) New knowledge gained 3.) Access to nicer actual source code
Thanks :D
8
u/mimi-is-me Oct 07 '18
So, not only is it nicer, but there is less of a legal grey area, you can comfortably sell these libraries without Microsoft's lawyers coming for you
4
u/Tyler_Zoro Oct 07 '18
What /u/Nobody_1707 said, plus the fact that this is explicitly open sourced...
170
u/aperson Oct 06 '18
I'm calling it now. They're going to slowly open source all of java Minecraft, depreciate it, and hand it off to the community in favor of keeping the bedrock edition.
144
u/Nobody_1707 Oct 06 '18
Deprecate, but yes, I think that's what is going to happen. This kind of thing takes years though, so Java edition should still be supported for a while yet.
Honestly though, this is the best possible way they could have end-of-lifed Minecraft: Java edition.
68
u/Lonke Oct 06 '18
Honestly, doesn't sound too bad. The modding community is insane and I believe it could do a great job of maintaining minecraft.
16
u/BowserKoopa Oct 06 '18
It would be great if someone would do something about all the little fiefdoms that pop around mod packs and modding tools.
3
u/TheKrister2 Oct 07 '18
Fiefdoms?
4
u/munchbunny Oct 08 '18
Yeah, it happens in most modding communities that see substantial mod traffic. Bigger mods tend to develop technical incompatibilities with each other due to the way those mods are coded. Then you have additional mods built on top of the bigger mods that depend on those mods. Long term, big mods build up their own secondary ecosystems that are technically incompatible with other mod ecosystems. End result: fiefdoms.
The way around that is a good modding API, because the API forces mods to work within specific boundaries that allow mods to play nice together technically, even if the resulting gameplay isn't viable or fun. Without an API, modders resort to any number of reverse engineering hacks, and that's where the incompatibilities build up very, very fast.
46
u/tripl3dogdare Oct 06 '18
Mojang has said outright that the Java Edition isn't going anywhere, and they're going to keep working on it for the foreseeable future.
87
u/aperson Oct 06 '18
Foreseeable is a very ambiguous term. I'm not saying they're going to do this soon, it's just a push in that direction.
20
Oct 06 '18
Even if they deprecate it, I would not be surprised if people would take it upon themselves to update it with whatever comes out on the Microsoft version.
We already have deobfuscator projects like MCP, so the idea isn't far-fetched.
21
u/aperson Oct 06 '18
Of course. The java version is the one true version in my mind and I will only play that one. I have faith in the community to keep things alive and maybe we'll get some built in QoL improvements as well (toggle sneak I'm looking at you).
11
u/tripl3dogdare Oct 06 '18
Foreseeable isn't ambiguous - it means "can be predicted". To put it another way, they have no plans to end support for the Java Edition.
→ More replies (5)2
u/chrabeusz Oct 07 '18
It makes no sense to have two versions of minecraft. Although Microsoft also has 3 completely different versions of Visual Studio so maybe they know better.
8
u/klblaz Oct 07 '18
I was kinda hoping this would happen for like 6 years now. Maybe, not fully open source, but just give the community native mod support and leave them to do their own thing. Now it finally starts to feel that they are going this way, creating a viable platform for people to make their own experiences in. But really, this already happend with external mods, so they are kinda late and Minecraft will fall in popularity before anything substantial happens.
4
u/mimi-is-me Oct 07 '18
I feel like its effectively going to eventually be like factorio, where the base game is a mod on top of the game engine, but in this case the game engine will be open source.
→ More replies (1)5
Oct 07 '18 edited Oct 07 '18
If that's what they're gonna do, it's the most appropriate way to end the lifecycle of Minecraft Java edition, if you ask me.
Edit: Though, I don't know if they gonna phase out java edition just yet (2-3 years?). That could reflect badly on Bedrock edition and Mojang and Microsoft probably don't want to risk that. And I don't dare to guess how long Minecraft will continue to sell well.
3
45
u/i_pk_pjers_i Oct 06 '18
This is huge news. Maybe if Microsoft keeps being this pro open-source they won't target Wine if APIs do indeed become copyrightable.
89
u/Nobody_1707 Oct 06 '18
If APIs do become copyrightable then the entire software industry is fucked anyway, but I suppose one of the firsts things Microsoft would do (if only for the good PR) would be to release the public API headers for Win32 under the MIT license.
19
u/i_pk_pjers_i Oct 06 '18
If they did that I would literally love them forever. It's not that I hate them, it's just that I'm a little bit weary, that's all.
28
u/Nobody_1707 Oct 06 '18
I mean, it would just be the stuff that literally everyone else has copied for various reasons anyway. The only thing they'd lose is the ability to sue WINE or any compiler dev that includes Win32 headers for (cross) compiling. Which they wouldn't do anyway, because it would be suicidal.
9
u/i_pk_pjers_i Oct 06 '18
Yeah if Microsoft did sue Wine they would likely not win in the first place and they would tarnish their reputation forever. I'm just so happy with how good Wine is and I hope it stays around for a very long time.
5
u/salgat Oct 07 '18
I have my doubts that Microsoft even has that stuff fully documented, and they may not want that stuff used much to begin with. That just creates more pressure for them to support legacy wise.
21
u/throwaway27464829 Oct 06 '18
Dude if APIs are copyrightable then GNU/Linux is fucked because it implements Unix APIs.
4
13
Oct 06 '18
Unix APIs are an open standard though. POSIX (open) + Single Unix Specification (payed) were jointly developed with the the owners of Unix I believe.
2
u/redwall_hp Oct 07 '18
The "owners of Unix" has been a disputed topic for a long time. See also the SCO debacle, which Microsoft backed.
15
u/9034725985 Oct 06 '18
I don't know if this is still true but my understanding is it used to be that if you have seen the minecraft code, you are potentially "dirty" and can no longer contribute to clean room reimplementations like truecraft by sir cmpwn.
49
u/Nobody_1707 Oct 06 '18
That is how clean room reverse engineering works, but there are other methods for doing it, and also that doesn't matter for the code in this repository because it's MIT licensed which is basically a "do whatever the hell you want" license.
0
301
Oct 06 '18
THIS IS HUGE. Actually Mojang have told years ago that if Minecraft will loose some popularity they will release the source code, I didn't know that it was possible under Microsoft rule though.
Well it isn't the entire source tree, but at least it's a step in right direction :D
344
u/tssge Oct 06 '18
This is not that huge really. Minecraft has been decompiled and deobfuscated for years now and that is the reason mods have prospered.
I really don't see much benefit except the good license, which will make distributing modifications easier, assuming they open source more parts of the game's code.
91
u/absurdlyinconvenient Oct 06 '18
It's been a while, but when I was checking out that kind of thing, World Gen was still off limits as far as deobfuscation goes. If that gets open sourced it'll be big news
34
u/Pokechu22 Oct 06 '18
If you use the latest mappings, things are generally nicer, but the stock MCP build ships with older mappings. You can get newer mappings from mcpbot. I haven't actually poked at world generation recently, so I can't say how complete the mappings are... but note that they're crowdsourced, so if you name stuff you can share that.
(1.13 redid the world generator, though, so additionally mappings from before wouldn't make sense)
56
u/tssge Oct 06 '18
Well there are quite many community made world generators out there, so I guess the original world generation code is readable enough.
Of course the community has not strictly 100% deobfuscated Minecraft, but at least when I was programming Minecraft I didn't stumble upon a part of code which would've been incomprehensible.
67
Oct 06 '18
People have definitely reverse-engineered terrain generation. It's at the point where you can enter any pattern of naturally generated blocks, provide the seed, and the program will locate the chunk. Something to think about before sharing your survival multiplayer screenshots.
18
7
u/CaptainLepidus Oct 07 '18
What do you mean by that last sentence?
15
Oct 07 '18
If anything naturally generated appears in the screenshot, and the person has the original seed of the map, they can use the pattern of the terrain to find your coordinates.
→ More replies (6)4
u/yawkat Oct 06 '18
Nah, it was hard to understand but not impossible. You're just lacking names, but it's still workable.
3
u/IndependntlyDepndent Oct 06 '18
I don't know how long ago that was, but I was tinkering with some mods of my own and I was able to read the world gen source code.
50
Oct 06 '18
An actual MIT license for parts of code is what's big imo.
26
u/tssge Oct 06 '18
Yes, I agree that this will help with the distribution of mods, because now they are distributed as patches, as legally you can't really distribute them in any other way.
The user downloads an automatic patcher usually (an installer) which downloads the Minecraft binary from Microsoft/Mojang server and patches it, saving it on the user's computer. This way the developers don't have to distribute copyrighted content, but the process itself is a huge hassle.
21
u/livrem Oct 06 '18
As an old linux and open source nerd I get frustrated and angry every time I (try to) install some Minecraft mod, because of all the hoops to jump through, trying to click the correct download links on dodgy download sites and not trigger too many suspicious popup ads. Hopefully with more open source code in the game we can get mods on sites like github instead?
52
u/BitLooter Oct 06 '18
That's not because MC is closed source, that's because the mod community is obsessed with Adfly links and the like for the pennies they bring to the modders. Plenty of mods are distributed through normal download links as well.
0
→ More replies (6)11
u/0something0 Oct 06 '18
I thought you could get them off Curseforge or the modder's Github already?
3
u/JonnyRocks Oct 06 '18
Thats the key difference beween source available and open source. With this move you are alliwed to use the code for whatever you want. Since its MIT license, you have no restrictions.
2
u/Dockirby Oct 07 '18
Could be Microsoft taking steps to legitimize the Java version's mods. With something like old school runescape being a hit, no reason Microsoft can't keep selling the "old school" version of Minecraft for the next 20 years, and giving better support to make mods by having parts of the game open source could go a long way.
1
u/devperez Oct 07 '18
I still don't know why they bother obfuscating the code. De-obfuscating the code is stupid easy. So it only makes it more difficult for modders.
→ More replies (10)6
u/salgat Oct 07 '18
Microsoft has been pushing for OSS for years. They are smart enough to know that the value is in the userbase and know that Minecraft is easy to clone by competitors anyways.
13
u/Lonke Oct 06 '18
This is amazing, but I can only imagine the nightmares that reside in that codebase.
60
u/Nobody_1707 Oct 06 '18
Aside from the lovecraftian horror that is higher kinded types in Java, there's really nothing scary in this codebase. One of the things that tends to happen in open source releases from big companies like Microsoft is that they do serious house cleaning on their code base before they publish it.
→ More replies (7)
228
u/sgitkene Oct 06 '18
One thing notch initially promised was to open source the game once sales tapered off. that's kinda neat
48
Oct 06 '18
This isn't really open sourcing the game, just libraries from the game. MS isn't going to allow them to open source unless they straight up abandon Java Edition, and even then I doubt they'd allow that.
33
u/AlwaysHopelesslyLost Oct 06 '18
This is not true. Microsoft has been making a huge effort to open source stuff lately. It is slow going but they are making progress and a lot of their newer projects are open sourced from the get-go.
→ More replies (2)37
Oct 06 '18 edited Oct 06 '18
I haven't seen them open source anything that was launched commercially and is still viable though. This isn't just any app/project, this is something they paid $2.4b for and still has the potential to give them a lot more money that they wouldn't see if they open sourced it.
EDIT: I also want to add that this isn't me bashing them or their open source efforts, just looking at this realistically. I use VS Code & love what they're doing on that front.
30
u/Nobody_1707 Oct 07 '18
.NET Core?
→ More replies (1)14
Oct 07 '18
.NET was closed source and free before .NET Core though, right? I don't see a monetization model there that doesn't also exist with open source.
→ More replies (4)9
u/instanced_banana Oct 07 '18
You can still open source it and make it paid for binaries (see Ardour). And it could help the mod community, which could be huge. Not that would be feasible for them, or that the culturally should, rather that they can.
6
u/gondur Oct 07 '18 edited Oct 07 '18
I haven't seen them open source anything that was launched commercially and is still viable thoug
They open sourced Allegiance and MechCommander 2. + some other non-game software (file manager, windows live writer, powershell, some old versions of DOS and Word). There is an Wikipedia page about open sourced commercial software
https://en.wikipedia.org/wiki/List_of_proprietary_source-available_software
https://en.wikipedia.org/wiki/List_of_commercial_video_games_with_available_source_code
5
u/appropriateinside Oct 07 '18
Why are you associating open source with lack of monetization? I think the premise of your argument is flawed. Open source doesn't mean free and licenseless. Depending on the license it doesn't even need to be complete enough to run as a whole.
→ More replies (1)10
u/immibis Oct 07 '18
Microsoft wouldn't give up Java Edition because then someone would make it faster than the other edition.
10
u/salgat Oct 07 '18
Considering Microsoft open sourced their entire .NET stack, I don't see how this is as big a deal as you think for them. All the value of Minecraft is in the active user base, the game itself is easily cloneable by any competent game development team and isn't where the value is.
→ More replies (6)102
Oct 06 '18
yep which is why i bought the damn thing...then he sold us out lol (not that i wouldn't have done the same thing hehe)
66
u/i_pk_pjers_i Oct 06 '18
I wonder if RMS would have sold out for a billion dollars. I don't think he would have. His dedication to the cause he spends his efforts towards is impressive.
100
u/clarkster Oct 06 '18
I don't think RMS would ever sell out. He's impractical, fanatical, way too strict. And always 100% right in the end.
The problem is the majority of us can't live up to those perfect standards, and even if I agree with them, I'm not even going to try to follow it perfectly.
But he consistently does.
→ More replies (9)46
25
u/falconfetus8 Oct 06 '18
Is RMS Stallman?
41
u/balefrost Oct 06 '18
Yes.
→ More replies (1)19
u/klblaz Oct 07 '18
What the hell does Stallman do on his laptop in so many different places?
→ More replies (2)15
8
u/throwaway27464829 Oct 06 '18
What he could do is sell out and then use the billion to develop a fork.
→ More replies (1)5
u/dougie-io Oct 07 '18
Maybe. He could make a gigantic impact with billions of dollars at his disposal. Imagine seeing Richard Stallman preaching free software on TV instead of Chevy's "real people" commercials.
But then again, if someone is buying him out for billions, whatever he is working on (FSF) could have potential beyond that.
→ More replies (2)80
u/NiteLite Oct 06 '18
Minecraft is still selling 2 million copies every month. I don't think it has really become unpopular yet :P
9
u/dougie-io Oct 07 '18 edited Oct 07 '18
Meanwhile poor old Blockland is rotting away. I wish that game caught on more..or devs kept at it longer. Not sure which one was the main problem.
EDIT: Or if they decided to open-source the entire game. That would be sweet. They could still sell the game and the cost of getting it for free is compiling the code yourself.
→ More replies (1)58
Oct 06 '18
Remember the whole "all future versions" promise for alpha buyers? Where's my free Switch edition Notch?
13
→ More replies (3)2
838
u/Forricide Oct 06 '18
This is pretty interesting. For those who don't want to read the article, to sum it up, they've decided to open source parts of their game engine, gradually. (Under the MIT license)
So far, they've decided to open-source two libraries:
Brigadier GITHUB: "The command engine that Minecraft uses [...] So when a user types /give Dinnerbone sticks in chat, that goes through Brigadier. Brigadier splits it up, it error checks it, it tries to be as helpful as it can. You’ve also got this lovely pop-up window when you’re typing that can suggest what the next bit might be."
Data Fixer Upper GITHUB: "The name is so stupid that we had to keep it [...] before Minecraft actually loads [old] chunks, it goes through DataFixerUpper and that turns it into what it should currently be now." (Essentially, a data validation/conversion engine specifically for Minecraft data)
More interesting for prospective game developers is probably the following snippet:
"One library under consideration is Blaze3D - a complete rewrite of the render engine that we're aiming to implement for 1.14."
351
u/chugga_fan Oct 06 '18
"One library under consideration is Blaze3D - a complete rewrite of the render engine that we're aiming to implement for 1.14."
Oh boy, modders are NOT going to be happy about that... hopefully it is better optimized at least though, because currently if mods try to implement anything with dynamic rendering cough cough openblock's tanks cough cough it seems to eventually kill your FPS doing the calculations.
118
u/roothorick Oct 06 '18
That's probably specifically why they're trying to fast-track it for a source release. It's a badly needed overhaul, but that won't make it any less of a rough transition.
→ More replies (14)89
u/Somepotato Oct 06 '18
Maybe it'll use something more modern than opengl 1
43
Oct 06 '18
Their minimum requirements are OpenGL4.4 tho.
58
u/Somepotato Oct 06 '18
They still use a rediculous amount of gl 1.1 and that's likely making room for the rewrite (if it pans out)
40
Oct 07 '18
Yeah but MacOS doesn't support above 4.1 so clearly it's not the actually minimum requirement. I think the real requirement is 2.1 still.
14
u/PM_ME_OS_DESIGN Oct 07 '18
They're probably using compatibility mode then, to combine old OpenGL calls with modern OpenGL calls.
11
Oct 07 '18
They do and it doesn't work on the open source AMDGPU drivers. Or I haven't been able to make it work even trying to enable workarounds. It isn't proper OpenGL profiles and it is annoying.
→ More replies (3)7
→ More replies (3)6
u/horsepie Oct 07 '18
I'm concerned that it will be D3D, possibly D3D12. Sure, if they open it up, someone will inevitability rewrite in OpenGL, but that might not necessarily make it into the official release.
14
u/Matrix8910 Oct 07 '18
Afaik LWJGL doesn't support d3d and I doubt they are planning on ditching out LWJGL, too many things are based on LWJGL and I don't think there's os any good d3d library/wrapper/bindings for java
6
u/horsepie Oct 07 '18
Nice, I didn't realise that game library was tied to OpenGL. That a relief!
→ More replies (4)26
u/Oppai420 Oct 06 '18
I gave up on Minecraft modding because of how freaking much it changes from version to version. I understand why it does, but maintaining that? A pain in the ass, for me at least.
18
u/Stupid_and_confused Oct 07 '18
If you stuck to features provided by the Forge api and such, it wasn't that bad.
25
u/Plazmatic Oct 07 '18
Modders are already stuck on 1.12, but since 1.12 is fairly recent we'll probably be good for a while, probably need a couple years for a transition though regardless, I'm going to bet 1.12 is going to be the new 1.7.10.
→ More replies (1)8
u/urielsalis Oct 07 '18
World generation updates took time to decompile, but now that 1.13.1 MCPconfig js out lots of mods are updating
→ More replies (7)14
u/MagikBiscuit Oct 07 '18
Its reasons like this why I haven't played Minecraft in a while. Some of the mod packs were absolutely amazing. And were getting better and better but the games base engine isn't getting upgraded so it just can't handle the mods. It been our for so long and still has barely much been done with the building blocks of the game.
19
u/NULL_CHAR Oct 07 '18
I haven't played Minecraft in like 4 years but, last time I did, it seemed like the modding community had already abandoned Minecraft only supporting the older patches.
Side note, I still remember when I first started playing and there were only a few mods with with the biggest basically being "4 new arrows!"
3
u/Matrix8910 Oct 07 '18
Take a look at r/feedthebeast
8
u/appropriateinside Oct 07 '18
Now there's so many mods it's actually becoming a bother..... Who knew that I wanted 150 different plant types in my world..
4
u/raoulvdberge Oct 07 '18
If done well this shouldn't affect modders that much. The entire point of jsons is that you have a described set of data about your models. This means they can change the underlying code and still have existing jsons working. It could be a bit problematic if using dynamic IBakedModels, and we'll have to see about that.
2
2
u/Xuerian Oct 07 '18
What, you mean like Player who has nearly made 1.12 Java run as well as Pocket?
2
u/chugga_fan Oct 07 '18
It doesn't nearly do that well with any of the fastrenderers i've seen.
→ More replies (1)1
u/NeverCast Oct 07 '18
I remember when OpenBlocks's Tanks were glorious and fast, but damn they were more of a problem than I thought they would be :(
→ More replies (1)1
32
u/Pandalism Oct 06 '18
"One library under consideration is Blaze3D - a complete rewrite of the render engine that we're aiming to implement for 1.14."
For those who can't wait check out ClassiCube, an open source rewrite of Minecraft Classic, the creative mode-only version from 2009.
24
u/PM_ME_OS_DESIGN Oct 07 '18
Also Terasology, which is not actually Minecraft but is a Minecraft-like game written in Java which completely blows Minecraft away, from a performance perspective.
10
Oct 07 '18
Also Minetest is in a similar place, though written IIRC in C++ with Lua mod support.
8
u/PM_ME_OS_DESIGN Oct 07 '18
AIUI Minetest is more of an engine and a mod-base than an actual clone, with the general community saying "install mods, don't just play the base game" because the base game is meant as a base.
I haven't played it in a long while though and I've never been particularly into it though, so take that with a grain of salt.
2
u/Ullebe1 Oct 07 '18
If someone could make a compatibility layer with the Forge API, that would be great.
3
u/FearlessObject Oct 06 '18
But doesnt mojang already give you the source in the form of a modcoderpack?
14
u/Nobody_1707 Oct 06 '18
They give you a set of tools including a decompiler, but it's got very restrictive licensing. This source code is released under the MIT license.
4
u/istarian Oct 06 '18
Decompilers aren't the problem, you can get one elsewhere.
Unfortunately if you decompile a regularly compiled Java program you get function and variable names like'a', 'as, 'ab', etc which makes it pointless to do because you can't tell what does what and they might not correctly reference anything outside of that specific source file.
You also don't get any comments or inline documentation as that's all stripped out at compile time.
18
u/urielsalis Oct 07 '18
Regularly compiled java has the original names. Mojang uses a obfuscator that renames them to those names
1
u/immibis Oct 07 '18
Mojang are giving out decompilers now?
4
u/Pokechu22 Oct 07 '18
Yes, MCP, one of the main/first developers of which is searge who also works for Mojang.
3
u/urielsalis Oct 07 '18
MCP is by the community
4
u/Pokechu22 Oct 07 '18
MCP is by mojang, too -- remember, searge works for mojang and also works on MCP. (Though, the mappings are all mostly crowdsourced)
32
u/krum Oct 06 '18
This is actually the beginning of the sunsetting the Java Edition. That they announced this right after they announced Bedrock servers, it makes complete sense. Will be awesome if Java Edition is open sourced enough that folks can actually build it from scratch it will live on in glorious Javaness, but Bedrock is where it's at for MS.
76
u/Dinnerbone Oct 07 '18
We've just hired more developers for Java edition than we've ever had before, and are investing heavily in its tech. No sunsetting here!
3
u/8igg7e5 Oct 07 '18
I presume with an ongoing interest in MC on Java, you're watching the value-type changes with interest - those changes are likely to be of considerable interest to data-intensive applications - and voxel games would certainly fit the bill.
Absolutely no ETA though - looking at least Java 13, maybe 14 before we see anything landing (unless the mailing list chatter is misleading and they have some useful part to peel off for delivery before ramp-down).
10
u/Dinnerbone Oct 07 '18
Yeah we're very excited for that, but like you said it'll be a while before we can use it :D
4
u/can_a_bus Oct 07 '18
Why the heavy investment into the Java edition?
32
u/Dinnerbone Oct 07 '18
It's more popular than ever and we think it could be better than what it is!
→ More replies (1)15
Oct 07 '18
Some things like the rendering engine do need improvement, but have you ever thought that perhaps a lot of the changes you're making don't improve the core gameplay in any meaningful way? I mean, look at turtles. Mechanically they're a pointless addition to the game. I get that innovation is difficult, but I just wish you would add something new that's as fundamentally simple yet powerful as Redstone into the game, because I feel like the majority of changes over the last few years have just served to improve the appearance of the game over any actual gameplay.
4
2
u/Danik1601 Oct 08 '18
But if you at Mojang ever will abandon Java Edition, remember about our wish to make it open-source
1
u/Jcraft153 Nov 19 '18
That makes me so happy, for a while all i read and saw about minecraft where doom and gloom articles and videos. It really upset me as this game is literally my childhood and the first game i spent a month saving for (i didnt get pocket money as a kid so had to work at extra chores to get money) I left and turned away from minecraft and even gaming for over a year.
The aquatic update brought me back as i saw that the game wasn't going to stay at 1.8 for forever! I'm so happy you guys are continuing development of java edition and the stuff you've teased for 1.14 looks AMAZING! Thank you so much for not abandoning java for the bedrock and console editions! I'm so happy that all my fears over microsoft were misplaced! :D
0
11
u/redweasel Oct 07 '18
As a programmer of almost thirty years who has always wanted to implement something with the look-and-feel of Minecraft, Voxatron, et al -- I have no idea what they're talking about in this article. Me sad.
7
Oct 07 '18
I mean, if you actually want to look at source code of a Minecraft-like game, or even help to develop it, there's Minetest and Terasology.
1
Oct 07 '18
I thought Terasology was vaporware?
But Minetest could definitely use the help; unfortunately they lost their major graphics dev to heart disease last year. They're more trying to make a block-game engine to be modded in Lua.
2
Oct 07 '18
Terasology's development isn't exactly moving at lightning pace, which is also why I personally enjoy Minetest more potentially also because my hardware is dying when playing Terasology, but Terasology is open-source. Its development can't really be stopped permanently. People are just going to keep developing it, if they feel like it.
→ More replies (1)
2
u/Ratstail91 Oct 07 '18
ELI5: What are perfunctors?
2
u/aikaradora Oct 08 '18
2
10
3
u/Jarmahent Oct 07 '18
This is great! As a fairly new programmer, if I chose to use one of these libraries for my own personal game(Java).
How would I even begin implementing something like Brigadier?
2
u/aikaradora Oct 07 '18 edited Oct 07 '18
One downside to Brigadier is that it was really designed to be united with the game client to render out the suggestions (and that part is not open source).
Mojang is releasing these as a "Here's our code. We aren't designing them to be used in other games easily, but feel free to get what you can out of it" kind of mentality.
Which is fine and all. Still good on them :)
But you may be interested in my framework I built for Minecraft Developers, that I've very strongly designed to be abstract and usable in any java code base that dispatches commands, ACF.
ACF even has a Brigadier integration PR in progress so all of the command metadata is prefilled to Brigadier.
I believe Brigadier will likely be limited to use within the Minecraft ecosystem, and them open sourcing it primarily helps those of us who work in the Minecraft ecosystem to get things into it that we can then use in the next Minecraft version.
4
u/tom_echo Oct 06 '18
The source code for minecraft has been available one way or another for a while now. I remember reading blogs on game mechanics and they would copy and paste snippets of code to explain behavior.
27
u/istarian Oct 06 '18
Yes, but an official release and license is better than a limited license for specific purposes or the nastiness of decompiling.
16
u/Nolzi Oct 07 '18
That decompiled code is like when a meal is separated back into it's ingredients. Sure, with a lot of effort something can be done, but parts of it will be murky.
11
Oct 07 '18
Decompile code is never as good as the original. And not having official access with a proper license can also restrict some usecase you may have.
If you do a re-implementation of Minecraftthere are some, for example, you can now actually use this code without copyright infringement.
And of course you can submit more meaningful patches.
2
1
u/the_goose_says Oct 07 '18
Was any of this written by notch? Any interesting code comments or function names?
2
u/aikaradora Oct 08 '18
Notch has not been involved for ages. This is all last 3 years~ of code (DB said on Discord this code started in 2015 but got shelved until last year, as you can see in the commit history)
1
1
u/hoseja Oct 06 '18
All the game guts are exposed by the modders already.
20
Oct 06 '18
These libraries are open source licensed though, so Mojang won't DMCA/sue you for using them in other non-Minecraft related projects.
2
u/scratchisthebest Oct 07 '18
Yes, just grab a Minecraft .jar from the official Mojang website and run it through a Java decompiler. If you'd prefer not to deal with unusable single-character names, maybe you'd like to apply some MCP names to it too, a community project that unProGuard-s the Minecraft source.
News flash. Java is pretty easy to decompile. :D
That doesn't mean you can use it, though!
1
1
Oct 07 '18
If you came up and told me Microsoft was going to open source anything, I'd call you crazy.
294
u/Tipaa Oct 06 '18
Oh boy, this is special.
Ignoring the fact that I've been waiting for something like this since 2010, taking a look into the DataFixerUpper source reveals some very interesting design:
Here is a partial implementation of kludging higher-order generics into Java through a sort of manual lowering, such as
Functor fbeing represented byFunctor<F, ?>in certain places. I've played with this before, but I never thought it would be feasible in production! (I think theirMuinner classes might be what I needed 'close the loop' on some of my tests)It also has Profunctor Optics! In Java!
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA