A crowd stands around the arena for robocode rumble.
“The Battle Commences, Launch the Robot!”
“Deck KJD open, preparing for launch.”
“I have control. GunAryos, Launching!”
This is the dramatic feeling I have at this moment, like a Robot pilot preparing for his first mission. After several weeks of looking at Robocode, we have arrived at our first competition.
The tension as we approached this moment increased steadily, and we have finally come to our first confrontation. The ICS413 Software Engineering class must now create their robocode robots that not only can compete against the 8 sample robots we analyzed earlier, but we also must see how our virtual robots fair in combat with each other. Who doesn’t want our robots to triumph in our first robot rumble, while everyone still has the same amount of exposure and isn’t trying to do anything super complex. After last class where our class discussed possible counter robots for the samples, I had a couple of ideas that lead to my current robot.
First thought that occurred to me was that in order to do a lot of the possible counter maneuvers our class had considered it would either require sitting still or using the AdvancedRobot robocode (which at this point is forbidden) to do movement and other actions simultaneously all the time. Robocode Robots are limited to doing one command at a time unless a command is called as an reaction to an event (such as getting hit). This leads to the second issue that came up, if you can only do one action at a time (most of the time), what should take priority, movement or attack accuracy. The choice came forward when we considered what the winning sample robot, Walls, had as a priority: Movement.
Knowing that, I constructed GunAryos to prioritize slightly unpredictable movement with conservative shot style. Let’s take a moment to analyze GunAryos under the same criteria we used for the 8 sample robots.
We Have a New Challenger: GunAryos
(Code can be downloaded here, IE User may get zip, but it is a jar)
GunAryos is designed to be a bit of all the sample robots strong points at the same time without making an AdvanceRobot or taking actual code from the robots themselves. It prioritizes movement but also attempts to take good attacks when the opportunities arrive.
Movement: GunAryos by default will rotate randomly and then travel across the screen. Upon contact with a wall it will attempt to rotate away from the wall and travel off again. When hit by bullets GunAryos will swerve, having this turn while executing its movement command being the only simultaneous movement type a Robot can do right now, adding a sort of unpredictable movement to someone aiming at it. When hitting another robot, it will turn towards that robot and shoot at it, if it was the cause it will also attempt to ram it. In this way, GunAryos’s movement is unique from the samples by having many different options.
Targeting: GunAryos has no specific method of targeting an opponent, it only fires if the opponent comes into the range of vision in front of it. This allows it to target aggressively if the opponent is right in front of it, and also allows the opponent to be randomly targeted while the robot moves at the corners.
Firing: GunAryos puts firing on the least complex, like many of the sample robots it fires whenever it scans a robot. It does so at full power to reap the benefits of firing bonus, at the risk of losing all its energy. On impact with an opponent it attempts to fire at point blank range, and also will try to continuously fire at the opponent if they are in the same line of fire by scanning for the robot after firing.
Robocode Competitions base victory on points. Points tally in based on several factors including surviving a battle with the opponent, ramming into the opponent, as well as scoring hits on the opponent with your cannon. While survival gives lots of points to your score, it alone cannot ensure victory when opponents can successful hit your robot several times.
In combat tests of 100rounds of battle, the 8 sample robots provided these results for how many of the total points GunAryos received and how much of the rounds it survived in:
Vs. Walls: 67% of points, 81% survival in rounds.
Vs. RamFire: 54% of points, 76% survival in rounds.
Vs. SpinBot: 58% of points, 81% survival in rounds.
Vs. Crazy: 78% of points, 99% survival in rounds.
Vs. Fire: 78% of points, 99% survival in rounds.
Vs. SittingDuck: 100% of points, 100% survival in rounds.
Vs. Corners: 78% of points, 99% survival in rounds.
Vs. Tracker: 60% of points, 78% survival in rounds.
Before finalizing this version of GunAryos I had attempted to regulate its firepower in order to conserve power. While using weaker shots from far away gaves better results against RamFire and Tracker, the results allowed SpinBot to beat GunAryos with 60% of the points. A compromise was made, allowing the battles to be closer for RamFire and Tracker, but allowing victory against all 8 of the sample robots.
A lot of victories for GunAryos is awarded because it is able to dodge fire from its opponents a lot of the time wearing down the energy reserve that serves as both life and cannon power, this is why robots that key in on movement like RamFire and Tracker are a challenge. SpinBot because of its AdvanceRobot style movement and its tendency to avoid walls (which cause damage to AdvanceRobots) make it difficult to beat in close range, so the shots from GunAryos are all fired at 3 (or High Power) so that it can deal good damage to SpinBot and secure victory.
Sometimes when you are limited to simple directions, you have to go with what its strengths are. You cannot make something that can only do one thing at a time juggle several tasks at once; you have to make the most of what it can do. “Simple is Best,” is a saying I often use in this situation, deciding what task was needed the most and giving it the most attention without complicating it with other major issues. I wanted to try to make it predict target path and dodge shots elegantly but with regular robots I decided that was more a work of pride than functionality, and decided to get the job done in a way that I felt would work well with the simple direction restriction.
In some ways GunAryos is a combination of robot ideas, optimized for 1 vs 1 combat. Like Walls it moves around constantly, like Crazy it moves a bit unpredictably, like RamFire it attempts to ram if it contacts the opponent, like SpinBot it fires with high power a lot, and like Corners, Tracker, and Fire it tries to keep fire on the opponent if it’s not moving out of line of fire. I hope that in this best of all worlds creation lays the key to round 1 victory.
My future goals for this is to find a way to adapt to all the samples at once, raising GunAryos Victory rate up without having to develop individual modules for each opponent (which I feel is a bit unfair). It will be difficult to find the key elements to change to allow that, but while we are using Robots and not AdvancedRobots the possibilities feel a bit more in control, and perhaps one day I can isolate the crucial element to provide me superior statistics. For now, round 1 beings, and soon I’ll be able to see what others can come up with the given time.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment