Wednesday, September 9, 2009

Go Robo~

In the past week, I was working on some basic functionality in RoboCode. The RoboCode system is very cool. I can debug without re-run my code. All you need is simply pause the current battle. Then when you press the "restart" button, all the change in the code will be applied. That's very amazing to me.

I worked on moving, tracing and aiming for a robot in Robocode. The Robocode Documentation really helps when you trying to do some warm-up program. The Robocode API is quite powerful. However, I think it should contain some methods that will get the direction to a point in the battlefield. Right now, I have to use Java.Math.atan method to find the angle that robot should turn. Also it is very accurate since too many number processing going on. Therefore, I still working on how to make a robot move circularly properly. Right now, I make the bot move in a square route:( I think it is so hard to move in a round circle because if you want your bot move at 1 pixel per turn (as small as possible) and you turn 1 degree per turn (as small as possible again), it is just too slow.

Another issue in Robocode is scanRobotEvent. This class contains the method that will return the distance between two robots. However, in my understanding, it looks like this scanRobotEvent does not happen continuously to one robot. For example, bot A saw bot C. As long as bot C is within bot A's sight, scanRobotEvent does not occur. If that so, how does it update the new distance etc.?

Over all, Robocode is a very nice project to work on. It can be simple or complicate. I enjoy the most from Robocode is the satisfaction after I see my robots working correctly:)

My RoboCode source code is available at http://www2.hawaii.edu/~yichi/RoboCodeXYC.zip

No comments:

Post a Comment