Difference between revisions of "XanderCat"
(→Version 12.6: added note about a modification to Rednaxela's 3rd Gen KD Tree) |
(→Version 12.6: probable final version notes) |
||
Line 965: | Line 965: | ||
<i>XanderCat Updates:</i> | <i>XanderCat Updates:</i> | ||
− | * | + | * Revise generic KNN log reader to return a data iterator instead of a data point list. This should mostly eliminate the massive overhead of creating a List for each read when using Rednaxela's KD Tree in order to match the interface. This will also make data point KD Tree distance available on each point, something previously unavailable that could improve performance if used when filling the factor arrays. |
− | * | + | * Use KD Tree distance for each point to adjust the weight of data points in the constructed factor arrays. |
+ | * Adjust KNN selection parameters on the drive from (1, 30, 0.3) to (10, 40, 0.4) where values are (minK, maxK, K growth rate) | ||
* Start recording drive and gun run time stats in the saved battle statistics file. | * Start recording drive and gun run time stats in the saved battle statistics file. | ||
* Auto-fire on disabled opponents turned back on, with condition that if the bullet shielding gun is active, there must be no active opponent waves. Ramming will now only be used on low energy opponents who have stopped firing but are not disabled. | * Auto-fire on disabled opponents turned back on, with condition that if the bullet shielding gun is active, there must be no active opponent waves. Ramming will now only be used on low energy opponents who have stopped firing but are not disabled. |
Revision as of 19:35, 22 March 2013
XanderCat | |
Author(s) | Skotty |
Extends | AdvancedRobot |
Targeting | GF / Linear / Circular / Anti-Mirror / Bullet Shielding |
Movement | WS(GoTo) / Anti-Mirror / RamEscape / IdealPosition |
Released | 2011-5-20 (v 1.0) |
Best Rating | #5 (v 12.5) |
Current Version | 12.5 |
Code Size | 56,330 (lol) |
Code License | GCWCD |
Download |
Introduction
MegaBot based on my Xander Robot Framework with pluggable guns, radars, and drives. XanderCat is the flagship of my robot fleet. It is a multi-mode robot using multiple guns and drives organized into a component chain. It's main gun is a guess factor gun, and the main drive is a wave surfing drive (GoTo-style), but a number of other guns and drives exist for special situations. Both the main gun and drive are currently using a hybrid form of dynamic clustering. The drive is somewhat unique in that it decides where it wants to go and goes there directly (no orbiting -- though the path still is somewhat orbital in nature due to MEAs and distancing -- and no wall stick while driving). XanderCat also makes use of my Xander Painting Framework for development and debugging.
Best against: Generally a good performer; probably most notable for having simple yet effective anti-mirroring capabilities.
Worst against: Currently DrussGT, Diamond, and Tomcat are still quite deadly to XanderCat.
Favorite Robots To Beat:
- lazarecki.mega.PinkerStinker 0.7 - because I don't like it's name.
- da.NewBGank 1.4 - because of it's name and because I can beat it quite badly due to a newbie bug in it, which is pleasantly ironic.
Past Version Notes: For information on versions prior to the current series, see the XanderCat/History page.
Name Origin?
Xander comes from my son's name Alexander. Cat was originally meant to be of the feline variety, as I like cats, have used the term in other software projects, and it seemed appropriate. Cat could also be associated with the tractor variety, which I think also works (a tractor with a gun), and I'm fine if people make that association too.
Hybrid Dynamic Clustering?
XanderCat uses Dynamic Clustering (DC) in the sense that data about past waves is stored in a tree structure. For each wave, past data is pulled from the tree that as closely as possible matches the current situation, and that data is used to decide where to aim or drive. However, once the data is pulled, how to use it differs from classic DC. In classic DC, some form of kernel density algorithm is used to determine what to do. In the XanderCat hybrid approach, it behaves more like VCS, in that the data is logged into a factor array, and that array is surfed in the GoTo style.
Surfing Multiple Waves?
Starting with version 9.5, XanderCat now surfs up to 2 waves at a time. The general approach is as follows:
- Calculate the first n best factor angles to drive to for the next wave to hit, each of which must be separated by a given amount. Each has an associated danger value.
- From the end points of the n factor angles, continue to predict into the future surfing of the second wave to hit. For the second wave, only the best factor angle is used.
- Add the first wave danger value to the corresponding second wave danger value for both the factor angles of the first wave. Choose which first wave factor angle to drive to by which has the lowest combined danger value. (Note: The calculation is a little more complicated, taking wave distance and bullet power into account, but the basic idea is the same.)
Note the image below, where:
- a = reachable factor range for first wave
- b = minimum distance that must exist between choices
- c = first choice for surfing first wave
- d = second choice for suring first wave
- e = current robot position
If the sum of the danger values represented by orange lines was less than the sum of the danger values represented by the red lines, the second choice for the first wave would be used.
Saving Data Between Battles?
XanderCat does save data between battles, but that data is not used by the robot and does not effect performance any. It is collected solely for my own analysis. It helps me find problems and decide on where improvements are needed. I also just like statistics. Of course, I only get statistics on battles run by my own machine. Below is an example some data it collected:
Key:
- Opponent = Opponent robot name and version
- G1 Shots = Shots taken by the main guess factor gun
- G2 Shots = Shots taken by the Anti-Scarlet guess factor gun
- CD Scenario = Percentage of time the CircularDriverScenario was applied against the opponent
- PD Engage = Number of times my bullet fire power was dropped (see v10.21 notes for what this means)
- Flattener = Percent of total time the flattener was engaged
- My HR = My overall hit ratio
- Opponent HR = Opponent overall hit ratio
Opponent | G1 Shots | G2 Shots | CD Scenario | PD Engage | Flattener | My HR | Opponent HR |
---|---|---|---|---|---|---|---|
techdude.kombat.FlamingKombat 1.5 | 8 | 62 | 78.5% | 0 | 0.0% | 73.5% | 3.4% |
test.Fuzzer 1.0.1 | 449 | 13 | 0.0% | 0 | 0.0% | 60.6% | 9.9% |
test.Podgy 4.0 | 465 | 387 | 0.0% | 0 | 0.0% | 22.0% | 7.2% |
throxbot.ThroxBot 0.1 | 747 | 12 | 0.0% | 0 | 0.0% | 30.9% | 5.5% |
tide.pear.Pear 0.62.1 | 806 | 490 | 0.0% | 10 | 7.0% | 13.0% | 11.2% |
In addition to saving data on each robot, it can save a generic set of data about performance against the field as a group. As an example, to get an idea of early, mid-game, and late game performance, I log the number of round wins for each round. Example (to keep the table short, I left out rows for rounds 3 through 31):
Round | Wins | % Wins |
---|---|---|
0 | 615 | 88.9% |
1 | 630 | 91.0% |
2 | 613 | 88.6% |
... | ||
32 | 644 | 93.1% |
33 | 654 | 94.5% |
34 | 644 | 93.1% |
Total | 692 |
Multi-Mode Scenarios / Component Chain
Component Chain:
Default --> Basic Radar | v RamLowEnergyScenario -> Ram Drive, Ram Gun (fires no bullets; just a placeholder for the gun) | v BulletShieldingScenario -> Bullet Shielding Drive, Bullet Shielding Gun | v RamEscapeScenario --> Ram Escape Drive, Linear Gun | v AntiMirrorScenario --> Anti-Mirror Drive, Anti-Mirror Gun | v NoBulletWavesScenario --> Ideal Position Drive | v CircularDriverScenario --> Circular Gun | v Defaults --> Guess Factor Gun Array, Drive Array | ______|_______________ | / \ | Targeting Detector Drive Main Wave Surfing Drive __________|___________ / \ Original Gun Anti-Surfer Gun
Ram Low Energy Scenario
This scenario attempts to ram the opponent if the opponent is at low energy and has stopped firing bullets. Should the opponent who stopped firing bullets suddenly fire a bullet at close range during the ram attempt, the low energy cutoff can be reduced further (fool me twice, shame on me). Also, this scenario will only engage if our own robot is over some minimum energy level threshold.
To ram the opponent, the ram drive uses three approach methods depending on distance from opponent. At far distances, the ram drive will just drive directly at the opponent. At short distance, the ram drive uses a linear intercept. At intermediate distances, the ram drive uses a blending of the two.
Bullet Shielding Scenario
This scenario attempts to use bullet shielding against the opponent. The bullet shielding components basically follow the standard approach, except I didn't bother trying to make the bullet lines cross at their segment midpoints, so there may be an improvement to make there some day? Determining when to use this scenario is a bit complex, and includes 9 different conditions that must be met for the scenario to apply.
Ram Escape Scenario
This scenario applies whenever the opponent appears to be ramming. At present, this works be simply testing the opponent's distance being under some threshold. This sometimes happens against robots who are not really ramming -- this can happen due to initial round positioning, or just due to drive paths that happen to run too close together -- but in these cases there is no real disadvantage to using the ram scenario to back away from the opponent. This distance of ram detection will increase the more the ram scenario is applied. This makes the ram scenario kick in sooner and more often against the real rammers who ram consistently.
When this scenario is applied, a Ram Escape Drive is paired with a linear targeting gun. At present, this is the only place in which I utilize linear targeting. The Ram Escape Drive attempts to drive away from the enemy as much as possible, and uses turning to try and dodge some of the opponents shots (for example, it may change the direction of turn at the moment an opponent shot is detected).
Anti-Mirror Scenario
This scenario applies whenever the opponent appears to be using a mirroring drive strategy. The countering technique is to plan a drive path into the future such that it is known where to shoot in order to hit the mirrored position in the future. At present, this can be fooled by creative mirrorers that utilize a delay or position shifting.
No-Bullet-Waves Scenario
This scenario applies whenever the opponent has no bullets in the air (note: this can happen alot with a rammer, but the ram scenario happens earier in the component chain and thus superscedes this scenario). When the opponent has no bullets in the air, the Ideal Position Drive takes over and moves the robot directly to what it perceives as the ideal position on the battlefield given the battlefield size and the current position of the opponent.
I've attempted to replace this somewhat crude drive a few times, but each time resulted in a lower overall score in the RoboRumble, giving rise to the idea that this drive is embued with magical powers.
Circular Driver Scenario
This scenario doesn't affect overall performance much, but it does two things that make me feel better: first, it brings back my circular gun, which otherwise would not be in use. I once spent a lot of time on it, and would like it to be used somewhere. Second, it makes me feel better when pitted against simple circular drivers like SpinBot, where my guess factor gun still misses quite a few shots, but my circular gun can hit nearly every time.
To make this scenario as effective as possible without degrading any performance elsewhere, it is not enough for an opponent to appear to be moving in a circular path at the time a shot is taken. The opponent must have been moving (and still be moving) in a consistent circular path. Furthermore, that path must not intersect any walls before the shot would reach them. The circular movement path is predicted into the future until the bullet would arrive to check for this. (Note: Using prediction for this is not really a good idea; I should have just checked the bounds of the circle. I will make this change in some future version.)
Default Gun Array
The gun array consists of several guess factor guns. This is not too computationally expensive because they are currently all using the same cached copy of data. They just use the selected data differently when building the factor array to use for aiming. The Anti-Scarlet Gun uses a certain amount of data rolling. This technique was first implemented to counter Scarlet, who at one time was trouncing my robot far worse than any other, thus the name.
Default Drive Array
The drive array consists of two drives: what I currently call the Targeting Detector Drive and the Main Wave Surfing Drive. Both drives are direct wave surfing drives. They just differ in what data they use to surf. I use the term direct to indicate how the drive moves the robot; the robot is moved at a fixed angle until it reaches the desired surfing factor angle for the current wave, in essense moving there directly in as straight a line as possible rather than using an orbital path. However, in action, it may still appear to use a somewhat orbital path, as where to move is recalculated for the same wave under various conditions -- such as when the waves are updated due to new bullet shadows, or the opponent moves too far away from it's predicted path.
Main Wave Surfing Drive
This drive uses Dynamic Clustering with a KD Tree for it's data management. A simple equation is used to determine how many nearest neighbor data points to pull, and those points are logged into a factor array to surf.
Targeting Detector Drive
This drive uses a combination of targeting detectors that are designed to detect specific types of targeting. Each targeting detector can add a data point to the factor array, with the data point weight based on how often the detector thinks it is detecting it's specific form of targeting. This system is designed to improve scores against robots that use predictable targeting (non-guess-factor), something I have had trouble getting my main wave surfing approach to handle as well as other top robots.
Bullet Shielding Protection
All main guns are wrapped by my BSProtectedGun wrapper/decorator class. It is a different animal from my original version. My original version shifted the target's position slightly to avoid perfect aim shots, a technique that works well against the basic shielder's such as uCatcher. However, it was generally ineffective against moving shielders like MoxieBot. At the same time, my normal aiming technique for my latest guess factor guns is not vulnerable to the stand-still shielders (by chance more than design). Therefore, the latest incarnation of my BSProtectedGun attempts to handle shielding using a new strategy that does not rely on shifted aims, and focuses more on protecting against on-the-move shielders.
When bullet shielding is detected, the BSProtectedGun will check the energy levels of both robots. So long as my energy level is more than the opponents, the BSProtectedGun will halt firing and wait for the shielding opponent to fire first, then the BSProtectedGun fires immediately after the opponent. This ensures that the opponent's shot is not a shielding shot. It is still possible that the opponent could fire a second shielding shot before the my shot reaches them, but in practice this hasn't been an issue. This could also fail against perfect shielders where my energy level never exceeds the opponent's, but again, in practice this hasn't been an issue. If it did ever become an issue, I would keep basically the same strategy, but start shifting target position again like in the original gun.
This strategy has an interesting yet not surprising result against MoxieBot. MoxieBot shields on the move, but the shielding is never perfect, and my robot can usually get the upperhand on energy at some point in the round. When this happens, my robot stops firing and waits for MoxieBot to fire first. However, MoxieBot in turn is waiting for me to fire before it fires, resulting in a stalemate where no one is firing. This in turn results in Robocode activating the stalemate energy drain. Neither robot incorrectly detects the energy drain as an opponent bullet, so the stalemate continues until the energy drain kills one of the robots. However, since my robot only stopped firing after getting the upper hand on energy, my robot gets the win. End result, a somewhat higher score against MoxieBot, and much higher survival.
To improve on this further, I am considering possibly using chase bullets when my energy level is less than the opponent's, which should make it harder for the opponent to shield.
Version Notes
Version Ranks
Note: Best Change and Worst Change are the change from previous version against the given opponent.
Note: Starting from version 6.4 onward in the table, I am ignoring nat.BlackHole 2.0gamma and nat.Samekh 0.4, as scores against them always fluctuate rather wildly.
Version | 1-on-1 Rank | Top | Best Change | % Score Change | Worst Change | % Score Change |
---|---|---|---|---|---|---|
1.0 | ~475 / 805 | 59% | N/A | N/A | N/A | N/A |
2.0 | 386 / 806 | 48% | mld.Wisdom 1.0 | 4.18 -> 76.13 | SuperSample.SuperCrazy 1.0 | 61.97 -> 37.00 |
2.1 | 320 / 805 | 40% | dz.MostlyHarmlessNano 2.1 | 20.90 -> 63.01 | jf.Dodger 1.1 | 78.98 -> 41.10 |
3.0 | 148 / 805 | 18% | gg.Wolverine 2.0 | 41.08 -> 94.57 | xiongan.Xiongan 1.1 | 100.0 -> 74.39 |
3.1 | 145 / 804 | 18% | zyx.nano.RedBull 1.0 | 53.4 -> 85.3 | pulsar.PulsarNano 0.2.4 | 89.3 -> 64.2 |
3.2 | 116 / 806 | 14% | ags.polished.PolishedRuby 1 | 28.5 -> 83.5 | rsim.micro.uCatcher 0.1 | 91.7 -> 31.8 |
3.3 | 115 / 806 | 14% | nat.Samekh 0.4 | 24.9 -> 64.9 | simonton.micro.GFMicro 1.0 | 62.2 -> 39.2 |
3.4 | 85 / 806 | 11% | dsx724.VSAB_EP3a 1.0 | 67.2 -> 93.4 | intruder.PrairieWolf 2.61 | 65.6 -> 48.4 |
3.5.1 | 94 / 805 | 12% | rsim.micro.uCatcher 0.1 | 21.3 -> 96.4 | nat.BlackHole 2.0gamma | 69.2 -> 42.5 |
3.8 | 81 / 805 | 10% | synapse.rsim.GeomancyBS 0.11 | 36.5 -> 49.8 | mn.Combat 1.0 | 80.1 -> 60.8 |
3.9 | 75 / 805 | 9.3% | pez.mini.ChironexFleckeri 0.5 | 42.2 -> 64.9 | rsim.mini.BulletCatcher 0.4 | 57.7 -> 7.0 |
4.0 | 92 / 805 | 11% | rsim.mini.BulletCatcher 0.4 | 7.0 -> 72.1 | nat.Samekh 0.4 | 73.3 -> 45.2 |
4.1 | 74 / 805 (73.66 APS) | 9.2% | nat.Samekh 0.4 | 45.2 -> 75.7 | staticline.whiskey.Whiskey 0.6 | 75.5 -> 57.5 |
4.2 | 74 / 805 (73.73 APS) | 9.2% | mladjo.iRobot 0.3 | 53.8 -> 69.9 | jcs.AutoBot 4.2.1 | 60.1 -> 35.1 |
4.3 | 74 / 805 (73.92 APS) | 9.2% | kc.mini.Vyper 0.311 | 33.0 -> 53.0 | positive.Portia 1.26e | 60.0 -> 36.2 |
4.4 | 71 / 805 (74.11 APS) | 8.8% | pez.frankie.Frankie 0.9.6.1 | 45.9 -> 62.8 | fromHell.CHCI3 0.1.4 | 74.4 -> 55.7 |
4.4.1 | 71 / 805 (74.11 APS) | 8.8% | brainfade.Fallen 0.63 | 45.7 -> 65.5 | jam.micro.RaikoMicro 1.44 | 64.0 -> 49.8 |
4.5.1 | 71 / 805 (74.25 APS) | 8.8% | spinnercat.CopyKat 1.2.3 | 51.6 -> 69.3 | synapse.rsim.GeomancyBS 0.11 | 54.4 -> 38.6 |
4.6 | 71 / 805 (74.35 APS) | 8.8% | deo.virtual.RainbowBot 1.0 | 54.8 -> 69.1 | jab.DiamondStealer 5 | 80.6 -> 61.7 |
4.8 | 57 / 803 (76.46 APS) | 7.1% | ar.QuantumChromodynamics 1.2.1 | 69.2 -> 90.5 | nat.BlackHole 2.0gamma | 60.8 -> 42.0 |
5.0 | 70 / 805 (74.37 APS) | 8.7% | deo.FlowerBot 1.0 | 53.4 -> 84.6 | kcn.unnamed.Unnamed 1.21 | 79.1 -> 58.0 |
5.1 | 49 / 815 (78.59 APS) | 6.0% | ary.SMG 1.01 | 35.5 -> 90.3 | nat.BlackHole 2.0gamma | 54.4 -> 33.0 |
5.1.1 | 49 / 815 (78.75 APS) | 6.0% | rz.Apollon 0.23 | 69.6 -> 94.0 | nat.Samekh 0.4 | 72.7 -> 53.6 |
6.1.8 | 59 / 806 (76.65 APS) | 7.3% | cx.Princess 1.0 | 47.8 -> 65.1 | toz.Gnome 1.1 | 88.4 -> 61.6 |
6.2 | 59 / 806 (76.84 APS) | 7.3% | nat.BlackHole 2.0gamma | 42.1 -> 67.0 | stelo.RamTrackSurfer 1.2 | 89.2 -> 72.9 |
6.3 | 56 / 806 (77.04 APS) | 6.9% | kid.Gladiator .7.2 | 47.7 -> 65.5 | nat.BlackHole 2.0gamma | 53.4 -> 33.3 |
6.4 | 51 / 806 (78.22 APS) | 6.3% | dmp.micro.Aurora 1.41 | 62.1 -> 79.1 | myl.micro.NekoNinja 1.30 | 77.3 -> 61.3 |
6.5 | 48 / 808 (78.70 APS) | 5.9% | ncj.MoxieBot 1.0 | 76.9 -> 92.6 | bayen.nut.Squirrel 1.621 | 89.3 -> 74.9 |
6.7 | 45 / 807 (79.17 APS) | 5.6% | apv.ScruchiPu 1.0 | 57.9 -> 79.5 | trab.nano.AinippeNano 1.3 | 91.4 -> 74.7 |
6.8 | 42 / 808 (79.69 APS) | 5.2% | trab.nano.AinippeNano 1.3 | 72.2 -> 89.5 | rampancy.Durandal 2.2d | 81.5 -> 69.4 |
9.0 | 46 / 827 (79.73 APS) | 5.6% | N/A | N/A | N/A | N/A |
9.0.1 | 45 / 827 (80.03 APS) | 5.4% | ary.SMG 1.01 | 50.5 -> 76.4 | ncj.MoxieBot 1.0 | 95.5 -> 75.5 |
9.1 | 43 / 828 (80.25 APS) | 5.2% | kc.mini.Vyper 0.311 | 54.7 -> 60.7 | ab.DangerousRoBatra 1.3 | 74.0 -> 66.7 |
9.2 | 38 / 828 (80.84 APS) | 4.6% | Bemo.Sweet30 1.6.1 | 57.9 -> 68.3 | kenran.mega.Pantheist | 75.3 -> 57.1 |
9.3 | 34 / 829 (81.35 APS) | 4.1% | ags.micro.Carpet 1.1 | 76.3 -> 89.2 | ary.SMG 1.01 | 81.2 -> 64.9 |
9.4 | 33 / 830 (81.55 APS) | 4.0% | kenran.mega.Panthiest | 73.9 -> 85.3 | bayen.nut.Squirrel 1.621 | 88.8 -> 80.9 |
9.5 | 30 / 830 (81.71 APS) | 3.6% | wiki.BasicGFSurfer | 65.3 -> 75.5 | rampancy.Durandal 2.2d | 80.3 -> 67.6 |
9.6 | 28 / 830 (81.91 APS) | 3.4% | darkcanuck.Gaff 1.50 | 43.3 -> 52.4 | kenran.mega.Panthiest 1.1 | 89.6 -> 78.9 |
9.7.1 | 25 / 832 (82.05 APS) | 3.0% | rampancy.Durandal 2.2d | 77.8 -> 88.3 | brainfade.Fallen 0.63 | 64.0 -> 57.0 |
9.8 | 25 / 832 (82.12 APS, 1600 PL) | 3.0% | asm.Statistas 0.1 | 70.4 -> 77.1 | wcsv.PowerHouse.PowerHouse 1.7e3 | 53.9 -> 46.8 |
9.9.5 | 24 / 831 (82.37 APS, 1604 PL) | 2.9% | ncj.MoxieBot 1.0 | 74.9 -> 86.0 | cx.mini.Cigaret 1.31 | 64.9 -> 55.2 |
9.15 | 20 / 833 (82.74 APS, 1646 PL) | 2.4% | janm.Jammy 1.0 | 75.2 -> 91.4 | davidalves.net.DuelistMicro 1.22 | 72.1 -> 63.8 |
10.13 | 19 / 837 (82.98 APS, 1658 PL) | 2.3% | whind.StrengthBee 0.6.4 | 56.8 -> 67.8 | rc.yoda.Yoda 1.0.6c.fix | 74.6 -> 63.9 |
10.15 | 19 / 837 (83.11 APS, 1658 PL) | 2.3% | cf.proto.Chiva 2.2 | 61.5 -> 68.0 | florent.XSeries.X2 0.17 | 62.3 -> 56.7 |
10.18.1 | 16 / 837 (83.20 APS, 1656 PL) | 1.9% | jab.avk.ManuelGallegus 0.6 | 70.4 -> 82.1 | dft.Virgin 1.25 | 73.6 -> 63.2 |
10.22 | 16 / 837 (83.59 APS, 1664 PL) | 1.9% | voidious.mini.Komarious 1.88 | 54.4 -> 65.8 | robar.micro.Topaz | 74.1 -> 65.5 |
11.0 | 10 / 840 (84.26 APS, 1668 PL) | 1.2% | florent.XSeries.X2 0.17 | 58.6 -> 70.0 | ary.micro.Weak 1.2 | 68.1 -> 58.4 |
11.3 | 9 / 841 (84.41 APS, 1674 PL) | 1.1% | pez.micro.Aristocles 0.3.7 | 67.6 -> 74.3 | brainfade.Fallen 0.63 | 70.5 -> 64.8 |
11.4 | 10 / 953 (84.92 APS, 1888 PL) | 1.1% | ags.micro.Carpet 1.1 | 80.3 -> 85.1 | abc.Shadow 3.83c | 54.9 -> 48.4 |
11.5 | 10 / 953 (84.94 APS, 92.52 S, 1890 PL) | 1.1% | Unavailable | Unavailable | ||
11.6 | 8 / 953 (85.14 APS, 92.73 S, 1890 PL) | < 1% | Unavailable | Unavailable | ||
11.16 | 9 / 971 (85.21 APS, 92.97 S, 1928 PL) | < 1% | Unavailable | Unavailable | ||
12.0.1 | 8-9 / 971 (85.54 APS, 93.38 S, 1934 PL) | < 1% | kc.serpent.Hydra 0.21 | 60.4 -> 97.3 | dsx724.VSAB_EP3a 1.0 | 98.2 -> 77.4 |
12.1 | 7 / 972 (86.09 APS, 93.89 S, 1932 PL) | < 1% | ph.mini.Archer 0.6.6 | 64.7 -> 98.5 | cx.mini.Nimrod 0.55 | 99.3 -> 69.9 |
12.2* | 7 / 976 (86.36 APS, 94.00 S, 1942 PL) | < 1% | synapse.rsim.GeomancyBS 0.11 | 40.0 -> 69.6 | kc.serpent.Hydra 0.21 | 99.4 -> 82.6 |
12.3* | 6 / 980 (86.60 APS, 94.10 S, 1948 PL) | < 1% | davidalves.Firebird 0.25 | 78.0 -> 97.6 | sm.Devil 7.3 | 79.4 -> 69.0 |
12.4* | 6 / 980 (86.68 APS, 94.10 S) | < 1% | rc.yoda.Yoda 1.0.6c.fix | 71.0 -> 87.6 | Legend.BoulderZY 1.4.9 | 95.0 -> 69.5 |
12.5* | 5 / 984 (87.19 APS, 94.72 S) | < 1% | simonton.mini.WeeksOnEnd 1.10.4 | 57.8 -> 83.8 | jf.Dodger | 96.9 -> 70.0 |
(*) Version 12.2+ scores are greatly affected by what clients run them. On some clients, a lot of skipped turns occur in the first round, typically causing the bullet shielding mode to fail. 12.3+ should be slightly better due to some CPU usage improvements, but the problem remains. There was very little effect on 12.3 - 12.5 due to who all was running clients at the time and possibly also due to the CPU usage improvements.
Version CPU Usage
All values are averages in milliseconds with the exception of those listed as Peak values, which are the maximum time in milliseconds encountered during a typical 35 round battle.
Version | Notes | Gun Avg/Tick | Gun Peak | Drive Avg/Tick | Drive Peak |
---|---|---|---|---|---|
6.5 | Single wave surfing, single guess factor gun. | 1.01 | 13.41, 8.77, 8.41, 7.15, 6.94 | 0.21 | 7.70, 7.61, 6.93, 6.93, 6.49 |
9.13 | Multi-wave surfing, single guess factor gun. | 0.301 | 6.23, 6.21, 5.82, 5.13, 4.74 | 0.775 | 22.52, 20.01, 16.26, 16.23, 15.94 |
9.14 / 10.0 | Multi-wave surfing, gun array with 3 guess factor guns, Levy's KD Tree. | 0.182 | 6.13, 6.07, 5.24, 4.05, 3.93 | 0.544 | 15.24, 14.55, 14.13, 13.91, 13.78 |
11.0 | Multi-wave surfing, gun array with 2 guess factor guns, Levy's KD Tree, unoptimized Precise MEA on guns | 0.978 | 140.3, 27.06, 21.98, 20.92, 17.43 | 0.558 | 21.34, 20.03, 18.62, 17.41, 15.32 |
11.3 | Multi-wave surfing, gun array with 2 guess factor guns, Levy's KD Tree, optimized Precise MEA on guns | 0.631 | 12.79, 12.65, 9.98, 8.76, 8.68 | 0.543 | 19.16, 15.21, 14.57, 14.51, 14.40 |
11.4 | Multi-wave surfing, gun array with 2 guess factor guns, Rednaxela's 3rd Gen KD Tree (w/ bucket size 64 and MaxHeap copied to List every search; might be better way to do this), optimized Precise MEA on guns | 0.603 | 13.40, 9.15, 8.84, 8.76, 8.74 | 0.545 | 16.99, 15.04, 14.73, 14.39, 14.23 |
12.3 | The same as 11.4, but with processing performance improvements. The biggest improvement made to the direct drive predictor. For more details, see version notes for 12.3. | 0.267 | 5.23, 4.44, 3.77, 3.28, 2.98 | 0.299 | 7.34, 6.95, 6.81, 6.71, 6.60 |
Series Notes
Series 1.x
This series of robots was released while work on the Xander framework was still ongoing. Targeting and drive strategies were somewhat simple. No surfing or guess-factor targeting.
Series 2.x
This series introduced my earlist concept on guess factor targeting. Drive strategy was still simple.
Series 3.x
This series introduced wave surfing, and improvements to the guess factor gun. Version 3.0 used a modified version of the BasicGTSurfer wave surfing drive as a reference point, with all later versions in the line using a wave surfing drive of my own design. Towards the end of this line, I introduced virtual hit ratios, where all guns would provide aiming information for every shot to determine whether or not their aims would have hit the target or not.
Series 4.x
This series focused largely on drive improvements, including improvements to the wave surfing drive, dive protection, and a new Ram Escape drive. This series also improved how fire power is selected.
Series 5.x
This series focuses on using a new strategy for calculating factors in guess factor guns and wave surfing drives, surfing multiple waves simultaneously (explored by never implemented), paying more attention to robot width, improving wall avoidance, and improving segmentation selection and processing.
Series 6.x
XanderCat series 6 focuses on taking everything learned so far and evolving it into a new set of components, or at the very least, cleaning up old components or features that did not work out. Series 6 introduces the new Evolution Drive, an updated Wave Surfing drive, and new ways of handling factor arrays.
Series 7.x
XanderCat series 7 uses the first release-ready version of the Xander framework. With the knowledge gained over prior versions of XanderCat, the Xander framework has undergone a final refactoring and cleanup and is now considered ready for public use. The Xander framework can be considered as version 1.0. In addition to using the finished Xander framework, series 7 may see updates to the main drive and gun, as well as a first release into the melee competition.
Series 8.x
This series will use my own take on using a K-nearest-neighbor (KNN) approach for the main drive and gun. It may also finally introduce surfing multiple waves at once.
My KNN approach to to create a KNN Factor Array Processor that can be used in both drives and guns. I already have a FactorArrayProcessor interface built into my guess factor / wave surfing framework that it will utilize. However, instead of saving a large number of factor arrays and combining them, it will instead store a tree of data points, retrieve the closest data points to the current situation, and build a single factor array from those data points. One advantage of this approach is that is should allow for a greater number of segmenters and slices per segmenter.
Series 9.x
This series uses the updated Xander framework version 2.0. There are a variety of changes as a result. This series saw the first introduction of bullet shadows.
Series 10.x
The "Pro" series. This series switched to using a true KD Tree for drive and gun data. However, many of the versions in this series were just parameter adjustments. The only other major feature changes were to fix the buggy bullet shadows implementation introduced in series 9 and to begin (but not fully switch over to) the Xander Painting Framework.
Series 11.x
This series attempts to add some revised functionality in an attempt to break into the top 10, or at least get very close. This series will also see another round of code cleanup to reduce code size and fully utilize the Xander Painting Framework and Xander File Utility (removing any old code that the new frameworks can take over for).
Current Series Version Notes
Version 12
In series 12, I was attempting to build some new surfing components, but I generally didn't have much success doing so. Therefore, I instead decided to go back to what I am good at -- multi-mode operation -- and added some new modes that should inflict a new round of pain on my unsuspecting foes.
New Features:
Xander Framework Updates
- Segmenter interfaces cleaned up and updated to reflect modern usage. All segmenter implementation classes updated to use the new interfaces. This change was validated in 11.10 and did not affect APS (although it did slightly reduce code size and overhead).
- Updated resources and related classes such that separate FactorIndexers can be used for self and opponent instead of a single FactorIndexer for both.
- Fix bug in guess factor targeter class where some aim attempts could be ignored due to the failure to normalize the aim degrees. This caused occasional delays in firing.
XanderCat Updates
- Added new bullet shielding mode to the component chain. Feel the pain, boys! (poor Hydra)
- Added new ramming mode to the component chain. This is only used in very limited circumstances -- when the opponent is at very low energy and has stopped firing. This adds insult to injury on opponents who are vulnerable to the new bullet shielding mode. (sorry, I can't help myself!)
- Turned off auto-fire on disabled opponents in the configuration. XanderCat rams them now.
- History size increased from default of 80 to 120 (the default history size was occasionally too small).
- Fixed possible rare NPE bug in a couple of places where obtaining a robot history snapshot did not appropriately handle the rare case where a snapshot doesn't exist (one example where this can happen is a skipped turn resulting in missing a snapshot for self).
- Updating drive data roll parameters, including the use of a new non-linear roll function to replace the previous linear function.
Version 12.0.1
- Fixed bug in bullet shielding scenario so scenario will disengage if the opponent is not firing any bullets.
Version 12.1
In this version, the bullet shielding components have been reworked to fix a number of problems. You can tell version 12.0.x is not operating at full potential by comparing it's results to another bullet shielder like BulletCatcher. I believe the new components, while still not perfect, are much improved.
Xander Framework Updates:
- Add new AbstractGun class that implements Gun and handles the actual firing of bullets, leaving aiming up to subclasses. Changed XanderGun to extend AbstractGun. These changes make it easier to build guns when not utilizing XanderGun.
XanderCat Updates:
- Change parameter for BulletShieldingScenario condition 1 so that scenario will activate immediately on start of round, rather than allowing 20 or so ticks for IdealPositionDrive to improve positioning. I'm still not sure which way is better. In my initial testing, it was a wash either way. If shielding right away, you can successfully shield against more opponents, but it takes away a little score from opponents who cannot be shielded against. I need a lot more testing to refine which way is better. For now, because it will be more interesting, I'm going with immediate shielding activation.
- Change BulletShieldingScenario condition 3 to check for ((time - lastOpponentFireTime) < 250) instead of (opponentBulletsFired > 0). This condition is for handling opponents who are not firing bullets, and the change fixes it to work at any time in the battle instead of just checking the beginning of the first round. This fixes the survival anomaly against ad.last.Bottom, and could potentially apply to other opponents under various special conditions.
- Change BulletShieldingScenario condition 7 to use opponent bullet power cutoff of 0.2 instead of 0.3.
- Change BulletShieldingScenario condition 8 to use shielding shot cutoff of 20 shots instead of 10.
- Change bullet shielding drive strategy to standing still when opponent is moving at the time they fire (as in previous version), but shifting position when opponent is standing still at the time they fire. (Why???? Why does it work this way???? Whatever.)
- Fixed a couple of bugs related to using getDistanceRemaining() with bullet shielding control sequence. The only real impact with my current usage is that it prevents the possibility of a brief "runaway robot" when switching from some other scenario to the bullet shielding scenario.
- BulletShieldingScenario now ensures that bullet shielding components are properly reset to initial condition when scenario is deactivated and then reactivated later.
- Created new BulletShieldingGun (that extends the new AbstractGun). It replaces the BulletShieldingTargeter and BulletShieldingPowerSelector used previously. For bullet shielding, the aiming and power selection are too closely intertwined to continue using a separate targeter and power selector approach like I use for other guns.
Some interesting shielding notes:
- My shielding doesn't work against a few opponents, like Phoenix, but those same opponents can be shielded by other bullet shielders. Why? More research needed.
- For a few opponents, shielding only works if the shielder stands still from the very beginning (note my change to shielding condition 1). Some examples of this include Engineer (definitely) and SniperFrog (I think). XanderCat 12.0.x will move to improve it's position in the first 20 ticks or so before stopping to try to shield. This apparently pollutes the data Engineer is collecting rendering shielding ineffective. More testing is needed to determine if it is better over the entire rumble to improve positioning as in XanderCat 12.0.x or to hold still, risking worse positioning against the greater field for the benefit of a few shielding vulnerable opponents like Engineer.
- The new BulletShieldingGun (that extends AbstractGun) that I created can adjust fire power to try to hit opponent bullets at a time midpoint. However, if the required power adjustment exceeds a set threshold (currently 0.2), it just falls back to using power 0.1. In some initial testing, the power adjustment was only occurring on about 7% of shots. I don't expect this feature to provide a noticeable benefit, so I've opted to leave this function off for XanderCat version 12.1. I may throughly test it out for potential use in a later version however.
Version 12.2
- Fixed bug where opponent wave too close test in the bullet shielding controller was failing to correctly report when opponent was too close. This bug is the main reason the previous version was losing to GeomancyBS, and was also hurting scores against other close fighting opponents.
- Opponent too close test in the bullet shielding controller now factors in time remaining until gun cool when deciding if an opponent wave is too close to shield against. This allows us to get out of the way sooner of any shot that cannot be shielded against due to waiting on the gun to cool.
- Increased required lead time for an opponent wave from 6 to 7 ticks.
- Add condition to stop trying to bullet shield for the rest of the battle if the opponent is repeatedly not firing first (more than 3 consecutive times in the same round)
- When opponent is under 8 energy remaining, required distance from opponent is increased by a set amount. This is intended to prevent being hit by low power shots that cannot be shielded against and that other scenarios will not have enough time to dodge.
Version 12.3
This version focuses on enhancing/reducing CPU usage in hopes this will fix skipped turn issues and bullet shielding failures on some clients.
- Moved some direct drive predictor function calls inline rather than calling methods on utility classes; this reduced function calls and reduced the number of objects created on some methods.
- Updated direct drive predictor to perform fewer drive bounds .contains checks.
- Updated direct drive predictor to cache trig values for last heading rather than recalculate every time a drive state is advanced.
- Removed a few log statements that get ignored anyway. This removes a few unnecessary String creations.
Version 12.4
- Fix bug where missed shielding shot can go unnoticed. This could potentially happen repeatedly causing loss of round.
- Improve how lead time required for successful shielding is calculated. This improves shielding against close fighting opponents.
- Assume firepower of 0.1 for opponent shots fired when their energy is less than 0.1. This seems to be how Robocode 1.7.3.x works.
- Fix bug in linear intercept calculation where computed double value (one value minus another) is compared to zero. Due to imprecise doubles, the correct behavior it to compare to almost zero. This bug could result in the occasional firing of a bullet in a bizarre direction.
- Fix bug where bullet shielding gun can get stuck (disabled) on a really low power bullet due to not being able to compute a linear intercept.
Version 12.5
Framework Updates
- Add new checks of velocity and gun cool time to try to avoid registering an opponent wall hit as firing a bullet.
- Bullet Shielding Gun updated to allow for multiple opponent targeting types.
- Bullet Shielding Drive now moves only a tiny amount when moving to shield against a stationary opponent.
XanderCat Updates
- Add secondary targeting type to the Bullet Shielding Gun. (same as is used in Spitfire)
- Ideal Position Drive will now hold position instead of driving to center of battlefield when no opponents remain.
- No longer ram disabled opponents when shielding.
Version 12.6
Rednaxela's KD Tree Update:
- Updated Rednaxela's 3rd gen KD Tree so that the heaps returned from a search have methods to directly access the data and keys by index. This was done to support multiple iterations through the same data of a KD Tree search. Data accessed in this manner is not returned in order (I don't need it to be; I just need to be able to iterate through the data multiple times without having to re-execute the same search; this is handled by my CachingLogReader and is utilized when there are multiple guns or drives using the same KNN parameters).
Framework Updates:
- Expanded auto fire on disabled opponents functionality such that conditions can be specified for when auto fire is allowed.
- Reworked how opponent gun fire detection works when opponent has collision with wall. If opponent is assumed to have gun heat remaining, assume no bullet was fired unless the previous shot happened on a known collision. A known collision is any time a velocity change exceeds the maximum deceleration rate. If no heat remaining on a known collision, assume a bullet was fired, but skip the gun heat check the next time an energy drop is detected. There is no way to know for sure what the bullet power is, so assume the bullet power is the same as the previous shot. The following possible errors remain from this approach:
- A slow collision when gun heat is 0 will not be detected as a collision. This will result in a false wave. Furthermore, the next real wave will likely be missed as the system will assume a shot could not have been fired due to assumed gun heat remaining after the previous wave.
- A correctly detected collision when gun heat is 0 will assume a bullet of the previous fire power has been fired. It may be that no bullet was fired, or possibly a bullet with a different firepower. I don't see any way to resolve this. However, the next wave should not get missed if no bullet or a lower power bullet was fired because the system skips the gun heat check for the next wave after a collision.
- Saving the number of battles for each individual opponent and the total battles for all opponents to the battle statistics file is now a function of the framework. This data is only saved if the robot is saving other information to the battle statistics as well.
- Robots can now have the framework save gun, drive, and radar run times to the battle statistics file using settings in the Configuration.
- Added utility method to the BattleStats class to simplify saving averages to the battle statistics file.
- Updated getActiveGunName() in AbstractXanderRobot to return the disabled robot gun name when the disabled robot gun is in use.
- Updated Graph Data and CPU Utilization painting to allow graph to be resized, fix a bug in the data end points, and allow CPU constant to be graphed.
XanderCat Updates:
- Revise generic KNN log reader to return a data iterator instead of a data point list. This should mostly eliminate the massive overhead of creating a List for each read when using Rednaxela's KD Tree in order to match the interface. This will also make data point KD Tree distance available on each point, something previously unavailable that could improve performance if used when filling the factor arrays.
- Use KD Tree distance for each point to adjust the weight of data points in the constructed factor arrays.
- Adjust KNN selection parameters on the drive from (1, 30, 0.3) to (10, 40, 0.4) where values are (minK, maxK, K growth rate)
- Start recording drive and gun run time stats in the saved battle statistics file.
- Auto-fire on disabled opponents turned back on, with condition that if the bullet shielding gun is active, there must be no active opponent waves. Ramming will now only be used on low energy opponents who have stopped firing but are not disabled.
- Fix issue where shielding vulnerable opponents repeatedly get too close to shield against. This was fixed by switching to using a disengage distance and a re-engage distance, rather than a single required distance check. This keeps the bullet shielding scenario from bouncing on and off against opponents who keep nudging closer.
- Add workaround for rare bug where bullet shielding system gets stuck with the drive in the Firing state but the gun requesting a wave to shield against. Previously the controller would just return null when a wave was requested if the drive wasn't in Standing state. This is now updated so that if a wave is requested when the drive is in Firing state, the controller requests the drive return to Standing state (normally this happens when the gun fires, but somehow this fails on rare occasions).
- Update move to standing steps in the drive to immediately switch to Standing state if the drive shift was 0. This saves an extra tick on most shielding shots. This was previously done for the move to firing step, but was previously overlooked for the move back to standing.
Version 12.7
- Start utilizing Gun Heat Waves (assuming I come up with an implementation that improves score in a statistically significant way)?
Future Version Possibilities
Possible Features
- Update gun data roll procedure.
- New drive system for wave surfing? This was tested and so far has not proved advantageous, so the likelyhood of it making it into the final version is dropping.
- Add 2 new segmenters to the guns.
- Possibly update how danger is modified based on distance.
- Figure out how to pummel PrairieWolf.
- Add tracking of certain types of "errors" to help with improvements (for example, keep and report on a count of how often the robot runs into walls, or fails to reach it's intended location)
- Modify segmenters?
- For logged battle stats against each opponent, instead of keeping a single average for stat values, keep two sets of stat values: one for the best battle against them, one for the worst battle against them.
- Segmenter changes? (possibly a new type of segmenter)
- Try out a "performance-based distancing equation"?
- Implement several speed improvements?
- Maybe tweak some other parameters?
- Improve bullet shielding protection?