Robo Home | Changes | Preferences | AllPages

My bots (active):

Name WeightClass Rating
Archer MiniBot 1803
Musketeer MegaBot 1791
Pikeman MicroBot 1778

My bots (old):

Name WeightClass Rating
Jester MegaBot
Thinker MegaBot 1505

Old discussion: Ph/archive2006
I'm back again (2007-05-21) and working on the next Mega Bot. The temporary name is ArcherMax?, as it's based on Archer and I want it perform much better (read: 1900+ RR@H rating, at least for now). As for now the main focus is the gun (testing on TargetingChallenge2K7/ReferenceBots). The next thing to add will be probably WaveSurfing (thanks to the new tutorial should be quite easy to start implementing).

Hey, welcome back! Both Musketeer and Archer have given me headaches from time to time, they are excellent bots. We even considered Archer for the TC2K7 (you can see it listed on the TargetingChallenge2K7/Voting); it didn't get selected in the end, but there was some very stiff competition there =) ... I look forward to seeing what you can come up with next! Best of luck, cheers, -- Voidious

It's nice that Archer was considered. About ArcherMax? - I made some measurable progress with the gun. Here are the statistics (like in TargetingChallenge2K7/Results, but they're too low to post there):

Archer 09,73 88,38 71,55 49,18 06,97 39,14 13,60 12,11 07,02 30,90 32,86
ArcherMax? 16,06 87,72 62,75 71,30 60,33 80,29 04,13 55,31 21,70 78,38 53,80

