Monday, October 10, 2011

Destroyer Robot


            For this particular project, the requirement is to create a robot that is able to compete against other sample robots from Robocode. The list of sample robots includes the following: My initial plan for this competitive robot was to create one that can avoid the enemy’s attack and stop at a certain point to shoot at the enemy. Unfortunately I was not successful, instead I used a plan that had my robot follow the enemy and keep shooting at the enemy in a brute force way. That is why I named the robot Destroyer; not only does it try to destroy the enemy, but it also can destroy itself.

            My strategy for moving the robot is to have it move around the battlefield by following the enemy. The way it targets the enemy is to scan for an enemy robot, and if it lost contact it will scan for another enemy robot. Once it locates the enemy robot it will move towards it and attempts to shoot at the enemy. Initially the robot will shoot at a fire power of 100, when my robot comes into contact with the enemy or get hits by an enemy bullet then it will fire at a power of 200.
           
            Based on the test results by executing the robot in the Robocode app I notice that it can defeat both Tracker and RamFire at certain times, and Corners robot in all 10 rounds. As for SittingDuck, my robot can always destroy it since it is always sitting at a certain spot. Unfortunately for the other robots, it was able to shoot at the enemy but it never got to destroy the enemy. The main problem of the design I had was start shooting at the enemy once the enemy has been located. In the future I would redesign it to scan for an enemy and have my robot stay at that location, then have gun move relative to the enemy’s distance and shoot at the enemy.

            The approach I took to test the robot is to test if the bullet power is greater than or equal to 100. This is to ensure that it actually fires at a power that can have a possibility to beat an enemy in certain amount of rounds. I also tested if my robot is alive or not against RamFire and SittingDuck. Of course I tested to see if it is not true that my robot lost or won in some rounds against RamFire and Tracker.

            To conclude, this project was a good chance for me to learn how to incorporate code from the previous the previous project and design a robot for competition. I also learned that in software engineering, testing is the most important because, we as programmers need to ensure the product is without errors. If in the future I have a chance to redesign the robot I will perform more test cases and research more on the API of what other methods the Robot class have to assist in testing for errors.

No comments:

Post a Comment