[Home]AntiRam

Robo Home | Changes | Preferences | AllPages

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

I have seen a ram bot that uses linear targeting to direct its movement. Using this, it basically locks on and it is impossible to avoid by moving to the side, and will eventually get you if you move back. Does anybody have a good strategy to beat this? -- King of Fire

When it fires change the direction you're turning, eg. clockwise to anticlockwise. You can evade pretty well by doing this. -- Skilgannon


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited April 17, 2008 4:37 EST by Skilgannon (diff)
Search: