Difference between revisions of "User talk:Realmoonstruck"

From Robowiki
Jump to navigation Jump to search
(Adding welcome message :))
Line 1: Line 1:
 +
 +
{| width="100%" style="background: white; "
 +
| valign="top" width="60%" style="border: 2px solid #000; padding: .5em 1em; -moz-border-radius: 1em; -webkit-border-radius: 1em" |
 +
'''Welcome!'''
 +
 +
Hello, {{BASEPAGENAME}}, and welcome to [[RoboWiki]]! This place contains a wealth information about [[Robocode]], from [[Head-On Targeting|basic]] to [[Wave Surfing|more advanced]]. I hope you enjoy creating robots and being a robocoder!
 +
 +
If you are posting a comment on this wiki, please [[wikipedia:Wikipedia:Signatures|sign]] your messages using four tildes (<nowiki>--~~~~</nowiki>); this will automatically insert your username and the date stamp. If you are not familiar with MediaWiki, these links might help you out:
 +
* [[wikipedia:How to edit|How to edit]] on [[wikipedia:|Wikipedia]], [[metawikipedia:Cheatsheet|Cheatsheet]] and [[metawikipedia:File:MediaWikiRefCard.pdf|Reference Card]] of MediaWiki on the [[metawikipedia:|Meta Wikipedia]].
 +
* [[RoboWiki:ReadMe|Readme]] page.
 +
If you need [[Help:Help|help]], check out the [[Robocode/FAQ|frequently asked questions]] or ask it on this page. Again, welcome!
 +
 +
—— RoboWiki Administrators
 +
|}
 +
 
== Competitive JuniorRobot ==
 
== Competitive JuniorRobot ==
  

Revision as of 00:49, 15 July 2010

Welcome!

Hello, Realmoonstruck, and welcome to RoboWiki! This place contains a wealth information about Robocode, from basic to more advanced. I hope you enjoy creating robots and being a robocoder!

If you are posting a comment on this wiki, please sign your messages using four tildes (--~~~~); this will automatically insert your username and the date stamp. If you are not familiar with MediaWiki, these links might help you out:

If you need help, check out the frequently asked questions or ask it on this page. Again, welcome!

—— RoboWiki Administrators

Competitive JuniorRobot

I have been trying to make competitive Junior Robots. This the best 1 vs 1 bot I could make till now...

package ne0n;

import robocode.*;

public class JuniorLinear extends JuniorRobot {
	int moveAmount;

	public void run() {
		setColors(black, white, red, orange, purple);
		moveAmount = Math.max(fieldWidth, fieldHeight);
		turnTo(0);

		while (true) {
			bearGunTo(90);
			ahead(moveAmount);
		}

	}

	public void onHitWall() {
		bearGunTo(90);
		turnRight(90);
	}

	public void onHitByBullet() {
		turnGunTo(hitByBulletAngle);
	}

	public void onHitRobot() {
		if (scannedBearing > -90 && scannedBearing < 90)
			back(100);
		else
			ahead(100);

	}

	public void onScannedRobot() {

		double firepower = 3d-2d*((double)scannedDistance/(double)moveAmount);
		double bulletVelocity = 20-3*firepower;
		double offset = Math.toDegrees(Math.asin(scannedVelocity*Math.sin(Math.toRadians(scannedHeading-scannedAngle))/bulletVelocity));
		turnGunTo((int)(scannedAngle + offset));
		fire(firepower);

	}

}

Tis moves in the same was as the Sample Walls. As the name suggests this uses simple trigonometric linear targeting. This has been able to beat all the Sample bots on 1 vs 1. But in melee Walls and SpinBot are beating me each time. I tried to implement some better movement and targeting strategies but couldn't get anything to work till now.

Any help will be appreciated... —Preceding unsigned comment added by Realmoonstruck (talkcontribs)

I am not entirely sure on how JuniorRobots work, but if I might suggest you stick to just radians or just degrees. Looking at your code it looks to be something like a simple linear targeting implementation. Radar handling may help somewhat. — Chase-san 14:21, 14 July 2010 (UTC)
Junior doesn't support radians, but Java Trig use radians. So when use Junior Robot we must convert back and forth. --Nat Pavasant 14:26, 14 July 2010 (UTC)

In sample bots melee it is better to fire head-on since many of sample robots are moving back-and-forth with make it impossible to hit with linear or circular. So in melee Walls and SpinBot will beat you. Maybe you may want to see oldwiki:Girl Robot. It should be quite easy to port over to Junior Robot, with melee features stripped... :( --Nat Pavasant 14:26, 14 July 2010 (UTC)

Thanks, i'll take a look at the girl. As for head-on targeting, I have tried it with no significant change in melee performance but slightly worse than this bot in 1vs1. If radar lock wont work, advanced targeting wont work then all that is left is movement, and this is the best movement strategy that i could work out on Junior. Nobody interested to work on a Junior?