Tuesday, September 15, 2009

11. If you can't beat them, join them

What better way to beat the enemy than by using some of their own strategies. I looked at some of the sample robots included in Robocode to see what kind of strategies they use in order to make my robots better. There were three things I looked at in each robot: movement, targeting, and firing.

Walls
Movement:
The robot moves along the walls in a clockwise direction and is always facing away from the wall it is moving against. It never stops moving which has shown to be a very effective strategy to avoid enemy robots. However, it can be detrimental if an enemy follows the robot behind it in the same clockwise direction since the robot's gun won't point in that direction. If it hits an enemy it will move away from that robot and therefore has an avoidance strategy.

Targeting: The robot does not track enemies. It fires at an enemy once it spots it but does not continue to track the enemy.

Firing: The robot fires once it spots a robot. The firepower is set to always be 2.

RamFire
Movement: The RamFire robot uses a following strategy. Once the robot has spotted an enemy it moves forward toward that robot to try to ram into it.

Targeting: The RamFire robot spins its whole body around to search for a target. This was one of the least effective ways of searching for a target because it is time consuming. Spinning the gun to search for enemies is better because it does not reduce the movement of the robot and allows for movement and scanning independently.

Firing: The robot only fires once it rams into its enemy. This is not very effective because the only way it can attack an enemy is if it is literally right next to it. It spends most of its time moving towards an enemy instead of firing.

SpinBot
Movement: The SpinBot robot constantly moves in a circle in a clockwise direction. It moves very quickly and follows an avoidance strategy.

Targeting: The robot fires once it spots an enemy. However, it does not actively track the enemy in the sense that it does not rotate its gun to follow the enemy.

Firing: The robot fires at the maximum fire power of 3 no matter how far the enemy is located.

Crazy
Movement: The robot uses an avoidance strategy by moving in a crazy pattern which allows it to effectively avoid enemy robots' fire. It also makes it a very difficult robot to follow because the enemy cannot keep up with its crazy movements. If the robot hits a wall it "bounces" right back and continues moving.

Targeting: The robot does not follow a robot or actively target an enemy. It only fires when it has spotted an enemy.

Firing: The robot fires at a set power of 1 which is very low. This shows that it focuses more on moving and avoiding enemies than attacking.

Fire
Movement: The fire robot does not move unless it is hit by an enemy. This shows an avoidance strategy although it is not very effective because it only takes action after it is too late.

Targeting: The robot turns its gun to the right to scan for enemies. It turns its gun very slowly and continues to do so until it spots an enemy, otherwise it will keep spinning.

Firing: The robot fires at a set power of 3 if it has enough energy and the enemy is near. If not, the robot fires at a power of 1.

Sitting Duck
Movement: The robot does not move, it just sits in one place.

Targeting: The robot does not track or scan for other robots.

Firing: The robot does not fire at any enemy robots which would be difficult to begin with since it does not even search or track for enemies.

Corners
Movement: The robot moves to the wall that is to the right of its desired corner, then turns left and moves to that corner. After it reaches its desired corner it remains there until it dies. Also, once the robot spots an enemy, it immediately stops and fires which can leave itself vulnerable to other enemy robots.

Targeting: Once the robot is in its desired corner it scans for enemy robots and fires once one has been spotted.

Firing: The robot fires at an enemy once it has been spotted using a fire power that is inversely proportional to the distance of the enemy. The further away an enemy is, the less fire power is used. This takes into the account that the further away you are from an enemy, the less likely you will get a hit. Therefore you can conserve your power for opportunities that show more promising results.

Tracker
Movement: The robot only moves once it has spotted an enemy. It moves directly toward the enemy and backs up if it gets to close to the other robot.

Targeting: The tracker robot is of course excellent at tracking enemy robots. Once it has spotted another robot it "locks" onto the target and follows it around.

Firing:
If the enemy is within 150 pixels of the tracker robot, the tracker robot will fire at it. The robot fires at a set power of 3.

0 comments:

Post a Comment