Wednesday, September 16, 2009

Dig into the sample Robo

In the robocode package, there are plenty sample robots. Before implementing the battle strategy for a robocode robot, it is a good thing to take a look at those sample robot. Here is some analysis done by me. I will focus on three aspects: movement, targeting, and firing.
1. Corners
-movement: Corner bot will move to a corner at the beginning of the battle and stay there until battle is over. If there are more than 75 percent robot still alive when it dies, it will switch to another corner.
-targeting: It will not target any robot while moving. When it sits down, it will turn the gun to the left first. If the gun has been turned for 90 degrees, it will change the direction of turning the gun. No target locking involved.
-firing: It will fire different bullet according to the distance and its energy. If it is weak fire or the enemy is too far away, fire a small bullet. If the enemy is within 200 pixels, it will fire a middle bullet. If the enemy is within 50 pixels, fire a big bullet.
2. Crazy
-movement: Crazy bot will move and turn at the same time. The first time, it will turn 90 degrees then reverse the heading. However, the rest time, it will turn 180 degrees then reverse.
-targeting: It does not move radar or gun. It is always watching the front side of itself. No target locking involved.
-firing: It always fire the same size of bullet.
3.Fire
-movement: Fire bot will only move when it is hit by a bullet. It will move back and forth within a certain distance.
-targeting: It will turn the gun around slowly. If it sees another robot, it will fire. No target locking involved.
-firing: It adjusts the power of bullet according to the distance and its energy. If the enemy is within 50 pixels and the fire bot's energy is more than 50, it will fire hard. Also if it is hit by another robot, it will fire at that robot at once.
4.Walls
-movement: Wall bot will move to the wall at the beginning of the bettle. Then it will keep moving from corner to corner.
-targeting: It does not move radar and it keeps the fun pointing to the front. It will fire whenever it finds another robot. No target locking involved.
-firing: It fires the same bullet all the time.
5.Tracker
-movement: Tracker bot will not move until it finds it target. Then it will move towards its target. If it is too closed to the target, it will move back a little bit.
-targeting: The direction that Tracker bot will turn its gun to depends on how many turns it has tracked for its target. If it does not see its target for 10 turns, it will start looking for a new target.
-firing: It will only fire when an enemy is really close or it is hit by another robot. It never fire at some robot that is more than 150 pixels away.
6.SpinBot
-movement: Spin bot will move and turn at the same time. It basically keep moving on a circle route. Only turn a little bit if it hits another robot.
-targeting: It does not move radar or gun. It is always watching the front side of itself. No target locking involved.
-firing: It fires the same bullet all the time.
7.RamFire
-movement: RamFire bot will keep turning until it detects an enemy. Then it will move towards to that robot and try to run into that robot.
-targeting: It does not move radar or gun. It is always watching the front side of itself. No target locking involved.
-firing: It only fires when it hit a robot. The bullet power that it fires depends on the target's energy. It will try to fire a bullet that contains a weaker energy than the target. Then move ahead and try to crash the target by using its body.
8.Sitting Duck
-movement: Sit...
-targeting: Never mind...
-firing: I am just a peaceful little duck sitting in the battlefield...

As a summary, I think all of the bots I listed above are sample bots. They basically adapt a simple strategy. However, I think there is one principle for this game that will help all kinds of strategy: "Fire hard and fire carefully".

No comments:

Post a Comment