Robo Home | Changes | Preferences | AllPages

/Help - /CodeSnippets - Discussions /AsOf20060129

What is VirtualGuns?

VirtualGuns is a way to choose the best aiming method against a given enemy by keeping track of each methods' virtual hit rate (or some other measure). There are obvious advantages:

What are the advantages


How does it work?

Marshmallow was my first bot using VirtualGuns (ehh, it was my first bot, period). It uses the following strategy for this:
  1. Everytime the robot is ready to shoot it creates an array of virtual guns and aims each of them
  2. When firing it stores this virtual gun array in an event
  3. The event's test() method checks wether a particular virtual gun has either hit or missed (using Waves).
    1. Statistics are updated for each gun which has either hit or missed
    2. When all guns are finished the event is deregistrered and the virtual gun array is disposed.
Note that there's no event handler for this event. I only use it to store the copy of the virtual guns array and to get Robocode to run the test each tick. Like VirtualBullets/VirtualBulletsBot does. -- PEZ

What bots are using this?

Please add relevant bots to this list.

One detail that I think makes sense is this: weight your VirtualGuns data (hits and misses) proportional to the difficulty of hitting the enemy in that situation. For instance, 12.5% vs 12% at distance of 500 is the same ratio as 25% vs 24% at a distance of 250, but if you have an even number of data from each distance, the latter has more effect on that calculation, while it should be the same. So far, I've been weighting my VirtualGuns data proportional to distance, but I'll be making it bullet time (slightly more accurate) and total reachable escape angle (which I already calculate precisely in Dookious). -- Voidious

Sounds reasonable. Would it also be helpful to take into account the percent of maximum escape angle taken up by the bot at each distance? -- Simonton

The above two factors are actually my attempt to calculate exactly what you said - the average hit rate for RandomTargeting in that situation = exactly proportional to bot width / total escape angle. That percentage is proportional to both bullet time and the total escape angle. Can you think of any other factors? I would definitely add them if I knew them, but I think those two paint the whole picture. -- Voidious

If your escape angle calculation takes into account wallsmoothing, then I can't think of anything else. -- GrubbmGait

Has anyone tried VirtualGuns within VirtualGuns? I think this could be effective against surfers, because your anti-surfer VirtualGun? could choose between pattern-matching, a small DC gun, a lightly segmented GF gun, etc, and your regular gun could be just one, big GF gun. You can choose between your array of anti-surfer guns (which are treated as one gun by the 'main' virtual gun system) and your main gun using gun stats that have a very high rolling depth, but between the anti-surfer guns with a low depth. Because surfers constantly evolve their movement, at different points their movement might be more susceptible to different types of guns. -- Skilgannon

Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited September 30, 2007 20:00 EST by Voidious (diff)