November 19, 2012

Tetris

On Saturday I was competing in an artificial intelligence competition. The objective of the game was to play head to head against other people at Tetris. The game is played with two teams, each team has a program running directly against the opponent teams program. The game is designed around needing to survive as long as possible while working to add lines to the opponents board, and thus forcing them to lose. To add a line to the opponents board you need to score two or more lines in a single move. The lines added to their board will typically have 5 holes, but could be as few as 1 hole, or a full empty line being added to the bottom.

The event was sponsored by Pason which is a very interesting company and from my initial impressions it appears to have a great work atmosphere. For the competition, each team can be either one or two people. I believe in total there was 48 teams registered. However, only bit more than 20 teams competed on the game day, which is still a fairly decent sized group. The morning round started off as a round robin with the main focus on getting a ranking for the elimination round. I ended up starting off in second position for the elimination round and was feeling pretty confident about my program. I made my way up to the finals and was pleasantly surprised by my opponent who wrote an excellent program. I lost the final round 34 to 72 in a match which started off with my program winning, but roughly halfway through the tables turned and I started to get dominated. A surprise, but a very respectable match and I congratulate my opponent on a wonderful challenge.

I had a blast and enjoyed the challenge of coding up a Tetris game and then designing and building an AI to play it better than I ever could. It was a good experience and I finally got to play around with Gson and JCommader. They are two libraries I am very impressed with and hopefully I will be able to work with them in the future. Gson offers an interesting version of serialization which is extremely easy to use but also a viable candidate for cross-language serialization. I personally like JSON significantly more than XML, but sometimes complex cyclic relationships are required and JSON isn't going to help you there. However, cyclic relationships are typically a bad practice anyways... The only places I use them are typically not candidates for serialization.

I guess second place on its own doesn't sound very exciting, but it does mean I won $1250 and I also got a $100 gift card for beating Pason's AI at Tetris. I have been asked what I will be doing with the money, my first thoughts are school and saving it up for tuition. I am also thinking to simply save the money for now as I'm sure in graduate school I will need extra money. As I mentioned before, I am currently taking a break from Combatics Evolution, but I am also making some good progress on Paint Party. While the application is still in its infancy, things are coming along smoothly and I'm hoping my team is up to the challenge and ready to dig into a decently complex project.

Next week I'll be attending an award luncheon for an Engineering Internship Merit Award. I'm extremely excited to have been awarded for my hard work at Autodesk. To top it all off, I have also been informed I've been recommended for the NSERC Scholarship by the University of Calgary. This has been a very exciting month!

November 17, 2012

The Current State

I have been very busy over the last few weeks and because of it I haven't had time for Combatics Evolution. I've decided to take a break from working on the game as I just don't have the time to commit to it right now. I played around with a prototype of a survival platformer game, it was a nice break from the regular work. I also was working on building an AI for a Tetris competition. That has been taking up a good portion of my time, its for Pason and I enjoyed working on it.

For the Tetris competition I got to play around with a few libraries I haven't had a chance to work with before so it was a good experience. Hopefully it will go smoothly, but I have a bad feeling the networking latency will play a bigger role than the ability of my AI. Lets put it this way, my AI can do 600k to 2M lines of Tetris in a couple minutes, but throw networking and a server on AWS, I do maybe 160 lines in a LONG game that usually takes a few seconds.

I also have been working on PaintParty, I hooked up the networking, basic interface and setup the serialization for the project to basically kick start it. I was surprised it only took me a few hours... but I guess that it was what happens when I'm reusing a lot of code from Combatics Evolution. Anyways, competition day, hopefully things go well :).

November 2, 2012

Two Week Cycle

I have to say, a one week release cycle is great when I don't have much going on. However, as things have been rather hectic and I'll be focusing on another major project soon Paint Party, I want to reduce the pressure on myself and switch to a two week cycle.

This week has had virtually no work on Combatics Evolution. Partly because I was exhausted from last week, partly because I am currently exhausted from this week, and I wanted to take a small break and play some Dishonored. Between midterms, exams and labs there simply isn't enough time to fit in any development during the last week. I'm still looking towards getting the combat ready for multiplayer as that will be one of the biggest features. Once I have it in a working state I will then be able to focus my attention more on performance and content. I have come across a few little tools I'd like to utilize for this project so I guess not all of my time has been wasted:

JCommander

For the server-side console I want to get JCommander to parse and process commands. The tool is designed to simply parse program command arguments, but the design of the library allows it to very easily be used for processing console input.

Sqlite4java

While Sqlite4java it isn't a pure-java solution it does support android, which makes it a great candidate for working with SQLite. I am planning on using SQLite as my datastore for profiles, as the current solution is really just a temporary way to get it working.

Apache Pivot

Typically I avoid using Apache for Java because of how they like to use various parts of their other libraries. While code-reuse is great, I don't like it when it comes to libraries because using different ones typically means I need to adopt large parts of the ecosystem for the dependencies. Some I can trim out with proguard, but when you have dependencies and the libraries have dependencies things get rather ugly with proguard very quickly. Anyways, Apache Pivot seems to offer a very handy set of features for building UI, I may consider this for a server admin UI in the future. I don't want to use Swing, AWT, or SWT so my options basically get very limited with Java.

Other JVM Languages

Clojure I don't really like, and I would much rather use the Python over it. In the years to come my opinion may change, but for now I won't touch it. It does work with android, minus a few quirks so if time permits I may dig into it some more. It does have a CLR and a Javascript version which would also be handy in other projects. It just hurts me a little bit when looking at the syntax and style. :(

Groovy is pretty cool, because it really focuses on adding very powerful constructs to Java. Groovy offers a clean syntax and really embraces the idea of being more of an extension to Java than a replacement. However, I'm not yet convinced about it since support on Android isn't good enough. 

Scala is awesome, and I would use it for my project if the Scala IDE plugin for eclipse is showing a ton of promise. However, until I get better integration with Eclipse I have no incentive to use it. I just feel naked coding in Scala without robust tool support... It works well with android, it is a little messy mixing it with Java code, but still workable. If anything, I would consider Scala in the near future as my main programming language since it offers a ton of high-level features and the complexity of the language is the only real hurdle. It does have a CLR version, which makes it highly attractive.