Talk:GuessFactor Targeting Tutorial

From RoboWiki
Jump to: navigation, search
Credits - GuessFactor Targeting Tutorial
Old wiki page: GuessFactorTargeting/Tutorial
Original author(s): RoboWiki contributors

Beginner questions

Hi, I'm totally noob at Wave-based methods. I think I understand the idea, but to test the targeting I copied the code and added some simple movement to it. But the results are poor! The unsegmented version was something like a rolling average gun, but the segmented was just miserable. I know that this is just a sample code, but in this state it's just unusable. Here is the testbot: [1] --HUNRobar 17:18, 15 May 2009 (UTC)

Well I've never used that exact code so I can't really tell, but one thing I don't like about it's segmentation is that I feel the distance is too segmented for a 35 rounds battle. I believe the idea is only to show how segmentation can be done, not to use those exact values, I'd recommend dividing by 200 instead of 100 and see if it improves. But on the general note I'd recommend getting the grasp on the idea and then writing your own code, you probably will like to use some graphical debugging so you can check if your waves are getting aligned with your bullets and read carefully on how the game physics are. When and where the bullet does come out the bot after the setFireBullet is called, all that stuff makes a big difference. I'm not really sure if the bot in the tutorial is intended to work as is, but the explanation in the article combined with code gives a very good insight on how it works. That's only my opinion, I did learn a lot from the tutorial(although the segmented version wasn't there yet), just never used the code directly. And if you have specific questions I'll be happy to help you as much as I can. --zyx 21:58, 15 May 2009 (UTC)
Hey dude. Watching the bot fight, there's obviously some bug, and I found it: you're still using stats.length as the number of bins when aiming, but that's returning 13 instead of 31 after you add the distance segment. The tutorial should probably mention this in the part about adding segmentation. If you hardcode the "stats.length-1" parts as "30" instead (or use static final vars, however you wish), it starts working normally. (As it is now, a "best index" of 30 would be giving a GuessFactor of 18/12 = 1.5!)
Zyx makes a good point that 13 distance segments is probably way too much, too, and this is compounded by the fact that this version is only firing waves when it fires a real bullet (instead of every tick). GFTargetingBot might be a good next step for you to take a look at. Good luck! --Voidious 03:08, 16 May 2009 (UTC)
Hi! Thanks for your replies. I fixed that bug and did 200px segmentation. At last now it looks like GF. Ok, in this state it's not as powerful as a Symbolic Pattern Matcher gun, but it learns and hits robots obviously.
I would be interested in rolling average in gf. I read that it's crucial for gf but none of the tutorials implement it. What is averaged exactly?
And here's the link: [2] (I think I'll upload it to the repository and submit it into the rumble under wiki.* if I've put everything into it) --HUNRobar 19:35, 16 May 2009 (UTC)
Rolling average is necessary for hitting adaptive movements, but shouldn't do much of anything against a movement that doesn't learn. Rolling average is basically an approximation of the last X values. Instead of just bin++, you would set the bin's value, for a rolling depth of X, to: ((old bin value * (X - 1) + 1) / X). The value of any bin is always between 0 and 1. More and better info on the Rolling Averages page. --Voidious 20:25, 16 May 2009 (UTC)
There are no threads on this page yet.
Personal tools