Hakase! asie's word space (warning: contains words)

So you want to replace Forge, huh?

EDIT (14/08/2016): After receiving input on the article, I have made certain corrections and improvements to its content. I would also like to point out the context of the article, as some have read it incorrectly

  • the article was written after listening to many, many people say that making a new mod loader is easy and put the blame on modders for not challenging the status quo, as some would like to see happen. This was intended as a set of instructions for those people, even though I could reasonably assume most of them would never carry on beyond complaining on anonymous imageboards, which is why why the first paragraph begins with an acknowledgement of /vg/ - one of the 4chan boards about video gaming where I was usually asked the question on. While one could still read it as a “call to arms” of sorts, it was really a form of attempting to show that saying is much easier than doing, which is acknowledged in the second paragraph.

Thanks to /vg/ for inspiration.

I get to answer the question of “Why don’t we just make a new mod loader?” surprisingly often, and - to be honest - I’m tired of it, so here’s a proper response from me to those people.

Are you an aspiring modded Minecraft community member annoyed at the way in which Forge is being run? Do you want to show everyone that it can be done better and not just whine about inefficiencies of the current developers on social media? Or perhaps you just want a new challenge? If so, this tutorial is for you!

If you want to set out on the missing mission to create a new modding API, you’re going to need to keep a few things in mind. First of all, Minecraft is obfuscated. You need mappings to translate method names like ahz.c into something more coherent and less changing every version. Where are you going to get them?

  • “Ah, yes!” says the young revolutionary. “I’m going to use MCP!”, he adds. Except he might run into some problems. Mod Coder Pack mappings have a fairly restrictive license, which means you cannot redistribute them without the explicit permission of MCP. However, despite Minecraft 1.7.2 bringing very close integration of MCP and Forge via ForgeGradle, the Coder Pack alone is still being updated, although far more quietly. You can do what Forge did pre-1.7.2 and wrap it with a series of scripts which plug your modding API in - however, that still means you need to distribute mods in the obfuscated format or acquire permission to use the mappings, because MCP’s version-consistent, unique-identifier-based intermediary mapping (SRG mappings) is still under the restrictive license - and its maintainers are not keen on giving the permission to others other general-purpose mod loaders. The SRG mappings were supposed to maximize mod compatibility across patch releases of Minecraft however history shows that it wasn’t anywhere near as useful as hoped, as those patch versions often broke very commonly used parts of the codebase which have come in handy on a number of occasions. In other words, you can use them, and they have many benefits, but with notable certain restrictions.
  • “Alright, then”, continues the visionary, “I will make my own mappings!”. Except he probably won’t. Minecraft is a massive codebase (over 250,000 lines of code) and documenting it all on your own, as well as maintaining it without access to Mojang’s own mappings, is very tough and unrewarding work. “Are you telling me that nobody made tools for it?” Of course they have! Cuchaz made a tool for deobfuscating Java software called Enigma. It includes many tools to help you figure out what a given field or method does, as well as intelligent algorithms - allegedly more powerful than MCP’s own - which match those deobfuscated names to new versions of the software. With this, I’d say it’s doable - but still a fair amount of work.
  • There’s also DynamicMappings. It tries to dynamically figure out the obfuscated names for classes, fields and methods while being given a set of directions based on the logic of the code using them. It is certainly an interesting approach, but impractical in the long run - however, FyberOptic is only targeting a subset of Minecraft.
  • Don’t even think about working on obfuscated code directly unless your mod is Dirt Podzol to Diamonds.

Okay, so now that you (hopefully) figured out the mappings, you need a mod loader - a tool to load JAR files from a directory into the classpath and initialize them so that they can execute their own code and hook into Minecraft while it is loading.

  • Mojang has made it a lot easier with the new launcher and Minecraft 1.6, as the game now includes the LaunchWrapper - a piece of code which runs before Minecraft and lets modders inject their own “tweaks”. This means you no longer need to patch the JAR to load your own code, which is great!
  • The only reasonable answer here seems to be Meddle, FyberOptic’s version-independent mod loader which relies only on the LaunchWrapper and provides no functionality by itself. Go use that - don’t reinvent the wheel.
  • There were historically many non-Forge-dependent mod loaders, such as Risugami’s ModLoader, LiteLoader and Cuchaz’s M3L. You might want to research how they worked.

