For the continuing project of our Robocode implementation, we were asked by our professor to create a “competitive” robot based on the knowledge that we had acquired from the earlier exercises. Utilizing the three basic platforms of movement, targeting and radar, along with some strategic blocks of code, a competitive robot can be built. What it really comes down to though in the competitive arena is the strategic calls in the code blocks, and how you would expect you robot to perform when certain events happen.
Well, as far as for my design, I thought that I had a pretty clever strategy which in theory would have been a very difficult opponent to beat. My strategy was to have my robot circle around its opponent and simultaneously fire in towards its target. However, through much frustration and a couple of visits to the robocode wiki page, to accomplish something like this while using just the basic robocode package and no other interface would have been near to impossible. There was a robot from another person that basically had the strategy I wanted to build, however they’re robot extended the advanced robot interface, so to try and build something that just didn’t have the capabilities within its class would have been extremely difficult.
So I settled for a slightly different strategy for my robot. for the movement, I decided that I would have my robot adjust its position only when necessary due to the nature of its targeting strategy. It turns out that the tracking and targeting style that I chose to implement works best when the robot is stationary, and can inflict the most damage on its target this way. Therefore, I used the on hit by bullet method to call the movement adjustment. For the firing strategy, I decided to go with one that would conserve my robots ammo due to the observation that the robot would sometimes run out of ammo before the round would be over. The robot automatically adjusts its bullet strength according to the distance of the target.
Being that I was unable to implement the strategy that I originally wanted, this other one actually preformed pretty well. It beat out most of the robots except for the spinbot and ramfire. I think a weak point in my design probably was due to the fact that I didn’t really have any strategy to execute for something like a collision with another robot. Its here that i think my robot what become overwhelmed by the ramming bot. This could probably be improved with something like a fluid movement. The spinbot seemed to come in first every time because I think its probably one the the hardest targets to hit due to its constant motion. I think for my design that tracking and adjustment of the gun was a bit delayed and couldn’t pinpoint the targets movement. This could probably be improved with something a little more advanced that would allow the robot to predict the targets movements.
The approach for testing that I relied on probably wasn’t the best approach, but was basically a trial and error type of approach. I would add segments of code in spots that I though it would probably be most effective, and had even tried to build the methods that would perform the circling methods. However, I think that I probably wasted a lot of time trying to implement such a complicated battle strategy with little that this basic package provided.
The lessons learned from my experience of building this competitive robot would be to possibly come up with more than one plausible strategy, and something within the range and capabilities of the tools on hand. Though I knew that my original battle strategy would be very difficult to implement I decided to try and tackle it anyway. However I should have realized in a much earlier stage that it wasn’t plausible, and should have started on a new strategy within the capabilities of the class and package.