I have a different question now. I have recently tried some experiments in surfing the closest wave only. I wanted to see if this would perhaps make my movement better. Adding code to get the closest wave was straight forward. I modified the danger calculation section so that I only used the selected wave instead of iterating through all the waves. Once that was all set up I went at it with my current favorite test bot
SandboxDT. Then an interesting thing happened. I started to oscilate in place. I was being repeatedly hit at
GuessFactor 10 +/- 1 (I use 23
GuessFactors in the current version of
DarkHallow). I find this strange. I should be avoiding that
GuessFactor like the plauge yet I continue to reverse right to it. So todays question is why? I suspect it has something to do with laying down the direction of the incoming Wave (that which tracks enemy fire) incorrectly. The other option is my projection mechanism is backwards. Anyone have any ideas? --
jim
Perhaps you're getting caught in a [local minima] due to not projecting your position when the next wave impacts far enough forward / backward. Are you using RobocodeGL to graph your surfing? --David Alves
I have used RCGL to check it and I think it is OK. I should give that a try I suppose. It is a PITA to do though. RCGL is not the fastest thing in the world :( -- jim
Found it. Anyone notice anything wrong with this code?
private Wave getClosetWave() {
double nearestDist = 10000;
Wave retVal = null;
Iterator it = waves.iterator();
while (it.hasNext()) {
Wave w = (Wave)it.next();
if (w.shotOrigin.distance(w.targetLoc) - w.dist < nearestDist) {
retVal = w;
}
}
return retVal;
}
It's tough enough to fight WaveSuffering but fighting against yourself too makes it even tougher. -- jim
=) Yeah. A Comparator would fit the bill here I think. -- PEZ