Have a mod loader? Great! Now you can run your own mods, which is… kind of cool, I guess? They can’t really do much to affect the game itself, though - the hooks are missing! Now you’re going to need to start the slow process of implementing various hooks. Forge has a lot of features and it’s going to be hard to match even half of them, while MeddleAPI seems to only provide hooks for server-side crafting recipes, GUIs and block rendering. (It also forces you to input block/item IDs manually - thought that was provided by vanilla? Think again!) Here’s some of the examples of the hooks modders have come to expect the most:

  • Dynamic block/item ID allocation
  • Hooking the “custom payload” packet to let modders send custom packets from their mods
  • Hooks for custom block/armor models
  • Hooks for custom GUI spawning
  • Fluid API for intercompatibility
  • Some kind of dictionary for modders to have their mods be intercompatible
  • A way to define custom dimensions, biomes, loot, etc.
  • Events for ticks, player interaction, entities, block placement, breaking, etc.
  • Probably some other minor hooks I’m forgetting. There’s really a lot of it, though not all of it is strictly necessary.

If you have all of those and more, congratulations! Now you just have to find modders willing to use it

  • and if you prove yourself to be a lot more friendly while providing improvements over Forge, that probably won’t be a problem.

“Wait! Can’t I just fork Forge?” Um, no. While Forge as a whole is under a combination of the LGPL and the MFPL (a license similar to the MMPL) the LGPL 2.1 license, the MCP mappings bundled with it (for SRG<->Mojang remapping) are under the MCP license, with Forge being given explicit permission to redistribute them - that means you can’t. You can probably work around this by downloading the original Forge and extracting the MCP mapping file from there, but that’s a very ugly move. You could also fork Forge and replace its mappings with ones you make yourself, which is great unless you want to support any existing Forge mods.

My recommendation? Instead of whining about Forge, if you don’t like it, go help base your modding API on Meddle. It has great technology behind it and could use some support.

Oh, right! Don’t forget about all the people complaining you’re effectively ruining the community and splitting it in half over some petty nonsensical drama - from the perspective of the user, all the drama between modders is probably fairly petty, as they just want to enjoy their mods! To be honest, you’re probably better off making your own game.

BTM16 2.0 - the in-game modded Minecraft convention

Since I do not currently have the time to make a proper website for it, here goes the announcement: I’m excited to announce that the modded Minecraft convention, BTM, is coming back this July!

(A screenshot from the Winter BTM16 - see more, videos)

  • Date: 29th-31st July 2016 (the date changed! this one’s final, though)
  • Place: The Internet
  • Website: TBA
  • Minecraft Version: 1.9

BTM is a modded Minecraft convention which takes place inside the game itself, letting you interact with many exciting mods and modders live. This is the third installment of the event, with many events and attractions planned! You can find videos of the previous events on YouTube - it’s really fun, sometimes chaotic and definitely worth a visit - or a longer stay!

Our planned attractions include:

  • Keynotes and panels by a variety of modders, pack creators and other people in the Minecraft community - more and less known!
  • Mod booths, letting you interact with the latest and greatest mods and discover new features - as well as talk to the modders themselves!
  • The OpenComputers Demo Competition! Let’s kickstart the Minecraft demoscene together! (More information below)
  • Various ways to spend your free time, including but not limited to a music booth - people who were at the winter BTM might have a clue.
  • Many more surprises and special events we cannot announce yet!
  • Flamingo

To give you an idea of why it is worth to visit the convention, check out the in-game livestream we performed last BTM.

If you want to apply for a panel or suggest ideas, drop me an email on asiekierka “at” gmail “dot” com - keep in mind, however, that official registrations won’t open for a while still.

This summer, just like in winter, the server machine is being kindly donated by Resonant Host. This is important, as it let us (almost) withstand the storm of 120 simultaneous players with 25 mod booths ticking simultaneously - without having to pay a fortune. I’m sure we can provide a service as good, if not better, as the last time around.

Following are details on the OpenComputers Demo Competition, as that probably requires the most time to prepare. The rules might be updated in the next few days, but they should more or less stay the same:

  • The following categories are being considered: Demo, EEPROM, Game, Tool, Artwork and Wild. This is not final, however - categories with few entries may get merged into other ones and new categories might be created. We will show every demo, however voting will only be allowed in official categories. We might also consider separate Demo categories for Tier 1 and Tier 2 OpenComputers machines with RAM scaled accordingly - please contact us if you’re interested!
  • Entries are accepted until July 22nd. Multiple entries from one person are allowed (Marisa, don’t go too crazy please).
  • For categories Demo, Game, Tool and EEPROM:
    • The compo machine is an OpenComputers Case with a Tier 3 GPU, 2 megabytes of RAM, a Tier 3 Lua 5.3 CPU and the latest version of OpenOS available at the time. Additional cards/peripherals may be requested - especially for sound - however we do not promise they will qualify outside of Wild (especially if they overpower OpenComputers’s built-in capabilities)!
    • Hint from the organizers: OpenComputers has highly limited audio capabilities, but Computronics provides a Beep Card, Noise Card and a Tape Drive! Do look into them.
    • If you use the Tape Drive for audio, generating your music inside OpenComputers is considered good form even if it requires preload time to write to the tape.
    • Any additional requirements, the author(s) and a short comment will be shown on an info panel before the demo is displayed.
  • For categories Demo, Game, Artwork and EEPROM:
    • No wireless/Internet connectivity is allowed - your demos must be self-contained.
  • For categories Demo and EEPROM:
    • If your demo requires any user input, please let us know. If your demo requires any custom OSes/preparation, please let us know.
  • In the Demo category, your demo must fit on one unit’s worth of an OpenComputers storage medium (floppy disk or hard drive). Please note that floppy disk contributions are encouraged as they’re cooler - and if we get enough of them, we might make a separate category for them!
  • In the EEPROM category, your demo must run fully off an OpenComputers EEPROM card and load no external data.
  • In the Game category, we’re going to do our best to play your game - please provide some sort of documentation on how to play the game.
  • In the Tool category, you can show non-game applications for OpenComputers - though this will probably involve you either providing some sort of demonstration or showing it off yourself (in which case, audio chat is necessary).
  • In the Artwork category, your demo should be in the form of a static display on a Tier 3 GPU, coupled with its own Lua-based loader.
  • For the Wild category - go wild! You can use Robots, Drones, even TIS-3D or redstone! If you want to use a completely different mod, let us know beforehand so we can discuss it and install it.
    • Note: Your demo can’t bring down the entire server in lag. Vanilla redstone might not be a good idea - we recommend Glowstone Cooling(tm).
  • If you need any additional mods, please contact us beforehand (at least 2 weeks before the convention) to discuss. We will definitely deliver the development builds of OpenComputers, TIS-3D and Computronics current for mid-July 2016. We reserve the right to move entries using additional mods to the Wild category, as well as to not allow certain mods.

For examples of what can be done with OpenComputers, we recommend to look at the OpenComputers forum. Here’s some reasons why you should look into OC as a democoding platform:

  • Neatly sandboxed - meaning some interesting limitations and it won’t grind the server to a halt
  • 160x50 Unicode GPU with 256 colours (16 configurable) and a fair set of operations
  • Lua 5.3-based powerful and modular architecture
  • Helpful community and good documentation

Feel free to take a look at this for documentation, and this or this for inspiration.

We recommend exploring OpenComputers, as well as other mod peripherals such as the Computronics Beep Card, Noise Card (audio cards :D) and Tape Drive.

Final note, the GPU call limitations:

  • Getters are generally free.
  • Tier 1 GPUs provide 64 cycles, Tier 2 GPUs provide 128, Tier 3 GPUs provide 256.
  • Tier 1 GPUs provide 2 colors, Tier 2 GPUs provide 16 colors, Tier 3 GPUs provide 256 colors (16 definable).
  • setBackground/setForeground/fill take 2 cycles, copy takes 4, set takes 1, setPaletteColor takes 16.
  • PS. On tier 1 GPUs, setPaletteColor takes 32 cycles.

Passing thoughts of the day

Mod licenses: It's 2016.

I ran across a particularly bothersome Minecraft mod license today, reminiscent more of the 1.2.5 modding days than the modern era. I’m not going to name the specific mod, however I’d like to look into it a bit deeper. The license is not only restrictive, it is also flawed.

Charset Development Log #1

Hello! This is the first of a series of articles describing the happenings in Charset Minecraft mod development. Charset is a Minecraft mod which aims to provide a modular variety of features, including but not limited to wires, gates, pipes, machinery and various tweaks.