Porting TTT

Disclaimer: This is a very non-technical post. Proceed at your own risk.

About a year and a half ago (oh God, has it been that long?), I had the idea to make a Minecraft minigame based off of the Garry's Mod gamemode Trouble In Terrorist Town. So I did. I called it Trouble In Terrorist Town because I'm really original, and later rebranded it to TTT to give it at least a little uniqueness. And then about a year later (February of this year), I decided that it would be just an absolutely brilliant idea to create a minigame engine based off of the plugin in the form of a library.

Oh, how I paid for that decision. It wasn't a bad one per sé; I just didn't realize the amount of effort that would be required. My original goal was to have a production build of the library, called MGLib, available by April. It's now July and I'm just preparing to push it. The real kicker is that I put development of TTT on hold until MGLib was ready, which was bad because it had a decently-sized fanbase, and it was pissed.

But, I digress. As I said before, MGLib was based off of TTT's engine, and as such, it was fairly easy to port to. Some of the library's code is basically unchanged from its counterpart in TTT's source. A great example would be the lobby manager. I just copied the class and stuck it in MGLib's project, added a few lines of extra code as "glue," and that was that. The only main components that were really written from scratch were the arena and rollback managers. Everything else is just a modded version of TTT without the minigame-specific code like the karma system.

A couple weeks ago (or something like that), I finally decided it was time to start updating TTT. I was having trouble figuring out how to begin, so I decided to just jump straight in and rip out its timing system. Obviously, this made my IDE pretty angry. But that was good, because I was able to go through and fix any compile errors that showed up. As I went through, I came across blocks of code, methods, and even entire classes that were completely obselete. So to speed things up, I copied anything from them that needed to be ported and ripped them straight out as well, then got to work on an MGLib implmentation of their function (depending on whether one was even necessary). More and more compile errors. But they were good, because they showed me what needed to be changed. As I worked through, the number dwindled, and finally I had a compilable JAR.

That's not to say it ran. There were still a whole bunch of issues that arose from the port which required a bit of thinking. I eventually arrived at a version in which players could actually join rounds, which is around when I started testing with others. I have a lot of respect for those people, because they put up with so much crap that my unfinished builds threw out. The biggest milestone was when we were able to stop orchestrating the rounds ("Okay, so one of the innocents needs to kill the other, and then the traitor needs to kill the detective, and then...") and just play the minigame. Every once in a while a bug would pop up; I'd fix it and we'd keep playing. It was fun at that point.

As of writing this, the final version hasn't been released, but I feel comfortable in saying that I've caught all major bugs in both TTT and MGLib. Hopefully, we'll release within a few days, and everything will go smoothly. But is anything ever really that simple?

Posted by Max Roncace on August 9, 2014

Log in or register to post a comment!

No comments to display!