Wednesday, September 16, 2009

Review of Strategies in Sample Robots

The sample robots included in the Robocode package has a lot of potential for competitive robot. While trying to tacgle for the first robocode assignment, the only feature that missing from the sample robots is the trigonometric moving between two points. Because I like simplicity (even for a complicate problem), I really like the targeting of TrackFire. Anyway, below is the review of moving, targeting, and firing strategy of eigth sample robots.

Walls: It first turns to one of the special angles then moves to the furthest wall. The targeting of the walls is simple but efficient enough to stop before hitting on an enermy. With the "peek" variable, the robot will stop if there an enermy in front of it and it will keep firing till the enermy out of the way. If it hits the enemy in the front, moves back; otherwise moves ahead.

RamFire: The movements is straightforward. The targeting is not very efficient because the radar only turns when the robot turn. Thus, it need to rescan for a new enermy while trying to get close to the previous enemy that already moved out of the radar. It only fires on hitting at the enermy and uses the bullet power proportionally to its energy. Though, it seem to be effecient, in a real battlefield, the chance is that it could be killed before hitting on any enemy.

SpinBot: This is the extends of AdvancedRobot. Its unique feature is the circle movement by turning in a large degree with a low velocity then moving ahead. The targeting is straightforward. The firing is not energy efficient. Not only that it fires hard once scanned on a robot, it also does not track the exact location of the moving target. Thus, there's more chance that the bullet would miss the moving target.

Crazy: This is another advanced robot. The movement of this robot is seem randomized. After looking at the robot movement and the code, first I wonder what make this robot not moving a straight ahead while in the code said so. After deeply investigate some of the advanced robot function, I've realized that each of the set movement will not execute until the completion of waitFor(new TurnCompleteCondition(this)). That seem to be a pretty cool method of making a random movement. The targeting and firing is straightforward and also it does not track the exact location of the enermy. It takes longer to kill an enemy because the bullet power is low.

Fire: This robot turn "perpendicular" to the bullet before moving backward or forward 50pixels each time hitting by a bullet. Without interupting, it sits still, spins gun around and fires on the target. The gun spins around but does not follow on any enemy which is not so efficient on a tough battlefield. It uses the bullet power proportionally to its energy and the distance of enemy. It also do the best to kill enemy as fast as possible if it hit on it.

Sitting Duck: This robot sits still and keeps track of its persistency. There is no movement, firing, or targeting in this one. At least the feature of this robot is tracking robot's life into the external file.

Corners: This robot first moves to one of the corner and switch the corner if it did not do well in the previous round. Similarly to the walls robot, the corner uses "stopWhenSeeRobot" variable to be alert of any enemy in its way. Instead of rotate the gun around, this robot only rotate the gun back and forth which is sufficient enough. The ability to keep track of enemy in the field and statistisc of each round make this robot unique. Maybe we can include that feature in the design of the competitive robot. The firing is similar to Fire.

Tracker: This robot tries to move closer to its chosen target before firing. Before moving anywhere, it has to scan for an enemy and tries to move closer. The technique doesn't work for a moving robot. It rescan for the chosen target everytime after each turn. The method of finding the first target is unnecessary. We can get at least one target with just a single round (360) turn regardless of robot's position. Trying to rotate the gun to another direction should be replaced by pointing at the enemy all time. The firing is straightforward as it fires hard once getting close.

No comments:

Post a Comment