[Home]AntiRam

Robo Home | Changes | Preferences | AllPages

Showing revision 11
Please tell David. -- PEZ

Ask and ye shall receive.

Here's the ram evasion code from YALT 1.3:

field variables:
	static long ramFactor;
	static double ramEvasionDirection = 1.0;



in movement():
	Point destination = null;

	if(ramFactor > getRoundNum() * 2 && me.distanceTo(targetState) < 100){
		//sign(double x) returns -1 if negative, +1 if positive, and 0 if 0
		if(getTime() % 10==0) ramEvasionDirection = sign(Math.random() - .5); 

		//the third parameter to wallSmoothedDestination is a direction
		//0 is straight at the enemy, +/- pi/2 is perpendicular, +/- pi is directly away from the enemy.
		//for ram evasion I use +/- 1.3, we're driving almost directly away from the enemy.
		destination = movement.wallSmoothedDestination(me, targetState, 1.3 * ramEvasionDirection);
	} else {
		//normal movement
	}

in onHitRobot(HitRobotEvent e):
	ramFactor++;

So basically, if the enemy has hit us more than twice per round on average, and the enemy is within 100 of us, drive almost directly away from them. Choose randomly between evading left and evading right every 10 turns. There has been no tweaking at all to these parameters, so there may be better values. Enjoy! --David Alves

it would probably work if you : when you detect that the enemy's angle to you is less than 20 or something, turn the same angle they are facing you at,and drive in the opposite direction. i think gu suggested this a while ago--andrew

Like all beautyfull things, very simple, really KISS. Thnks David! -- Axe

I think WaveSurfing handles Rambots pretty good if they shoot at all. I tested that with a "setXXX version" of RamFire, and the original one, and it dodged both RamFire versions quite well. -- Xero

The RamBots in the rumble do shoot, although some of them only from closer distances. My opinion is that it is not the WaveSurfing as is (dodging bullets) that performs well against rambots, but the 'keeping your distance' approach that most wavesurfers have. If you really want to test against rammers, pick some from the RambotChallenge2K6. -- GrubbmGait


Robo Home | Changes | Preferences | AllPages
Edit revision 11 of this page | View other revisions | View current revision
Edited June 6, 2006 18:06 EST by GrubbmGait (diff)
Search: