[Home]NanoDeath

Robo Home | Changes | Preferences | AllPages

Source for NanoDeath 2.51000

Big update, I get bored easily. It tries not to overshoot the target, so it cuts off less. It only fires when it's close. Big jump in rating.

The gun is kind of bad, it doesn't quite lead the target, and it tries to cut off the target, but doesn't overpersue too much (hopefully). It does well against good bots (because most bots aren't prepared for it) and it does mediocre against bad bots (because it's kind of hard to miss an incoming target).

package amz;
import robocode.*;

public class NanoDeath extends AdvancedRobot
{	
	public void run() 
	{
		setAdjustGunForRobotTurn(true);
		setAdjustRadarForGunTurn(true);
		while(true)
			turnRadarRightRadians(Double.POSITIVE_INFINITY);
	}
	public void onScannedRobot(ScannedRobotEvent e)
	{
		double absBearing;

		setTurnRadarRightRadians(5 * Math.sin((absBearing = e.getBearingRadians() + getHeadingRadians()) - getRadarHeadingRadians()));

		setTurnGunRightRadians(Math.sin(absBearing - getGunHeadingRadians()
			+ Math.asin(Math.sin(e.getHeadingRadians() - absBearing) * e.getVelocity() / 11)));
		
		setTurnRightRadians(Math.tan(absBearing =  absBearing - getHeadingRadians() + Math.asin(Math.sin(e.getHeadingRadians() - absBearing) * e.getVelocity() / 14)));
		
		setAhead(Double.POSITIVE_INFINITY * Math.cos(absBearing));
		
		if((absBearing = e.getEnergy()) > 0 && e.getDistance() < 350)
			setFire((absBearing-1) / 4);
	}
}

So anyone have any comments, suggestions, questions, etc?

Rammers are cool. --David Alves

I can't stop to see how amazing can be the performance of rammers against the top bots... A headache. -- Axe

ha! --andrew

Yep. Rammers are cool. --Axe

Rammers are killing me, my PBI for NanoDeath with FloatingTadpole is -22.1 !!! --Florent

That is the point of rammers, it is hard to do well against them. Lucky for you there are only a few rammers around, see RamBots --GrubbmGait

I have already seen it, when I will some more time for robocode I will try to come up with an anti-ramming movement that would trigger only with rammers. --Florent

Somehow, I have a different opinion of rammers--especially when my robot is "disabled" (usually with <= .2 energy left). Shera doesn't do well nor does Cigaret, although Cigaret learns not to ram. -- Kinsen

I have removed almost all specific anti-ram code in GrubbmGrb a few months ago, it just got me confused and did not deliver extra points. It's normal movement is quite satisfactory against pure rammers. I think that if you can handle close fighters, you should be able to handle rammers too without extra effort. --GrubbmGait


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited September 16, 2005 22:56 EST by PEZ (diff)
Search: