[Home]Gaff

Robo Home | Changes | Preferences | AllPages

Showing revision 21

Gaff

A simpler bot by Darkcanuck

Extends

AdvancedRobot

What's special about it?

I got tired of wrestling with learning bots and made Gaff using a simple movement that popped into my head. This bot was originally a testbed for a new targeting method I'm working on.

How competitive is it?

Probably not very, but my goal is for Gaff to become a ProblemBot for as many contenders as possible.

Version 1.04 has yet to break into the top-200. Version 1.10 reached position #163 in the rumble.

How does it move?

Gaff's basic movement is to try and to push enemies into the corners to narrow their escape angle and expose near-wall profile flaws. But version 1.10 now has multi-mode movement, so if the basic strategy loses, he moves on to the next one which is a simple orbital-style movement. The third one is hard to explain, since it came about accidentally when I hacked together the orbital movement -- it seems to fool some bots for a bit though.

Version 1.20 drops the third movement style and has fixes many bugs in the other two styles.

There's also some randomness mixed in, plus the bullet prediction/dodging code from Leon.

They're not intended to be a very sophisticated movements but can confuse some bots.

How does it fire?

Uses an array of VirtualGuns including one HOT, one circular and three neural networks (multi-layer perceptron classifiers) which continuously evaluate firing angles. Guns are selected randomly, weighted by their virtual hit rates. This is still very much a work in progress.

Cut back to a single neural-network with one hidden layer no hidden layers. The code still assumes an array and is nicely pluggable so that I can test different combinations if I feel the need to go back to multiple guns.

How does the melee strategy differ from one-on-one strategy?

No difference, but the movement algorithm doesn't take more than one opponent into account so melee performance could be pretty bad.

How does it select a target to attack/avoid in melee?

Selects the closest target, with some protection against target thrashing.

What does it save between rounds and matches?

Between rounds, saves all neural network weights, targeting stats and bullet dodging data. Nothing saved between matches.

Where did you get the name?

Blade Runner again.

Can I use your code?

Not yet. But feel free to ask if you're curious and maybe I'll post some snippets

What's next for your robot?

  1. Improve the NN targeting DONE
  2. Add a melee strategy, since I prefer that field over 1on1

Does it have any WhiteWhales?

We'll see -- probably anything with great targeting and movement.

What other robot(s) is it based on?

Most of the framework is shared with Leon. Targeting inspired by Engineer, inputs to the targeting networks based on Raiko's segmentation.

Version History


Comments, questions, feedback:

Woah there! You sure got a crazy-good score against Shadow in TC2K7! I'd be really curious about what kind of inputs nodes are getting heavy strong weights in Gaff's targeting NN there. Congrats! -- Rednaxela

Thanks -- now I just have to improve the score against the other 9 bots! I haven't dumped the weights, so I'm not sure which inputs are key to hitting Shadow. The biggest improvement (based on the 50+ tests/tweaks since version 1.00) seems to be from limiting the GuessFactor range: unlike most other implementations I've read about on the wiki, Gaff always considers GF+1 = asin(8/bvel) but limits the output to where the enemy could actually move. So if the enemy can only reach -0.4 to +0.7 then it'll take the peak value in that range, even though the biggest peak might lie outside it.

The network is using distance, speed (absolute), lateral accel, advancing accel, ticks since velocity change, ticks since CCW/CW change and straight-line distance to the wall as inputs. All of them are split up into smaller feature ranges so there are 4-10 inputs for each of those variables. I'm playing around with splitting them up into even finer features right now. -- Darkcanuck

Hmm, that sounds like an interesting. So, based on the how you're looking for peaks and such, I presume you have multiple neural net output nodes arranged in a fashion similar to the bins in 'traditional' VisitCountStats? Overall, from what you describe of it, I'd say this net is set up and used in a way far more like 'traditional' segmented VCS than other NeuralTargeting that I've taken note of, due to how it sorts the inputs/outputs in to bins/buckets. Actually, I think this has inspired me to look into neural net approaches more, perhaps integrating it into DynamicClustering, by using it in the calculation of differences between situations to create a form of DynamicWeighting?. My previous neural experiments haven't went too great (neural pattern matching and neural situation-readjustment) but this weighting via neural nets might be more promising. In any case, I'm quite impressed and wish you and Gaff well. It would be nice to see some more Canadians bots ascend the ranks :) -- Rednaxela

Yep, there are 31 output nodes, each corresponding to a slice of the GF spectrum. I originally started with a single output node which gave the GF to aim at, but performance was pretty lousy. Neural nets are very strong in classification problems, so Gaff's targeting takes that approach instead. I've also tried using a net to do predictive pattern matching (see Leon) with decent results, but nowhere near good enough to hit surfers. There's probably a lot of room for improvement in the latter if I rearranged it as a classifier too.

If you're curious, add "debuglevel=2" (or was it 3?) to Gaff's properties file, turn on painting and you'll see the net's outputs graphed in real time at the bottom left of the screen. -- Darkcanuck

Ahh yes, "debuglevel=2" indeed, and quite pretty graphics. One thing I noticed with it facing RougeDC Gamma6, is that it's bullet prediction seems able to predict where RougeDC is firing to a degree I find somewhat bothersome, of course the gun in Gamma6 isn't meant for performing against adaptive movement anyways. Despite it's good prediction though it does seems hit it's own predictions of the bullet fairly often and may be something you might want to consider looking at making it more cautious of. You may already be aware of it, but it also looks like you sometimes miss detecting the enemy firing at all. That's a very interesting cornering movement you have there by the way, it seems quite good at forcing fairly close combat as well without needing to chase. -- Rednaxela

Nice work with Gaff, keep it up! Hitting Shadow well is like a lifetime goal of mine - up there with becoming an astronaut and climbing Mount Everest. =) So it's good to see someone making progress. Just as an FYI, Engineer also outputs an array of GuessFactor bins like this (and even uses the same type of setup for surfing!). Good luck with the other 9 reference bots ;), cheers, -- Voidious

By the way, out of curiosity, I ran a anti-surfer challenge I made for my own testing on Gaff. It appears it's power against Shadow doesn't hold true against Dookious, but in general isn't too bad against surfers. One interesting thing, is that it doesn't manage to hit the surfers I've found to be weaker like Komarious or MatchupWS much better than the stronger surfers.

Custom Surfer Challenge. TargetingChallenge2K7 surfers, plus: Dookious 1.573c, Chalk 2.5.Al, Komarious 1.78b, GresSuffurd 0.2.10, DarkHallow .90.9, and MatchupWS 1.2c
Bot Author CC RMX SHA WS WOE TC2K7 Dooki Chalk Kom Sub1 Gres DH MWS Sub2 Total Comment
Gaff 1.04 Darkcanuck 63.52 80.64 69.22 82.22 78.13 74.74 54.37 70.19 74.43 66.33 88.37 81.53 82.08 83.99 75.02 16.0 seasons
-- Rednaxela

That's an ugly score against Dookius -- and I thought CC was hard to hit!

Good catch regarding the bullet dodging: one of the fixes I made in 1.04 broke the dodging code for reverse travel. Fixed now, just running through some more targeting iterations. Still stuck around 76 on the TC2K7, each new test brings up the score against 1 bot at the expense of the 9 others. Interestingly, smoothing the net outputs brought down the Shadow score quite a bit. Oh, and I did dump the network weights but it didn't reveal anything. That's the irony of NN, they can solve difficult problems but you can't reverse-engineer the solution. -- Darkcanuck

Well, I doubt anyone could score that great against Dookious. Actually, I find it slightly ironic that Voidious has a lifelong goal of hitting Shadow when Dookious appears to be much harder to hit. Perhaps I'll make it my lifelong goal to hit Dookious well... ;)

I think for NNs with few inputs one can create a visual map of what inputs result in what outputs, but that gets tricky when you have more than 2 or 3 input dimensions to deal with. If all one is looking at is "importance" of a dimension though, it might be possible to get a useful statistic by getting the maximum theoretical amount an output node could be affected by a single lone input node were all other input nodes 0, and average what that value was for all of the different output nodes, to get a rough comparative measure of how much the network "cares" about that input. Of course, I'm not an expert on NNs but to me that would make sense as a way to get at least marginally useful information out of a dump of the weights. -- Rednaxela

Are you offering to do the analysis for me? ;) With 45 inputs, 20 hidden nodes and 31 outputs, there are a lot of weights to pore over. Out of my last 20 tests (RoboResearch is an amazing tool) the targeting released in 1.04 is still the best. Too many variables to tweak: inputs, network size/structure, learning rates, training methods... just not enough processor time to try them all. Right now I'm trying to figure out how to build an AntiSurfer method but I'm not sure how to do fast rolling in a NN. Next test is experimenting with weight decay. Somewhere in there lies a way to hit Dookius better... -- Darkcanuck

Excellent! Rednaxela, you provided the key to the TC2k7 score breakthrough I was looking for. Mostly out of laziness (and probably due to the way Leon's NN works) I was only training the net once for each firing wave hit -- I already had the learning rate cranked up to compensate. By retraining the last 5 firing waves each time a new firing wave hit and dialing down the learning rate, Gaff scores almost 2pts higher overall. 9 out of the 10 bot scores are up, including a modest gain against Shadow (71.61). I'm playing with the retraining count and learning rate now to get an idea if there's more value still hidden in this approach. Look for a new release soon with a couple of new movement modes to increase survival against the big guys. -- Darkcanuck

Nice stuff there! Looks like Gaff will be on it's way up. Cheers! :) -- Rednaxela


Robo Home | Changes | Preferences | AllPages
Edit revision 21 of this page | View other revisions | View current revision
Edited July 31, 2008 23:12 EST by Darkcanuck (diff)
Search: