View source for User talk:Tmservo

From Robowiki
Jump to navigation Jump to search
package Josewong;
import robocode.*;
//import java.awt.Color;

// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html

/**
 * Invertigo - a robot by (your name here)
 */
public class Invertigo extends Robot
{
	/**
	 * run: Invertigo's default behavior
	 */
	public void run() {
		// Initialization of the robot should be put here

		// After trying out your robot, try uncommenting the import at the top,
		// and the next line:

		// setColors(Color.red,Color.blue,Color.green); // body,gun,radar

		// Robot main loop
		while(true) {
			// Replace the next 4 lines with any behavior you would like
			back(100);
			turnGunLeft(360);
			ahead(100);
			turnGunLeft(360);
		}
	}

	/**
	 * onScannedRobot: What to do when you see another robot
	 */
	public void onScannedRobot(ScannedRobotEvent e) {
		// Replace the next line with any behavior you would like
		fire(0.95);
	}

	/**
	 * onHitByBullet: What to do when you're hit by a bullet
	 */
	public void onHitByBullet(HitByBulletEvent e) {
		// Replace the next line with any behavior you would like
		ahead(10);
	}
	
	/**
	 * onHitWall: What to do when you hit a wall
	 */
	public void onHitWall(HitWallEvent e) {
		// Replace the next line with any behavior you would like
		ahead(20);
	}	
}
package Josewong;
import robocode.*;

// API help : http://robocode.sourceforge.net/docs/robocode/robocode/JuniorRobot.html

/**
 * InvertigoJunior - a robot by (your name here)
 */
public class InvertigoJunior extends JuniorRobot
{
	/**
	 * run: InvertigoJunior's default behavior
	 */
	public void run() {
		// Initialization of the robot should be put here

		// Some color codes: blue, yellow, black, white, red, pink, brown, grey, orange...
		// Sets these colors (robot parts): body, gun, radar, bullet, scan_arc
		setColors(orange, blue, white, yellow, black);

		// Robot main loop
		while(true) {
			// Replace the next 4 lines with any behavior you would like
			back(100);
			turnGunLeft(360);
			ahead(100);
			turnGunLeft(360);
		}
	}

	/**
	 * onScannedRobot: What to do when you see another robot
	 */
	public void onScannedRobot() {
		// Replace the next line with any behavior you would like
		fire(0.95);
	}

	/**
	 * onHitByBullet: What to do when you're hit by a bullet
	 */
	public void onHitByBullet() {
		// Replace the next line with any behavior you would like
		ahead(10);
	}
	
	/**
	 * onHitWall: What to do when you hit a wall
	 */
	public void onHitWall() {
		// Replace the next line with any behavior you would like
		ahead(20);
	}	
}

I am actually Josewong from wikia My name is Augustus Joseph Wong and my location is 7129 Beverly Street, 66204,

Contents

Thread titleRepliesLast modified
what's the secret to making a good robot in robocode3905:32, 10 February 2023
DiamondWhoosh vs DookiCape013:22, 29 August 2017
DiamondFist vs DookiLighting013:22, 29 August 2017
Random Movement experiment101:10, 10 July 2015
Rednaxela kd-tree 24 v 50 300:59, 8 July 2015
Exploit that needs fixing000:33, 26 June 2015
Roborumble Participants023:12, 4 April 2015
First page
First page
Previous page
Previous page
Last page
Last page

what's the secret to making a good robot in robocode

what is it please tell me

Tmservo (talk)00:46, 16 December 2013

The secret is to copy other peoples code, since clearly there is no other way to make anything that competes.

Straw (talk)02:38, 16 December 2013
 

- Understanding of the rules of the game, which means Robocode physics and scoring system.

- Understanding of the Java technology, including deep knowledge of Robocode API.

- Understanding of competition mechanics, like game theory.

Looking what other robocoders are doing helps a lot. Most strategies are a combination of the 3 elements above, but starting from where others are now is more efficient than trying to reinvent the wheel and figuring out everything by yourself.

How do you now where others are now? Browse this wiki, there is A LOT of information here. Reverse engineering code from the top bots also helps, but only after you are familiar with most of the concepts.

MN (talk)03:14, 16 December 2013

MN's response is far more helpful than mine, you should take that advice. I learned about robocode relatively recently and I found that reading basically the entire wiki helped a lot.

Straw (talk)03:51, 16 December 2013
 

To quote Skilgannon (slightly out of context):

"I'm good at producing a top scoring bot, I'm not arguing that, but I'm better at optimising code so it runs quickly/small and then just using a feature 10x more than anybody else ever has before. Examples are the 100+ buffers in DrussGT, surf-absolutely-everybody in Neuromancer, multiple-choice pattern matching in Toorkild. We'd already had multiple buffers, melee surfing, micro pattern matching, non-micro multiple-choice pattern matching, so nothing I did was really new, I just squeezed every last drop of performance out that it had to give. I guess my real claim to fame is variable-distance Stop-And-Go, the rest is my interpretation of the wealth of knowledge already available on the wiki =) I guess the moral of the story is to think big!"

Sheldor (talk)04:13, 16 December 2013

There is a lot more to DrussGT than simply a bunch of buffers.

I think multiple buffers are the weakest part of DrussGT. Replacing the bins with k-NN search in movement would make it even stronger.