As you can see there is a visible improvement. What did I change? ArcherMax? uses array or VirtualGuns: HeadOn?, Circular, PM, non-segmented GF and Highly-segmented GF (the last one is identical to Archer's gun). I'm proud of how the VirtualGuns are implemented. Some code snippets:

static VirtualGunManager vgm = new VirtualGunManager();
static {
    vgm.addGun(new HeadOnGun());
    vgm.addGun(new CircularGun());
    vgm.addGun(new PMGun());
    vgm.addGun(new GFGun());
    vgm.addGun(new HighlySegmentedGFGun());
public class HeadOnGun extends Gun {
    public HeadOnGun() {
    public double getGunHeading() {
        return robot.enemyAbsoluteBearing;

-- Ph

Nice improvement, indeed. The surfers I can understand, but that score difference against RaikoMicro is very surprising. Makes me wonder if one of the following is true: a bug in the old gun; a super high number of segments (I think I remember reading that about a gun of yours); only firing waves in sync with bullets, instead of every tick? If you don't mind one simple suggestion, a gun with a very low RollingAverage will fix up your scores against WaveSurfers very easily, though most of the RoboRumble points come from non-surfers anyway. Also, note that two new TargetingChallenge's have a much higher percentage of WaveSurfers than the actual RoboRumble. -- Voidious

It could be a bug or too-much segmented gun. All my GF guns fire waves every tick, just VirtualGunManager? weights real waves more. Here are some stats from my VGunManager? from battle with RaikoMicro:

ph.archer.HeadOnGun? 211628.0
ph.archer.CircularGun? 145017.0
ph.archer.PMGun 187458.0
ph.archer.GFGun 211572.0
ph.archer.HighlySegmentedGFGun? 204052.0

The second column is weighted number of hits of virtual bullets (real bullets are weighted more, as written above). So it used mostly HeadOn? and GF (unsegmented), and Circular a bit at the beginning. As Archer uses the HighlySegmentedGFGun?, it probably means that it is too much segmented for RaikoMicro.

Thanks for your suggestion about hitting WaveSurfers using very low RollingAverage, but I don't know how to use it. My GF guns use guess factors arrays (like int[] gfs = new int[27] for non-segmented gf gun). How can I adapt it to using RollingAverage? Would it be a good way to have double gf and doing PaulEvans?' RollingAverage function with some weight and low depth on it?

-- Ph

Here is an example I snipped from Caffeine's current CVS branch. This is from within the wave update loop.

int index = (int)round(limit(0,((gunFactorIndexes-1)/2)*(gf+1.0), gunFactorIndexes));
for(int i=0;i<gunFactorIndexes;i++) {
	//wave.stats[i] += wave.weight / (abs(index - i) + 1);

	//wave.stats[i] = rollingAvg(wave.stats[i], (index == i) ? wave.weight : 0,
	//	min(wave.shotNumber, gunRollingAverageShot), gunRollingAverageWeight);

	//rolled and smoothed
	wave.stats[i] = rollingAvg(wave.stats[i], wave.weight / (abs(index - i) + 1),
		min(wave.shotNumber, gunRollingAverageShot), gunRollingAverageWeight);

It just iterates through the array. The array here is stored within a wave, as its easier in my opinion.


Yeah, I use double gf bins and Paul's RollingAverage method, it's pretty simple to implement. Other people use other ways of decaying stats, but anything that gives more weight to recent data will help against the surfers. Still, hitting surfers isn't always the best thing to focus on, so I'm sorry if I'm distracting you by bringing it up =) -- Voidious

I agree with that, hitting the other ~450 bots is far more important, so a modarate but well chosen segmentation should give you the best performance for 35-round battles. Do note that movement still is far more important than targeting, but that the possible problems are proportional. And of course: Welcome back! Your 'old' bots still are hard to beat! -- GrubbmGait

@Voidious - your advice was very helpful, and besides adding an AntiWSGun? with rolling average snippet by Chase-san I fixed VirtualGunManager? so it's not-so-much fooled by surfers.

By the way, I also added a DynamicallySegmentedGun?, which with "splitters" only for distance, velocity and acceleration performs in some situations much better than all other ArcherMax?'s guns. I'm going to add many more, like time since last stop etc.

Okay, so here are the most recent TargettingChallenge2K7? stats:

Archer 09,73 88,38 71,55 49,18 06,97 39,14 13,60 12,11 07,02 30,90 32,86
ArcherMax? (22 May) 16,06 87,72 62,75 71,30 60,33 80,29 04,13 55,31 21,70 78,38 53,80
ArcherMax? (23 May) 53,64 89,77 76,71 71,77 59,32 78,46 48,89 58,08 55,33 74,85 66,68

That's pretty nice result for only few days of coding, so the next thing to improve will be movement.

-- Ph

Not bad, though its not entirely to hard to get around 66 to 70 area of the TC2K7, I managed 67.27 with a unsegmented gun, I would recommend the earlier ones for a more realistic rating of your gun, and then use 2K7 to fine tune it vs the top movers. --Chase-san

Sure, there is huge room for improvement, and I'll certainly try to use it. The DynamicSegmentationGun? looks very promising, as written earlier. We'll see how it'll perform after adding more splitters.

Now about the movement. Stats are in MovementChallenge2K6 format, and are quite good IMHO (of course still not comparable to the top bots).

ArcherMax? (no WaveSurfing) 20,91 16,25 17,28 18,15 20,40 14,19 22,67 16,83 17,90 18,82
ArcherMax? (WaveSurfing) 97,36 83,82 78,49 86,56 35,16 16,29 62,28 14,85 31,14 50,95

Voidious, your WaveSurfing/Tutorial was very helpful during development of WaveSurfing movement for ArcherMax?. Thanks! I tweaked it to keep distance, use segmentation and evaluate stop position.

-- Ph

Wow, you're getting there quickly. To me it seems that this combination is almost The2000Club worthy, if you can pump up the scores against botB and botC a bit you will knock on the door. -- GrubbmGait

That would be exciting! The problem is that I'm stuck trying to increase these scores in WaveSurfingChallenge. I actually improved movement aginst more advanced targeters, but still nothing with the simple ones. Any tips? Is it precision, segmentation, taking multiple waves into account? -- Ph

Having the PrecisePrediction exactly correct is very important for simple targeters. If you worked off of the WaveSurfing Tutorial, it should be correct to start, but it's possible some changes you made got it out of sync. You said you added distancing - did you modify the prediction to also predict your distancing? Also, if you are WallSmoothing, having some type of "dive protection" to make sure you don't get too close to the enemy is important. Those would be the first things that I'd look for. -- Voidious

I recommend taking time t understand exactly how the prediction works, at first it was over my head and just accepted it. But that caused many problems, and taking it apart actually gave me a better understanding of how robots move. --Chase-san

Thanks for your comments. So what I have done: re-read prediction code to make sure I understand it; examined predition using graphical debugging (onPaint) and looked closer at dive protection efficiency. Conclusion: distancing is probably (beacuse I'm not 100% sure) accurate (distancing is almost the same as in Komarious, just added a few things here and there, like different behavior when there are no surfable waves and the enemy is close, different dive protection); dive protection generally works, there are few cases when it fails, but they're minority; the biggest problem seems to be choosing the best destination point. I have to further investigate this issue but now it goes like this: I draw three points - forward, stop and reverse position and mark the one with minimum danger. Sometimes the point with "minimum" danger is the most dangerous, and sometimes the robot drives in exact opposite direction to the "optimal" point. I don't know (yet) why it happens (but it happens even with WSCBotA), but will post updates about the progress. As it could be difficult to guess what's wrong based only on this description, if I get really stuck I will upload the dev version to repository and see what can be told based on that. -- Ph

Update: one step ahead, one back. Better score against WSC Bots, others worse:

ArcherMax? (no WaveSurfing) 20,91 16,25 17,28 18,15 20,40 14,19 22,67 16,83 17,90 18,82
ArcherMax? (WaveSurfing), 24 May 97,36 83,82 78,49 86,56 35,16 16,29 62,28 14,85 31,14 50,95
ArcherMax? (WaveSurfing), 06 June 97,13 91,85 86,04 91,67 20,26 27,11 47,09 13,58 29,26 47,06

I'm somewhat frustrated with the drop against FloodHT and in APMC (and quite satisfied with WSC results). I changed distancing, segmentation, and added rolling averages. Do you have any more tips?

-- Ph

My tip would be: Only focus on WSC bots until you get the scores higher. You can get 99+ against Bot A quite easily if your WaveSurfing is polished and bug free; 98 against Bot B and 95-96 against Bot C should follow with just a bit more segmentation, I think. Komarious is a more polished (still MiniBot) version of the BasicSurfer code and gets over 99 against Bot A. You can look at Komarious/Code, but it's a little obfuscated because of being a MiniBot.

Until you have your basic WaveSurfing working well, it will be very hard to tune it correctly against the other bots. I'd really really focus on Bot A and try and figure out why he is ever able to hit you. =) A lot of us have gone through this phase, myself included, and the advice is always the same: focus on the simple targeters first. DrawingBot is a big help for debugging, especially for WaveSurfing, to make sure your predictions and everything else are working right. Good luck!

-- Voidious

Okay. I was going to improve APMC score by some random variations of heading or distance, but getting rid of bugs first makes sense. I managed to bump scores against WSC bots by 1-2% using a distancing tweak, and will probably have a long debugging session with all drawing (onPrint) set up. The problem is that it gets hit ~60 times in a 500-round battle against WSCBotA, which makes such session boring, but heh, I'll see what can be done. --Ph

The new versions of Robocode have a useful feature for this, though it might be tough if your computer is low on memory: the replay feature. If you make your bot print to the console whenever it gets hit, you can run the whole match at full speed and look at the console to see which rounds it was hit in. Then you can run the replay and go max speed until those rounds and watch what happens. The only problem is that 500 rounds will consume a lot of memory to record the replay, but it will save you a lot of time trying to just watch for the rounds where you get hit. -- Voidious

I have yet to manage a surfer that works perfectly vs bot A, but it doesn't always fire perfectly head on((as it doesn't have a clause to make it wait until the gun is all the way turned before firing, if I recall). Though technically, with enough work (and surfing multiple waves), dodging A with a 99 to 100% is possible. -- Chase-san

Technically possible to get 99+? Lots of bots get 99+, including my MiniBot Komarious. With Dookious I consistently get 99.9. You don't need to surf multiple waves (Komarious doesn't) or anything fancy. I honestly think something's wrong with your surfing or general movement if you don't get 99 vs Bot A. (PEZ would say the same, see PowerHouse/OldChat.) Not to sound discouraging, as you clearly have a lot working right if you are in the high 90's, but it's worth the time and effort to get past that barrier into the "nearly perfect" surfing realm! -- Voidious

I must second Voidious with his statement. Even without segmentation it should be possible to reach 99+ against bot A. You must have a valid dive-in protection though, and 'contaminating' your stats with one HOT-hit does help too (I do it). Also distancing is a factor here. -- GrubbmGait

 * *cough* hem, open mouth, insert foot. --Chase-san

I didn't post anything here for a long period of time, and it seems that my updates will take quite long. Anyway, they will come.

Voidious: I didn't know about replay feature before. It's very nice. The only problem is that it doesn't save paintings done in onPaint. That's not very good, because I still don't know why these WSC bots hit me at long distances.

I'm still unable to get 99+ against WSCBotA, but made some progress anyway:

Description WSCBotA WSCBotB WSCBotC? WSC
ArcherMax? (no WaveSurfing) 20,91 16,25 17,28 18,15
ArcherMax? (WaveSurfing), 24 May 97,36 83,82 78,49 86,56
ArcherMax? (WaveSurfing), 06 June 97,13 91,85 86,04 91,67
ArcherMax? (WaveSurfing). 21 June 98,65 89,04 90,89 92,86

The change was preloading HOT-hit. There is still a lot to do - performance in real battles is not satisfactory, so I won't release it publicly at the moment. After polishing basic WS as you suggest, I'll try to get it working against more advanced targeters, and we'll see if it's strong enough for a release.

-- Ph

Hey nice work, 98.65 is quite good; and it' a big jump from 97.13, taking less than 50% as many hits. I forgot about the pre-loading HoT? tip, good call GrubbmGait, that is definitely a very good move (I do it too). Another small tip that may or may not help, but it comes to mind when you say you're being hit at long distances: I've generally found it's easiest to dodge simple targeters around 400-450 distance. PEZ (who originally gave me this tip) and Corbos, at least, have also commented that it's best to stay a little closer against simple targeters. Keep up the steady progress! I think it's easier to tweak a good WaveSurfing system for performance against strong guns than it is to get really good WSC scores. -- Voidious

Next update, another nice thing:

Description WSCBotA WSCBotB WSCBotC? WSC
ArcherMax?, 06 June 97,13 91,85 86,04 91,67
ArcherMax?, 21 June 98,65 89,04 90,89 92,86
ArcherMax?, 28 June 99,14 95,87 93,42 96,14

What changed:

- distance 600 for advanced targeters, 425 for simple ones

- more precise segmentation indexes calculation (values from proper point in time)

- better behavior when close to the enemy; before it tried to escape as quickly as possible when distance < ~100; now it only does it when distance < 42, and does it smarter (chooses location farther from the enemy, taking wall smoothing into equation)

- taking multiple waves into consideration

-- Ph

Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited June 29, 2007 11:21 EST by Ph (diff)