17 ms·
It's extraordinary to me that Minecraft is both the game that has the most robust mod community out there and that the modders were working from obfuscated, dec
by NelsonMinar 11mo ago
It's extraordinary to me that Minecraft is both the game that has the most robust mod community out there and that the modders were working from obfuscated, decompiled Java binaries. With elaborate tooling to deobfuscate and then reobfuscate using the same mangled names. For over a decade! What dedication.
- krackers 11mo agoMe too. Having only a vague familiarity with the game, I thought that mods were using some official plugin system. I had no idea that minecraft modders (presumably kids/teens?) were not only reverse engineering things but also creating an entire ecosystem to work around proguard.
- bitexploder 11mo agoOver time people learned the key APIs and classes that you needed to interact with. And obfuscated Java is like an order of magnitude easier to work with than machine code. Once someone figured out how to do something it was generally pretty easy to use that interface to do your own thing. Modders of course still often hit edge cases that required more reversing, but yeah, it was really cool to watch over the last 15+ years :)
- 6SixTy 11mo agoThere is and kind of isn't. There are community led modding apis, but also datapacks that are more limited but still allow someone to do cool stuff leveraging tools, items, etc already in the game. If you remember entire contraptions of command blocks doing stuff like playing Pokemon Red in Minecraft or "one commands" that summoned an entire obelisk of command blocks, the introduction of datapacks pretty much replaced both of those.
- immibis 11mo agoDatapacks kind of ruined the Java side. Instead of (metaphorically) "grass.colour = green;" now you have several layers of indirection to look up the mapping of block types to colours, in several real and virtual entity-attribute-value stores that shadow and inherit from each other, and the easiest way to make grass green becomes to write a data pack - with all the limitations of that, not to mention the obscure syntax (do you write "{"inherits":"dirt", "variables":{"colour":"green"}}" in stuff/things/blocks/grass/index.html.json?) This is called the inner-platform effect, where in order to avoid programming in the original language, you invent a worse programming language. Apparently it used to be a big killer of enterprise software. It's also one of the reasons Minecraft needs ten times the RAM it used to. To be fair, we have fifty times as much RAM as we did when Minecraft came out, but wouldn't you rather have it put to use doing extended view distance, extended world height, and shaders?
- nightpool 11mo agoNot only working around proguard, but Minecraft mods are built on top of an incredibly cool and flexible runtime class file rewriting framework that means that each JAR can use simple declarative annotations like @Inject to rewrite minecraft methods on the fly when their mod is loaded or unloaded. This massively revolutionized mod development, which was previously reliant on tens of thousands of lines of manually compiled patches that would create "modding APIs" for developers to use. Putting the patching tools in the hands of the mod developers has really opened up so many more doors. Minecraft also has a plugin system based around JSON file datapacks, but it's a lot more limited. It's more at the level of scope of adding a few cool features to custom maps then completely modding the game.
- LelouBil 11mo agoThe devs for Java Edition really have mods in mind nowadays. - They left in the code debug features that they used to strip out. - They left in the code their testing infrastructure that they used to strip out as well. - They started making everything namespaced to differentiate contents between mods (like in this week's snapshot they made gamerules namespaced with the "minecraft:" prefix like items and blocks and whatnot) - They are adding a lot more "building blocks" type features that both allow new /easier things in datapacks, and in mods as well. Method patching with Mixins is less needed now because the game's internal APIs are more versatile than ever.
- nightpool 11mo agoThat's definitely true, and I think that's a testament to Minecraft / Java's strong OO design—it dovetails very nicely with the Open/Close principle. However my view is that for a mod to be a mod, there's always going to be stuff that you can't/shouldn't implement just with datapacks—whether that's complex rendering features, new entity logic, or whatever. The Mixin processor makes it really easy to build these kinds of features in a very compatible way
- hyghjiyhu 11mo agoThese tools sound very powerful, could they find use for other Java codebases?
- Nition 11mo agoI remember Notch saying in 2010 that he planned to add an official modding API, but it never actually happened. --- Edit: https://web.archive.org/web/20100708183651/http://notch.tumblr.com/post/772794270/server-scripting https://web.archive.org/web/20100708183651/http://notch.tumb...
- bayarearefugee 11mo ago[flagged]
- whacko_quacko 11mo agoI'm sure you're fun at parties
- deleted 11mo ago[deleted]
- astrange 11mo agoOne thing I always notice about this kind of post is that it never only has one accusation of oppressing a demographic group. There's always three of them at once. Makes it feel lightweight I think.
- culi 11mo agoNotch's problematic behavior and views are well-known in the community and both Mojang and Microsoft have had to distance themselves from him. To the point that they had to remove all instances of "notch" in the codebase Here's some examples, particularly of his antisemitism to better illustrate the issues https://xcancel.com/jacqui_Val/status/1111080126345826305 https://xcancel.com/jacqui_Val/status/1111080126345826305
- saagarjha 11mo agoTurns out people who are like that rarely constrain it to one demographic.
- nightpool 11mo ago
- Philip-J-Fry 11mo agoMost modders aren't reverse engineering the game. There's a small community that are doing the obfuscation and then everyone else is effectively working from normal Java code.
- vintermann 11mo agoIt's that way for most modding scenes. Someone makes an API/mod loader which makes it easy, then a lot of enthusiastic players make mods.
- chillfox 11mo agoWhile I don't doubt that some mods are created by teens, just under half of Minecraft players are adults.
- userbinator 11mo agoI wonder how much overlap Minecraft modders have with the Android custom ROM/app-modding community, another thing that the easy "reversibility" of Java has spawned.
- creatonez 11mo ago> I had no idea that minecraft modders (presumably kids/teens?) [...] Players who were teenagers when the game first came out are now 29 to 35 years old. It's a pretty ancient game at this point. From my experience, most contemporary modders are in their late 20s. We're still relying on legacy code written by inexperienced kids, though...
- imtringued 11mo agoYeah you got it backwards. Mojang refused to add a modding API, because Notch knew that the community has more freedom the way things currently are.
- Aerolfos 11mo agoActually more common than you might think. Bethesda games have the same ecosystem - they do provide an official plugin system, but since modders aren't content with the restrictions of that system, they reverse engineered the game(s, this has been going on since Oblivion) and made a script extender that hacks the game in-memory to inject scripts (hence the name).
- 1313ed01 11mo agoI am terrified by Minecraft mods always being distributed from dodgy download sites and not rarely come with their own Windows EXE installers. And as far as I know there is no sandboxing at all in the game (uhm, no pun intended) so once installed the mod has full access to your computer?
- trenchpilgrim 11mo agoYup very common to take a popular minecraft mod, insert malware, rehost it, and seo your way into getting downloads.
- superb_dev 11mo agoThis is not the norm these days! There are popular mod loaders like curseforge that pulled from moderated repositories. It’s still not bulletproof, but a far cry from trusting some installer executable
- Imustaskforhelp 11mo agoI prefer modrinth as well, both are good but curseforge has done some things which makes us require an api etc. for true automation where modrinth is genuinely nice. I used to use prism launcher which would just give me a search box and It on the side would have things like modrinth / curseforge etc., Usually I preferred Modrinth but there were some modpacks just on curseforge only but I never really downloaded a shady modpack from some random website aside from these two, In fact sometimes I never opened up a website but just prismlauncher itself lol
- superb_dev 11mo ago+1 for Prism Launcher and Modrinth! I use Prism on my Steam Deck. I would’ve mentioned them both but Curseforge was the only name I could remember
- SkiFire13 11mo ago> I am terrified by Minecraft mods always being distributed from dodgy download sites and not rarely come with their own Windows EXE installers. That's not their main mean of distribution, most often those sites were just third parties unrelated to the mod authors that repackaged the mod and somehow got a better SEO. But TBF back in the days the UX/UI for installing mods was pretty terrible. Nowadays there are more standardized and moderated distribution websites from which you just download the .jar of the mod. > And as far as I know there is no sandboxing at all in the game (uhm, no pun intended) so once installed the mod has full access to your computer? This is totally true though.
- userbinator 11mo agoMore proof that you don't need the source code to modify software. Then again, Java has always been easy to decompile, and IMHO the biggest obstacle to understanding is the "object-oriented obfuscation" that's inherent in large codebases even when you have the original source.
- pphysch 11mo agoAgreed; modding obfuscated Java is impressive, but not quite on the level of modding in the (Nintendo) emulation community. The things that have been achieved with classic Nintendo titles are absurd, like adding high-performance online multiplayer to Super Smash Bro. Melee.
- karlding 11mo agoSaid online multiplayer [0]. The devs also wrote a write-up here about how they handle the desyncs in netcode [1]. [0] https://slippi.gg/ https://slippi.gg/ [1] https://medium.com/project-slippi/fighting-desyncs-in-melee-replays-370a830bf88b https://medium.com/project-slippi/fighting-desyncs-in-melee-...
- ed_elliott_asc 11mo agoTbh decompiling software and figuring out how it works isn’t easy but that is part of the fun :) - it’s the reason ive ended up following many of the weird paths in computing that I have
- beachy 11mo agoFirst time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in the real world a person can be both employee and contractor at the same time, can flit between those roles and many others, can temporarily park a role (e.g sabbatical) and many other permutations, all while maintaining history and even allowing for corrections of said history. It would be hard to find any domain less suited to OO that HR records. I think these terrible examples are a primary reason for some people believing that OO is useless or worse than useless.
- ZeWaka 11mo agoTo be fair, since 2019 Mojang has been providing the mappings instead of everyone having to use community-created ones.
- tripplyons 11mo agoIt took me a while to find how to obtain the official mappings, but this article seems to have instructions: https://minescript.net/mappings https://minescript.net/mappings According to the article, official mappings can be found here: https://piston-meta.mojang.com/mc/game/version_manifest_v2.json https://piston-meta.mojang.com/mc/game/version_manifest_v2.j...
- mikkupikku 11mo agoThey're also linked on the wiki page for each release, along with links to the client and server jars: https://minecraft.wiki/w/Java_Edition_1.21.5 https://minecraft.wiki/w/Java_Edition_1.21.5
- zachrip 11mo agoWhy do they obfuscate if they're just going to provide the mappings?
- kulahan 11mo agoWell, maybe that's why they're not obfuscating anymore.
- singron 11mo agoProguard can also apply optimizations while it obfuscates. I think a good JVM will eventually do most of them itself, but it can help code size and warm-up. I'm guessing as JVMs get better and everyone is less sensitive to file sizes, this matters less and less.
- mort96 11mo agoAnd there's no way to do only the optimisation part? Surely you could optimise without messing up class and method names..?
- deleted 11mo ago[deleted]
- Karrot_Kream 11mo agoJava is pretty easy to decompile and it's not a huge amount of effort to poke into the generated JVM code and start doing things. If you have a decent idea of how VMs work, C-like languages work, and how object dispatch works it's really not that hard. Also the early modding scene for Minecraft was really fun. I was a huge Minecraft player at the time and was early into the deobfuscating -> modding scene and the community was one of the most fun computing communities I've been in. Due to how focused it was on the game and its output it wasn't bogged down in nearly as much bikeshedding and philosophy as most FOSS projects get. Honestly one of the highlights of the coding I've done in my life.
- mort96 11mo agoDecompiling Java is trivial, as Java bytecode more or less maps directly to textual Java code. Deobfuscating is a monumental manual effort.
- gretch 11mo agoIn 2004 I played an MMO game on a pirated server. The owner of the server somehow got a version of the server binary, and used a hex editor (!) to add new features to the binary over time. It's the closest I've ever see to someone literally being one of the hackers from Matrix, literally staring at hexadecimal and changing chars one at a time
- Loughla 11mo agoThat's a level of dedication that I have never devoted to anything in my life. That's energy that could change the world if harnessed correctly.
- abtinf 11mo agoIt did change the world - it made it better for players of the game.
- int_19h 11mo agohttps://doomwiki.org/wiki/DeHackEd https://doomwiki.org/wiki/DeHackEd
- madog 11mo agoPresumably they were using a decompiler e.g. IDA Pro to know what characters to change in the hex editor? I've done that before to find offsets in the binary to NOP out some function calls.
- twothreeone 11mo agoThat approach is also super useful if you're manually flashing an image onto some embedded thing (like an ECU, or other types of boot rom). Of course on many modern systems you'll have to get around the checksum guards, but there's typically all sorts of glitch hacks to do that.
- Zardoz84 11mo agoI just remember when I cracked Space Empires III shareware as child. I didn't release the crack. Plus was a bit crappy, needing every time that I loaded the game, write a wrong serial so the check thought that was right serial code. I simple changed a few x86 opcodes to invert the check condition...
- kachapopopow 11mo agoit's actually pretty trivial and something a single person can do I had to rebuild a server jar to source since the guy maintaining it disappeared and it had special behaviors in it that were relied upon for the game networks playability.
- quantified 11mo agoI watched one of my young children power themselves through the obfuscation to learn advanced modding. There was zeal for the knowledge and mods in that community.
- strbean 11mo agoThis was how many Runescape bots were developed back in the OSRS days. At some point (RS2?) they made the client super thin so there were no longer methods for high level game functionality (walk to here, get amount of gold in inventory, etc.).
- odo1242 11mo agoTo be fair, the tooling existed before Minecraft and they published obfuscation maps that map the obfuscated names to the non obfuscated ones.
- foxyv 11mo agoMod developers were able to get the source code for Minecraft through a developer program over a decade ago. I'm not sure that it is still the case. I think they are just de-obfuscating the compiled CLASS files so anyone can decompile them without access to the source.
- enknamel 11mo agoThis is fairly common in gaming mods. I wrote some mods myself and had to work with decompiled obfuscated code to find the right hooks, injection points, reverse implementations, etc.