Wednesday, September 16, 2009

Simple Samples, Learn by Examples

So to increase our knowledge of RoboCode and give us some strategic ideas, we were tasked to review the codes for some of the sample robots that came with the RoboCode Installation. This was a great idea, because after reviewing their codes and actually running them in Robocode, I can see each of their strengths and weaknesses.Below is a brief subscription of the sample robots that I reviewed...

Corners:
This robot will start off going to the upper-left hand corner. Once it gets there, it'll remain there and fire at any robot that it finds. If it dies while there are more than 75% of other robots remaining, it'll change it corner going clockwise. The bad side to this is that it becomes a sitting duck once it gets to the corner. Or worst if it bumps into a robot, it treats it as a wall. So if it bumps into another robot, it'll think that it's a corner and stops there. When it scans and finds a robot, it'll use it's smartFire methods which chooses the firepower depending on the distance of the enemy. This looks good on paper, but when testing it up other robots, it tends to lose to robots that uses a stronger firepower.

Crazy: This robot's movement is just like it's name. It's movement is so unpredictable which makes it really hard to hit. Once it's scan and finds a robot, it'll fire a weak bullet. But due to its weird movements and weak firepower, it's more of a decoy bot if it was in a team battle.

Fire: This robot is a partial sitting duck. It's starts off by spinning it's gun and radar and fires at the first robot it sees. When it gets hit, it'll move perpendicular to the bullet by 50 pixels and sits until it gets hit again. These small movement help it avoid getting hit by a chain of bullets. It constantly scans 360 degrees with its radar/gun each time it gets hit and chooses either max or min firepower depending on the distance of the target.

RamFire: This robot scans for enemy robots and attempts to ram the first one it see. It doeesnt fire until it gets into point blank range. It also lowers it's firepower depending on the target's energy trying to finish it off by ramming it to get the bonus points. This robot's strategy will normally lose to other robot that uses a high firepower or smart fire, because it's not firing at the target until it's at point blank and it lowers it's firepower when it's about to kill it's target. In my opinion, this robot is too greedy for the bonus point which is not really worth it. It's also horrible at chasing highly mobile robots such s Walls and Crazy.

Sitting Duck: This robot does extra what it's name says. It pretty much just sits there like a target dummy. But it also does one extra thing which is that it outputs a file called "count.dat" which contains the number of rounds and battles that it was it.

SpinBot: This robot constantly moves in a circular motion scanning and firing max firepower bullets at it's targets. It's circular movements helps it avoid bullets and it's max firepower allows it to tear apart stationary target with eases.

Tracker: This robot is quite similar to the RamFire in the sense that it scans for a enemy robot and chases after it, but not to a point blank range. It'll stop about 140 pixels away form it's target and then fires max firepower bullets at it. This robot similar to RamFire will have a disadvantage against high mobile robot and robot that use max firepower or smart fire. A simple improvement to this and RamFire is to just make them begin firing at their target once it's found.

Walls:This robot is the king of the sample robots and I can see why. It is always constantly moving along the walls making it a hard target. And since it's running allow the walls, it can never get hit from behind. It also peeks at the next wall before turning to make sure that there's no robots on it. That way, it doesn't get flanked from the side. I was told that the corner robot was a counter to this robot, but after reading their codes and running tests with them, the Walls always wins. It's because the Walls robot uses a fixed medium firepower while the Corner robot uses smartFire. SmartFire becomes a disadvantage because these 2 robots are always firing at each other at a full length/width of the battlefield. So if Corner uses a stronger fixed firepower, it'll probably win.

So after reading all the source code for these sample robot and doing actual tests with them, I got a pretty good idea on what strategies to implement for my robot. I'll be looking forward to see what strategies my classmates came up with and Hopefully I'll find a counter strategy.

0 comments:

Post a Comment