[Home]FloodMiniStationary

Robo Home | Changes | Preferences | AllPages

A stationary version of FloodMini 1.2, packaged with MCEntries.zip on the Repository (just look up everything by Kawigi). It was designed as a helper for people trying to improve their movement in the CurveFlattenerChallenge, he sort of works as a 'second opinion' for how good your movement is against GuessFactorTargeting. The best feature of this robot is that he ships with a grapher program that can be used to view your statistical curve at any range of distances, and any other point of segmentation by FloodMini (check your wall profile and your profile while stopped or moving quickly and such). -- Kawigi

I downloaded MCEntries.zip from the repository, as i wanted to spar with FloodMiniStationary and see what you made of roosevelt especially the near walls profile (my wall avoidance sucks and i just wanted to know how badly) However the zip file doesn't include the MiniBullet? class, and therefore wont compile (the zip only contained .java files, no .jar's). Any chance you could tell me how to use FloodMiniStationary and teh grapher, so i can hopefully improve my CFC index to somewhere above 8%... --Brainfade

Hmmm... I wonder how I forgot that :-p And the sad thing is that you can't use the MiniBullet? class from FloodMini 1.3 :-p You'd need one from FloodMini 1.2, which looks like this:

package kawigi.sbf;
import java.awt.geom.*;
/**
 * MiniBullet - like OffensiveVirtualBullet, but smaller code.  Power 3 bullets assumed for tracking purposes.
 */
public class MiniBullet
{
	private double startx, starty, startgunheading;
	private long firetime, lasttime;
	private double lastx, lasty;
	private int direction;
	int latspeed, dindex, wallrel;
	
	public MiniBullet(double startx, double starty, int direction, int latv, int dindex, int wallrel, double ex, double ey, double absbearing, long firetime)
	{
		//for the sake of accuracy, get the distance at firing time
		this.dindex = dindex;
		latspeed = latv;
		this.wallrel = wallrel;
		this.direction = direction;
		this.startx = startx;
		this.starty = starty;
		lastx = ex;
		lasty = ey;
		startgunheading = absbearing;
		this.firetime = lasttime = firetime;
		//direction is 1 if the enemy was last seen going around me clockwise, -1 if they were moving counterclockwise
	}
	
	public double updateEnemy(double x, double y, long time)
	{
		//I just linearly interpolate where they've been if I don't get an update each tick.  Should be a
		//reasonable interpolation, at least relative to firing angle, as long as I don't often go several turns
		//without a scan.
		long dtime;
		double dx = (x-lastx)/(dtime = time-lasttime);
		double dy = (y-lasty)/dtime;
		while (lasttime < time)
		{
			if (Point2D.distance(lastx, lasty, startx, starty) <= 11*(lasttime-firetime))  	//could have hit now.
				return  direction*Math.min(1, Math.max(robocode.util.Utils.normalRelativeAngle(Math.atan2(lastx-startx, lasty-starty)-startgunheading)/1.141, -1));
			lasttime++;
			lastx+=dx;
			lasty+=dy;
		}
		return Double.NaN;
	}
}

And the amazing thing is that I've even shrunk this since then. Hope that works for you. I'm surprised no one has pointed that out to me yet. I'll try to zip up one with the MiniBullet? class tomorrow. -- Kawigi

Cheers kawigi, i just ran a test against FloodMiniStationary and i'm doing equally badly against flood as i was against sandbox. I always knew my movement wasn't the greatest but i didnt think it was that bad. I've been trying to run StationaryFloodGrapher?, however if i simply try and execute it i get a noclassdeffound error. Is there some kind of trick to it, or have i just got a corrupted file?? --Brainfade

Hmmm... I'm not sure, I just go in a console window to the robots directory and then type "java kawigi.sbf.StationaryFloodGrapher?". -- Kawigi


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited July 14, 2003 3:21 EST by Kawigi (diff)
Search: