From Robowiki
Jump to navigation Jump to search

My first gun now performs fairly well against BasicSurfer, so I've decided to upload the bot Thor, which implements the gun (but does not move).

I think the "pick your shots carefully, and lead accurately" merits can be awarded, but the "hit every time, actually move and try to fire at stationary targets" merits definitely cannot.

I'm a little intrigued about why Thor never, and I really mean never fires against stationary targets, I mean I grok my code (obviously, I wrote it) so I understand why he does it from the code's point of view (his decision about whether to fire is a function of how accurately we can predict the enemy's movements based on its current heading and velocity, so for the special case where the enemy's velocity is zero, we inevitably decide not to fire), I'm just intrigued about why this turns out to be the best decision to make (and indeed whether it really is the best decision to make).

I think the reasoning goes thusly: - if the target isn't moving, we have less data about its movements, and therefore how much to lead by, which, because those precise measurements (velocity, especially) are fed into our "how much to lead by" algorithm, means that under normal circumstances, we get increasingly more accurate the faster the enemy is moving (at zero, therefore, it takes a long time to become accurate) - we can take a pot shot, but only after we're sure it's not going to suddenly move, hence the "deadlock" situation you get to against BasicSurfer where BasicSurfer doesn't move because it doesn't have enough information (I haven't shot yet) and I don't shoot because I don't have enough information (Basic hasn't moved yet). when we do take a pot shot, it really is that - we're not suddenly getting more information, we're just realising that we're in deadlock until somebody does something and being brave and being the person who does something (on the grounds that the random chance of hitting is greater than the zero chance of hitting otherwise). It works out like this because we use a threshold to dictate whether or not to fire, and that threshold will approach zero the longer the robot is stationary for (because our guesses about its future position will still gradually get more accurate, but it just takes a long time to achieve the same degree of accuracy because we're anticipating movement)

Two pretty notable things about the algorithm: - first, we offset our guesses by a factor of the distance to the target (which, in turn, purposely makes our guesses worse when the target is further away, on the grounds that we only want to fire at far-away targets when their movement is VERY predictable over a LONG period of time) - second, we must use a constant firepower. If we attempt to ramp the firepower in any way, including linearly, even by the tiniest of amounts, we throw all our calculations off, because the delta from the last turn is not compatible with the current delta (because the bullet's velocity has changed). this is unfortunate, but I cannot currently see any way around it

Note: I know this algorithm is naïve, and I think it's the Guess Factor wheel re-invented, but I don't grok Guess Factor Targeting which is probably why I re-invented it like this (because it's something I can grok). It's not contributed to be a serious competition gun, just my way of keeping a historical account of where my roots were, whilst simultaneously providing some point-and-laugh style entertainment for all the people doing it more cleverly. Having said that, it does perform pretty well against wave-surfers, even if its performance against less clever movement is pretty poor (it's horrendous against Sample.Walls, for example, and pretty terrible against Sample.SpinBot too, I'm still trying to work out why, any help would be appreciated).

Annoyingly, the previous download link was broken. It's not annoying for anyone else (I doubt anybody even noticed it), but I just moved to Sweden (hence my lack of activity for a while) and have now lost Thor to the abyss. I may be able to find him floating around somewhere, but probably not an up-to-date version and possibly not even a version with source. Very frustrating.