Assignment One: Robocode


Questions should be emailed to Yisheng Tang


Description

Robocode is an IBM product that allows you to write a AI-controlled battletank in Java. Your tank can be as simple or as sophisticated as you would like. Your bot will then be pitted against other bots in class in a battle to the death to see whose bot is the best.

Here are the slides from the presentation.

Installation

Head over to the RoboCode website here. Here you will find a link to download the robocode-setup-x.y.z.jar file from SourceForge.net. If you cannot find it.. Here's a link
Robocode should work on any OS that contains Java support, but we have only tested it on Windows XP and Fedora Core 1 Linux, so we suggest you use one of those systems. Download the jar file to your system and execute it (usually by double-clicking). If double-clicking is not working, then try to use following command:
java -jar robocode-setup-x.y.z.jar
This should set up and allow you to launch Robocode on your system. Be sure to select "create shortcut in start menu" to make it easier to run the program.
When executed, you should see something like this:

Starting a New Bot

There is a tutorial on the SourceForge website explaining how to create a simple bot. Click here to take a look at it. It will familiarize you with the basic bot structures and show you how to set up competitions to test your bots. Once you have completed the tutorial, you will need more detailed information to begin customizing your bot. The best place to start looking is the bot wiki, which can be found here.

Assignment

Using the same process you used to create your first robot, you should create a robot team containing four bots. These bots can be combined in any way you see fit. Your entry will be tested in two ways: The first is the standard attrition ladder bracket. All initial match ups will be determined at random. If there is an odd number of robots, one will be given a pass in the first round. An example ladder is below:

Each teams score will be determined by the sum of all their bots' points. The winner will be the team with the most points.
In this example, there are four teams. In the first round, team one and three win. They move on in the bracket while team two and four are entered into the "Loser's Bracket". In the next round, one and three & two and four square off. Team one wins and moves on while team three faces the winner from the two and four match. Teams two and three then play with team two moving on to face the winner of the winner's bracket. The championship is the winner of the winner's bracket vs. the winner of the loser's bracket. In this case, teams one and two duke it out with team two being the overall winner.

As this competition will happen in one day no changes will be allowed to the bot in between matches. The second test will be a free for all where all bots are pitted against all other bots in the same arena. After 10 rounds, Robocode will produce a synopsis of the battle. An example is below.


There are three parts to this assignment:

  1. The Bot - When creating your robots name each one uniquely and put them all in the same package named by your team. Once your bot is complete, go under the Robot menu and select "Package robot for upload".
    In the resulting dialog make sure to include all the names of your group members. While you will not be graded on your bot's performance in the tournament, you will be graded on the quality of your implementation. That means if your bot gets stuck in a corner for 10 minutes, you will lose points. This will also include a code audit for commenting, design and other coding standards [85%]. Please e-mail the 4 JAR files (one for each bot) to Yisheng Tang no later than 11:59PM EST February 6 (i.e., the day BEFORE the competition)
  2. Presentation - A 3-5 slide power point presentation giving the basics of your bot design. What makes your bot different? Why will it win? This must be short (ie. 5 minutes). Please bring a printout of your presentation [15%]

FAQ

  1. You cannot assume that the battlefield will be of a specific size. Your bot must adjust to all possible sizes. See the robocode.Robot.getBattleFieldWidth() and robocode.Robot.getBattleFieldHeight() methods for details.
  2. You must manage your gun's heat! You can only fire your gun when the heat == 0. You will need to use the cooling rate and energy of each shot to manage the gun's heat. Also, hitting the wall, or any other object does damage to your bot. This kind of rules can be found here: Rules.java
  3. No overriding the onDeath method to do anything stupid. If you die, you die. You can't respawn, or pop up a window, or play some Windows sound. Same with onRobotDeath. Just don't interrupt the match to taunt the guy you just killed and you will be fined.
  4. Inheriting from the AdvancedRobot class will be helpful in writing an advanced bot. Your bot may write to files to improve it's AI. However, keep the writing to a minimum (200K is the file size limit). If all the bots are spewing out tons of information, the battle will be very slow.
  5. Use the examples! While the example bots are pretty useless, each one implements a feature that might be of interest to you. Combine some of these together and you will get some useful behavior. NOTE: DO NOT use the Robocode Repository to copy code! Be fair and honest with your work!
  6. Friendly Fire! Don't go trigger happy! Read THIS documentation to find out how inter-robot-communication works and how to avoid friendly fire!
  7. read http://robowiki.net/wiki/Robocode/FAQ and http://en.wikipedia.org/wiki/Robocode before you start.