State of the art go-to surfing, anti-pattern matching, flattener, surf 2 waves, wall smoothing, super strong dynamic clustering gun, data decay, anti-surfer gun, genetic tuning, precise MEA, gun heat waves, super survivalist energy management, bullet shadows...

MN (talk)05:06, 16 December 2013

Agreed, there's a lot more to Skilgannon's success than a willingess to "go big" and squeeze harder. It's tough to go bigger or squeeze harder without your system breaking down. But we humans are narrative-oriented and Skilgannon's a humble guy, so he comes up with a humble narrative. ;)

Voidious (talk)18:12, 16 December 2013
 

That quote seems like an example of Survivorship Bias to me: http://en.wikipedia.org/wiki/Survivorship_bias

Just because Skilgannon is the champ doesn't mean his memory of the approach he took is the best approach (or even above average).

Voidious (talk)18:16, 16 December 2013

Kicking myself for missing the chance to link to a much cooler post about Survivorship Bias. :-)

Voidious (talk)19:31, 16 December 2013
 
 

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

Return to Thread:User talk:Tmservo/what's the secret to making a good robot in robocode/reply (9).

First thanks to all for the praise I've recieved on the thread =) I don't think I'm superhuman, but I know that I do approach problems from a different perspective than most people.

I don't think I've discussed much is about the process I go through when I make gains. These are typically from three things:

  1. Adding a new behaviour that has already been shown to improve performance, or creating a new behaviour that might improve performance and then testing it to death over lots of battles to see if it actually helped.
  2. Fixing bugs. Enough said.
  3. Speeding up code to make the skipped turn behaviour more predictable, and add spare CPU/memory capacity for future features

So absolutely, I agree with what JDev has said here: make it work, make it right, make it fast.

One other thing that I have to recommend is to not make ANY assumptions about enemy or bot behaviour. If you do make an assumption, do a bunch of tessts and check that the data supports your assumption. And once your feature is implemented, see if there is any way you can get rid of the assumption and thus take advantage of the cases where it isn't true.

Skilgannon (talk)16:35, 17 December 2013

About making assumptions of opponents, it can be done, but not in the way many people do it. That's where game theory kicks in.

The best assumption you can make is that opponents are also trying to outperform you. You are not the only one trying to climb the ranking. That said, any assumption you make might be used against you. The higher the ranking of a competitor, the stronger this statement becomes.

Most attempts at exploiting opponents weaknesses also open yourself to weaknesses. Skillgannon's approach of not making assumptions is all about not exposing yourself to weaknesses.

A good example is most bots trying to crush anyone behaving like SittingDuck. The best targeting against SittingDuck is Head-On Targeting. But Head-On Targeting is shamefully predictable. Many bots still do it. Look what happened when EnergyDome exploited that.

MN (talk)18:05, 18 December 2013

High ranking bots make all sorts of assumptions really. Guessfactors that are so commonly used as a way to predict the opponant's movement, contain some (loose) assumptions about how the opponant's movement at least vaguely related to where you fired from. Most targeting systems also make the assumption that the opponant acts symmetrically when going backwards versus forwards. Those two assumptions can be quite easily broken, but they're not easily exploitable because breaking them would not make you more unpredictable to those using the incorrect assumptions, it would merely make you more predictable to those who *don't* make the assumptions.

One just has to distinguish between assumptions which are sufficiently safe, and are not sufficiently safe.

Rednaxela (talk)20:13, 18 December 2013

I actually don't feel like GFs make any major assumptions besides clockwise vs counter-clockwise being treated the same. And it would take some actual effort to make that assumption false. The firing angle you use is relative to where you are firing from, regardless of how the enemy moves. And that's the output you need from a targeting algorithm, not the exact location of an enemy.

Voidious (talk)22:12, 18 December 2013
 
 
 
 
 

DiamondWhoosh vs DookiCape

which is better DiamondWhoosh or DookiCape

Tmservo (talk)14:35, 3 December 2013

DiamondFist vs DookiLighting

which is better DiamondFist or DookLighting

Tmservo (talk)14:40, 3 December 2013

Random Movement experiment

Was that Random Movement version a experiment to see how good the the wave surfing is

Tmservo (talk)23:17, 9 July 2015

No, it was mostly to test which bots a flattener would be of help against.

Chase01:10, 10 July 2015
 

Rednaxela kd-tree 24 v 50

Which is faster for Rednaxela's kd-tree Bucket size 24 or Bucket size 50

Tmservo (talk)17:40, 7 July 2015

24 is probably faster. Though it's largely irrelevant since it's probably going to be faster than anything else in either configuration anyway.

Chase19:01, 7 July 2015

Let me show you something Rednaxela's and Skilgannon's kd-trees are tied in speed. And Skilgannon's kd-tree uses a bucket size of 50. You said lower bucket size is better. Therefore if Skilgannon's kd-tree used a bucket size of 24. It might be faster than Rednaxela's kd-tree.

Tmservo (talk)20:07, 7 July 2015

To be honest, I don't really care.

Chase00:59, 8 July 2015
 
 
 

Exploit that needs fixing

There's an Exploit on PiRocks page that needs fixing

Tmservo (talk)00:33, 26 June 2015

Roborumble Participants

The number of RoboRumble Participants dropped from over 1100 to 196. Can anybody fix this please?

Tmservo (talk)23:10, 4 April 2015
First page
First page
Previous page
Previous page
Last page
Last page