Monday, September 19, 2011

Battle Bots

    As an assignment for our Ics 314 software engineering course, we were asked to program 12 individually simulated robot tanks using a preexisting development tool called robocode.  The purpose of the assignment was to give us more experience with the Java programming language, as well as a chance to acquire some new knowledge and skills.
Robocode was a project that was initially started by an IBM developer to help people learn code, and has since then grown into something that is now managed by an online community of developers who continue to actively contribute to the project and its cause.
As a starting point, we were given the task of creating 12 robots that would perform different tasks as a means for us to explore the many facets of the software, as well as how to manipulate the code to get the robot to do what we want it to.  The way this is done is through predefined method calls along with customized chunks of code which allow the robot to perform its specific task.

From all of my experiences as an ICS major I'd have to say that working on this project was by far one of the most enjoyable programming experiences I've had to date...and dare I say a little fun...
Although the process of learning the ins and outs of the software was initially quite time consuming, it became enjoyable to watch my custom made robot duke it out with some of the sample bots provided with the software. Personally, I think the reason why this project was successful at not being such a pain was due to its GUI which gave the immediate gratification of seeing your code acted out by a little tankbot.  It even minimized the painstaking process of debugging the code, which for me was simple because it usually entailed either removing of adding one or two lines of code.  The good thing was that a lot of the robots did call on similar movements, so this made modularity possible.  For the most part, I created method blocks and used they same blocks on the robots that had similar movements.
    Although I did complete all 12 robots, the one robot that I did have some considerable trouble with was the position five robot, which was by far the most complicated of movements.  The robot was supposed to move to a corner of the field, then next to the corner diagonal from it, and repeat process for the unvisited corners.  The only solution I saw possible for this problem was to use the center of the map as the robot's pivot point to go to each corner since the capabilities of the robot at this time were limited. Although the robot I created for this task did complete the task, I know the code that I wrote was quite inefficient.  This was the only one I felt questionable about.
 Next, we're supposed to program a fully fledged battle bot that will compete against all the other bots created by the other students.  These exercises were a really good introduction to the world of robocode and I feel have given me enough confidence to build a successful battle bot.  I think I have a pretty good attack and avoidance strategy that I've devised  from observing some of the sample bots, which I won't talk about here because I don't want to give away the best tactics!  All I can say is that it will be aggressive + aloof = perfect killing machine...game on

No comments:

Post a Comment