Robo Home | DarkHallow | Changes | Preferences | AllPages

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

I had though about a comparator. I just have never been a big fan. Ah well. It does not seem to make me much better but I need to pass it to the [ultimate abitor] to verify. -- jim

Robo Home | DarkHallow | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited November 14, 2004 19:49 EST by Jim (diff)