RayBot

RayBot has many of the same features you find in other successful robots:

Rather than discuss these features (other robots do these things better and with fewer lines of code anyway :-) ), I will go over two things RayBot does differently or to a greater extreme than most other bots out there: data collection and predictive aiming.

 

Data Collection

RayBot stores data on each enemy robot. Fine. Most bots do. No big deal. But RayBot stores this data for the entire game, so it does not have to learn about it's opponents with each new round. Furthermore, it stores this data between games, so lessons learned in the previous battle are carried forward to the next.

Some other robots record enemy robot info, keep it from round to round, and save it to file, but not (I think) to the same degree as RayBot. Some of the data recorded on enemy robots includes:

Of course, none of this data means anything unless it's used to do something useful. There are methods that use the data to calculate our (relative) chances of hitting the enemy bot, how much firepower to use, and where to aim. There is a method called getType() which looks for movement patterns and identifies different types of bots based on the data (which in turn is used to improve aiming).

 

Predictive Aiming

To counteract the bullet dodging behaviour of Wolverine and others, I came up with predictive aiming: guessing what the target will probably do based on past behavior.

When RayBot fires a bullet in a one-on-one situation, it creates a BulletTracker to track the path of the bullet. If the bullet has reached the point where it should have hit the intended target but hasn't, the BulletTracker calculates the approximate relative heading and speed the target actually took and records this as a reaction.

When RayBot is presented with the same target at approximately the same distance, same relative heading, same speed, etc, it predicts it will react the same way when fired at and aims accordingly. Sometimes it works. Enough anyway to give it a slight advantage over it's bullet-dodging foes.

 

What's Next?