[Home]Muffin/Questions

Robo Home | Muffin | Changes | Preferences | AllPages

Showing revision 4
Can anyone explain to me why I'm getting funky results with this function for GuessFactor determination...?

I'm trying to find a decent alternative to the asin(8/11) method.

int bin = (int)(((getAccumulatedLateralVelocityAt(currentTime) - getAccumulatedLateralVelocityAt(fireTime)) / (8 * targetDistance / BULLET_VELOCITY)) * BINS_PER_SIDE + BINS_PER_SIDE);
It seems to like to either fire wide or on the wrong side (behind when it should be in front) depending on how I have it set up, but I can't get it to quite nail targets. Can anyone forward an explanation or should I just assume I have a bug elsewhere? -- Kuuran

I am more of a mimic than a prophet when it comes to these things so take what I say with a grain of salt. I do not see you accounting for target direction in your calculation. This could be the source of not firing in the right direction very often. At the risk of insulting your intelligence, you need to account for target direction in your GF gun so that +1 is always in the same direction relative to your targets movement. If he is moving left to right (clockwise and robocode positive direction) around you, then you need +1 to be to the right (positive direction). As you may well imagine that all flips for left to right movement. You can look at BlackPearl/Code for my calculation of eDirection to see how I do it. Also, using 2 X BINS_PER_SIDE which to me intimates that you are using an even number of bins. This may work but it leaves no definitive bin for GF zero. I would imagine that hitting a target there at a distant range may be difficult. I hope that helps some. -- jim


Robo Home | Muffin | Changes | Preferences | AllPages
Edit revision 4 of this page | View other revisions | View current revision
Edited February 16, 2004 14:57 EST by Sparafucil3 (diff)
Search: