Difference between revisions of "Archived talk:User:CrazyBassoonist 2009/08/18"

From Robowiki
Jump to navigation Jump to search
 
(89 intermediate revisions by 8 users not shown)
Line 1: Line 1:
== Greetings ==
+
{{talkarchive|User talk:CrazyBassoonist}}
  
 +
==Fuatisha==
  
 +
Wow, where did this bot come from?
 +
Congrats on 5th place in nano (and thanks for bumping Kitten to above NanoLauLecktrik again xD)!
 +
Wanna tell us about your bot, and what you did? Does it use the nano wavesurfing as in savantWS? Or does it use a misleading endgame to fool the PM guns? Both I think are slightly unlikely based on the scores, but I'm curious now!
 +
And unless I'm mistaken, you didn't include the source with the .jar, you might want to consider keeping it open source, like most nanos ;). [[User:Spinnercat|Spinnercat]] 01:09, 5 August 2009 (UTC)
  
Hi, CrazyBassoonist, Welcome to the wiki! If you are fast leaner, you can learn robocode really fast! I've start robocode programming for 4 months but I've learn many of then already. Best luck for your robot, but I haven't seen your MagicD2 yet :) --[[User:Nat|Nat]] 10:52, 23 January 2009 (UTC)
+
Well, first of all it is open source. You can download the source at http://robocoderepository.com/BotDetail.jsp?id=3720. Sorry for not including it, but honestly the problem is that I keep thinking I am including the source while my robots never seem to have the source with them. About Fuatisha, I decided that I would try to make a competitive robot for once instead of stuff like SavantWS that are kind of cool but aren't that great score-wise. So I finally decided to copy a weekendobsession type patternmatcher(the name means copy in swahili). For the movement, it uses stop and go, switching to an oscillator if that fails. The oscillator is technically based off of nanolaulectric, but its been changed a lot using some ideas from robar I read about on the wiki. It randomly changes the frequency of the oscillator when it gets hit, and it uses the enemy's distance to decide how far to move. And you're welcome for the kitten score boost, it's starting to seem like all of my nanobots are just kitten food.--[[User:CrazyBassoonist|CrazyBassoonist]] 01:48, 5 August 2009 (UTC)
  
Hey, thanks. If anyone can recommend a relatively weak robot for me to train on, that'd be awesome. I've been using N by Baal so far and right now MagicD2 only gets around 30% on average against him. -CrazyBassoonist
+
By the way, It's 5th place status is not official until it gets two thousand battles, I believe--[[User:CrazyBassoonist|CrazyBassoonist]] 01:49, 5 August 2009 (UTC)
  
Well, try ad.last.bottom! If you can't beat it, you can beat nothing in rumble! I see N is at 110th position in nanorumble, you must improve your bot's performance a lot! You may try my NanoKitty, it go and stuck in wall frequently, although it's linear targeting can't hit you! But I recommend you to release robot first and see it's performance in real world. Don't care if there codesize left, you can fill it in later. (In my robot, if I have more than 15 byte spare, I'll add color :)) --[[User:Nat|Nat]] 09:05, 25 January 2009 (UTC)
+
== Misleading Endgame ==
 +
Rednaxela's comments about signature moves gave me an interesting idea. As bots can still gather data after they are disabled(I think), it might be possible to throw off your enemies targeting system by moving in a misleading way if they get disabled. Does anyone think this would have any effect at all?--[[User:CrazyBassoonist|CrazyBassoonist]] 19:50, 31 July 2009 (UTC)
  
Welcome to this wiki. I would just take a few bots that are around 500-600 ranking, and watch the battles carefully to see what is going good and wrong. Check if your bot is doing what you are expecting. My first attempt was not really successfull either (285 place out of 300) but I (slowly) worked my way up. Good luck1 --[[User:GrubbmGait|GrubbmGait]] 09:45, 25 January 2009 (UTC)
+
I'd think this could have a very significant effect on ''some'' bots, however I think most decently strong bots make sure not to record data on the enemy when disabled. My non-codesize-restricted ones make sure of this anyway. It certainly wouldn't hurt to implement in any case. Actually, the way RougeDC moves when there are no bullets in the air, would already be misleading to any disabled bots that watch it, however RougeDC doesn't let them live long when disabled anyway :) --[[User:Rednaxela|Rednaxela]] 20:26, 31 July 2009 (UTC)
  
Thanks. That's probably a good idea. However, I can't seem to find one low in the rankings that I can download. Maybe someone could recommend an older bot for me to use? -CrazyBassoonist
+
It might be worth looking in to this... many bots only use (or heavily weight) waves that they fire on, so it wouldn't work. But even if these waves only carry 5% of the weight, you still might be able to throw their targeting off by a bit. You'd probably want to be careful that they're actually disabled before doing this, and maybe fire some bullets at times so that the battlefield inactivity thing won't kick in. Like Rednaxela said, it probably wouldn't work against many top bots, but it might be worth looking in to, my guess is that it would probably be enough to bump a decent bot quite a few places. [[User:Spinnercat|Spinnercat]] 00:46, 1 August 2009 (UTC)
  
I'd recommend checking the instructions to set a [[RoboRumble/Starting With RoboRumble| RoboRumble client]] and I think most people is using [[Darkcanuck/RRServer| Darkcanuck's]] server. If you run a client it will download all bots in the rumble ;-), and you would also help the rumble. To begin you could set the options to not execute any battles, that would only make your client to download all bots.
+
It might work especially well against nano patternmatchers. I'm pretty sure that all the weekendobsession type nano PM bots gather data after they are disabled, and it would be very easy to fool them by making it look like you were repeating the pattern they saw while disabled--[[User:CrazyBassoonist|CrazyBassoonist]] 01:06, 1 August 2009 (UTC)
  
If you want an arguably more direct approach, most bots are uploaded at http://robocoderepository.com/, you can search bots by name or some other parameters.
+
It may help you a little bit, yeah. When you are disable, Robocode just restrict you to move and fire, right? One funny thing is that in the virtual gun system of BlackHole, I just detect when the gunheat is zero I fire the virtual bullets, so when it get disabled it fires the VB every tick.
  
Also keep in mind that the same targeting/movement will have big differences against different bots, so you should train against more than one. Good luck at Robocoding. -[[User:Zyx|zyx]] 15:58, 25 January 2009 (UTC)
+
== Repository Problems ==
  
Thanks, guys. I think I'll just try to pick out some robots that use a variety of movement and targeting systems and test against those.-CrazyBassoonist
+
For some reason I cannot access robocoderepository.com, does anyone know why that might be?--[[User:CrazyBassoonist|CrazyBassoonist]] 02:25, 19 May 2009 (UTC)
  
If you go to the RoboRumble/Participants page on the old wiki, all the bots are listed, as well as the URL you can download them at. Be aware that many bots are designed specifically to avoid simple targeting, such as head-on, linear and circular. So until you have a 'learning' targeting there will be many bots that are specifically designed to avoid every bullet you fire. One popular technique is [[Stop And Go]] --[[User:Skilgannon|Skilgannon]] 06:59, 26 January 2009 (UTC)
+
I've been having troubles since monday. is the pages not loading or a 404 thing? --[[User:J Litewski|HACKhalo2]] 02:28, 19 May 2009 (UTC)
  
Thanks. I don't know much about the important stuff, but if there's any grunt work that needs to be done with the wiki I'd be glad to help with that. - [[CrazyBassoonist]]
+
I don't have any problem. Maybe your ISP blocked it? &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 06:50, 19 May 2009 (UTC)
  
 +
I'm not sure. It will load for me on one computer, but not on the one with Robocode on it.--[[User:CrazyBassoonist|CrazyBassoonist]] 12:15, 19 May 2009 (UTC)
  
== Targeting Issue ==
+
== SavantWS==
 +
Quick poll... Can I call this the first ever wavesurfing nanobot?--[[User:CrazyBassoonist|CrazyBassoonist]] 23:50, 29 July 2009 (UTC)
  
Code problem- I am working on a little experiment with my first piece of linear targeting code before I start working on the math(and I realize that this will not work very well at all without taking other factors into consideration), and I am having a problem with coding it. When I do this, the gun swings back and forth between about where it should be to behind the enemy robot.
+
Some info about how it works:  When the enemy fires, it logs a wave with information about when the wave will pass it and it's position, and only surfs the closest wave. It tries to move to a certain location on the wave,and it changes its destination when it gets hit. I think this is substantially different enough to be considered [[WaveSurfing]] because unlike robots like SavantVS and acesurf, SavantWS actually moves when a wave passes it in stead of changing when the enemy fires. If only it had enough space for a velocity segment, it might be really killer; as it is it has to use a duelistnano gun and it can't change direction except for on wall hits.--[[User:CrazyBassoonist|CrazyBassoonist]] 01:09, 30 July 2009 (UTC)
<pre>
 
public void onScannedRobot(ScannedRobotEvent e){
 
double robotSpeedDist = e.getVelocity()/20
 
                        +(e.getDistance()/1500);
 
double absoluteBearing = getHeadingRadians()
 
                        + e.getBearingRadians();
 
double turnGun = (robocode.util.Utils.normalRelativeAngle
 
                      (absoluteBearing - getGunHeadingRadians()));
 
if (turnGun > 0){
 
setTurnGunRightRadians(((robocode.util.Utils.normalRelativeAngle
 
                      (absoluteBearing - getGunHeadingRadians()))+(robotSpeedDist))/2);
 
}
 
else{
 
setTurnGunRightRadians(((robocode.util.Utils.normalRelativeAngle
 
                      (absoluteBearing-getGunHeadingRadians()))
 
                      -(robotSpeedDist))/2);
 
}
 
  
</pre>
+
That being said, I would like to get opinions from other people on the wiki who know more about wavesurfing than I do before I go off and claim that this is the first wavesurfing nano, just in case my interpretation of it is wrong or it has been done this way before and I'm not aware of it.--[[User:CrazyBassoonist|CrazyBassoonist]] 01:33, 30 July 2009 (UTC)
Can anyone tell me what I'm doing wrong? (Sorry about the sloppy code structure, I spent a while trying to get it to look good within the wiki format then gave up.)--[[User:CrazyBassoonist|CrazyBassoonist]] 23:26, 27 January 2009 (UTC)
 
  
Well firstly, distance has no effect on linear targeting. You should shoot at the same angle regardless, check the geometry if you want, it's strange but true. Secondly, while you do consider the enemy moving in reverse (ie. e.getVelocity() can be negative) you do not consider if they are orbiting you to the left or the right. To do this you must take into consideration [[Lateral Velocity]], ie. what the enemy's heading is, as well as their velocity. From the Linear Targeting page:
+
I think it is, however it would be good if you can open sourced it so we can confirm it. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 11:06, 30 July 2009 (UTC)
<pre>
 
public void onScannedRobot(ScannedRobotEvent e){
 
    double absoluteBearing = getHeadingRadians() + e.getBearingRadians();
 
    double latVel = e.getVelocity() * Math.sin(e.getHeadingRadians() - absoluteBearing);
 
    setTurnGunRightRadians(Utils.normalRelativeAngle(absoluteBearing - getGunHeadingRadians() +  latVel/11.0));
 
    setFire(3.0);
 
}
 
</pre>
 
You divide by 11 because that is the velocity of a power 3 bullet (20 - 3*power, power = 3).
 
  
The reason your gun is constantly swinging back and forth (with your current code) is because you are checking which way your gun still needs to turn, and using this to decide whether to shoot in front of the bot (for a bullet intercept) or at the 'mirror location' behind it. Because every time you turned the gun the required direction to turn would change, your gun would swivel back and forth from in front to behind. Hope this helps. --[[User:Skilgannon|Skilgannon]] 07:41, 28 January 2009 (UTC)
+
Sorry again (How many sorry I need to post today? Perhaps I should stop posting 'till tomorrow), you hid your source under the source part of RobocodeRepository.com. I'm using Lynx the time I download it for first time (I'm setting some Linux server and get bored =)) and RR.com, unlike the wiki, has very bad HTML layout. I don't think it is Wave Surfing. I think I can squeeze it to 329 bytes, I'll post it if you want, but not here. I think I still call it random mover, you didn't use real GF, but a ''random'' GF. And the way you detect if is quite weird (or ''voodoo'', in Voidious' term) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 11:30, 30 July 2009 (UTC)
  
If you still want to use you old Linear Targeting code, you can use <code>getVelocity()</code> instead of turnGun. For the code above, you can use turnGun instead of the second and the third <code>Utils.normalRelativeAngle(...)</code>. I think all wiki user know that Utils refer to robocode.util.Utils so you can changed that. I've clear you gun:
+
Aghh, I didn't realize I hadn't packaged the code with it. Here's the code, along with a few bugfixes and debugging graphics so you can really see what it's doing:
<pre>
+
<pre>package oog.nano.savantWS;
public void onScannedRobot(ScannedRobotEvent e){
+
import java.awt.*;
double robotSpeedDist = e.getVelocity()/20 + (e.getDistance()/1500);
+
import java.awt.geom.*;
double absoluteBearing = getHeadingRadians() + e.getBearingRadians();
+
import java.util.*;
double turnGun = Utils.normalRelativeAngle(absoluteBearing - getGunHeadingRadians());
 
if (e.getVelocity() > 0) {
 
setTurnGunRightRadians((turnGun + robotSpeedDist) / 2);
 
} else {
 
setTurnGunRightRadians((turnGun - robotSpeedDist) / 2);
 
}
 
}
 
</pre>
 
But it can't perform well without Lateral Velocity as [[User:Skilgannon|Skilgannon]] explained. --[[User:Nat|Nat]] 09:17, 28 January 2009 (UTC)
 
  
Ah, I see what the problem was. Thanks. I think I will finally have a robot that can beat all the sample ones now.--[[User:CrazyBassoonist|CrazyBassoonist]] 16:53, 1 February 2009 (UTC)
+
import robocode.*;
 +
/*SavantWS- By CrazyBassoonist.
 +
* Graphics version.
 +
*/
 +
public class SavantWS3 extends AdvancedRobot {
 +
    final static double BULLET_POWER=2.5;
 +
    final static int ASSUMED_SPEED=14;
 +
    final static int MAX_REACH=150;
 +
    static double GotoPoint;
 +
    static int dir;
 +
    static double enemyEnergy;
 +
    static ArrayList waves;
 +
    public void run(){
 +
    dir=1;
 +
    waves=new ArrayList();
 +
   
 +
    turnGunRightRadians(Double.POSITIVE_INFINITY);
 +
    }
 +
    public void onScannedRobot(ScannedRobotEvent e){
 +
        setTurnRightRadians(Math.cos(e.getBearingRadians()));
 +
        if(enemyEnergy>(enemyEnergy=e.getEnergy())){
 +
        //The only way this was fit into a nano was by having the robot make assumptions about half of the wavesurfing.
 +
        //Since we aren't using bearing at all, all we do is mark our position and the time the wave will pass us.
 +
        wave w=new wave();
 +
        w.x=getX();
 +
        w.y=getY();
 +
        w.endTime=(int)(getTime()+e.getDistance()/ASSUMED_SPEED);
 +
        waves.add(w);
 +
        }
 +
       
 +
        move();
 +
        for(int i=0;i<waves.size();i++){
 +
    wave w=(wave)waves.get(i);
 +
    Graphics2D g=getGraphics();
 +
    g.setColor(Color.blue);
 +
    int ex=(int)(getX()+e.getDistance()*Math.sin(e.getBearingRadians()+getHeadingRadians()));
 +
    int ey=(int)(getY()+e.getDistance()*Math.cos(e.getBearingRadians()+getHeadingRadians()));
 +
    g.drawOval((int)(ex-ASSUMED_SPEED*(getTime()-w.endTime)),(int)(ey-ASSUMED_SPEED*(getTime()-w.endTime)),(int)(2*ASSUMED_SPEED*(getTime()-w.endTime)),(int)(2*ASSUMED_SPEED*(getTime()-w.endTime)));
 +
        }
 +
        //Gun from duelist nano, smallest radar lock/gun available(AFAIK).
 +
        setTurnGunLeftRadians(getGunTurnRemainingRadians());
 +
        setFire(BULLET_POWER);
 +
    }
 +
    //Reverse when we hit a wall.
 +
    public void onHitWall(HitWallEvent e){
 +
    dir=-dir;
 +
    }
 +
    //Choose a new place to move to.
 +
    public void onHitByBullet(HitByBulletEvent e){
 +
    GotoPoint=MAX_REACH*Math.random();
 +
    }
 +
   
 +
    //Cheaper to do this here.
 +
    public void move(){
 +
    int closestWave=1000000;
 +
    int graphNum=10000;
 +
    Graphics2D g=getGraphics();
 +
    for(int i=0;i<waves.size();i++){
 +
    wave w=(wave)waves.get(i);
 +
    //Find our closest wave, that's the only one we want to surf.
 +
    if(w.endTime<closestWave&&getTime()<w.endTime){
 +
    setAhead(dir*(Point2D.distance(getX(),getY(),w.x,w.y)-GotoPoint));
 +
    graphNum=i;
 +
    closestWave=w.endTime;
 +
    }
 +
    }
 +
    if(graphNum!=10000){
 +
    wave GraphicsWave=(wave)waves.get(graphNum);
 +
g.setColor(Color.red);
 +
g.drawOval((int)(GraphicsWave.x-GotoPoint),(int)(GraphicsWave.y-GotoPoint),(int)GotoPoint*2,(int)GotoPoint*2);
 +
    }
 +
    }
 +
    public class wave{
 +
    double x;
 +
    double y;
 +
    int endTime;
 +
    public wave(){}
 +
    }
 +
}</pre>
  
How can you get your Linear Targeting to hit SpinBot??? I think all simple targeting can't hit all sample bot at once. --[[User:Nat|Nat]] 08:56, 2 February 2009 (UTC)
+
A bit about the voodoo in this, as nat says:
 +
:*'''Wave Tracking Voodoo'''-It does track waves. The thing is it tracks the waves using the wave's predicted hit time in lieu of normal methods.
  
Hmm.. the simplest thing I can think of that might have a kinda decent hit rate on all sample bots at once, would be a velocity averaged circular targeting with a system for considering 'acceleration' of the average velocity. --[[User:Rednaxela|Rednaxela]] 09:44, 2 February 2009 (UTC)
+
:*'''GF voodoo'''-You are very right that it does not use GF's. Calling that variable GF was more of a joke. As you can see I have changed it in this version. What it really does is create a danger area for each wave, with the size changing based on it getting hit.
  
I can get a good score against Spinbot by staying close, it hits it enough just by luck.--[[User:CrazyBassoonist|CrazyBassoonist]] 12:43, 2 February 2009 (UTC)
+
:*'''Surfing implementation'''-I think of this as more of a goto bot,as it tries to get  to a certain spot on every wave.
  
* Yeah, true. Just so long as you understand that staying close tends to be somewhat suicidal against most bots that keep radar locks and and fire about as often as they can :) --[[User:Rednaxela|Rednaxela]] 15:37, 2 February 2009 (UTC)
+
:*'''Waves drawn with the graphics'''-I think those could reasonably be called (buggy)waves. It draws them without gathering any extra information besides the enemy's location/absolute bearing. You can really see what it's thinking a lot better with the graphics on.
  
* Try to keep your distance at 50. I once saw some robot that move to distance of 50, so the bullets will hit almost of time, win large melee battle (11 bots on 800x600 battlefield) --[[User:Nat|Nat]] 09:33, 4 February 2009 (UTC)
+
:*'''Assumed bulletspeed'''-I think that this is one of the big problems for this robot. You can see how it works a lot better if you try it against a robot like ahf.Acero.
  
Hey, Rednaxela, the averaged thing isn't easy! I took around 2 hours writing mean circular gun because I use ArrayList of heading and velocity to find average instead of simple rolling average. OK, but the description about rolling average on old wiki isn't clear enough to understand easily (at least for me, I took around 2 weeks to understand it). I think that simple pattern matching is easier than one you explain above :)
+
An interesting note: Almost exactly the same APS in microrumble and nanorumble. I'd be very interested in hearing what everyone has to say about this (thanks nat)--[[User:CrazyBassoonist|CrazyBassoonist]] 16:18, 30 July 2009 (UTC)
  
For you, CrazyBassoonist, I see you MagicD2 win your testbed! (at least N). I'd recommend you to read other people robot. That help you understand many thing in robocode. I almost understand robocode api from other robots! But, as in beginners on the old robowiki, keep you finger out of Ctrl-C and Ctrl-V buttons!
+
It looks more like a random-distance bullet dodger that change the distance every time it is hit. And it try to get to the same distance for every bullet. Actually I have already got the code from the RR.com. I can squeeze it for 9 bytes more. This is 239 bytes:
--[[User:Nat|Nat]] 13:55, 2 February 2009 (UTC)
+
<pre>
 +
package oog.nano;
  
* Well Nat, nah, pattern matching is definitly not easier. Let me see if I can explain the 'rolling average' in a nice simple way... What happens, if you always take the average of your current value and your old average to make a new pseudo-average that smooths towards the average. That's the most basic form of rolling average and takes no more work than "avgValue = (avgValue + newValue)/2;". However, that often doesn't smooth the value out enough, so what is usually done is add multipliers like "avgValue = (2*avgValue + newValue)/3;". That is how rolling averages work, you just need a single double to store your average and a single simple line to update it. --[[User:Rednaxela|Rednaxela]] 15:37, 2 February 2009 (UTC)
+
import robocode.AdvancedRobot;
 +
import robocode.HitByBulletEvent;
 +
import robocode.HitWallEvent;
 +
import robocode.ScannedRobotEvent;
  
* Ha ha... That's the code description. On AntiSurfer page, it say like "In order to hit adaptive movement, you need low rolling average depth on your stats." On WaveSurfing Tutorial page, it say like "To dodge learning gun, you need to lower your rolling average depth." How your description above fit these text? Well, what I understand about rolling average is a kind of average that took only data in each frame to find average, or simplified to fit robocode theory is, a kind of average that drop old data and took only k number of past data to find average. I think the second description is what it use in robocode :) And with that description of rolling average, I can modify BasicSurfer and fit rolling average into it (which result in [[BlackHole]]). But your description is absolutely correct for those who know what it done (on old robowiki page RollingAverage said that his (Paul Evans) rolling average function will keep current list of data and drop old values that exceed its depth rate like a magic!). For newbie, it hard to understand, too. (or not, please answer me, CrazyBassoonist) --[[User:Nat|Nat]] 09:33, 4 February 2009 (UTC)
+
import java.awt.geom.Point2D;
 +
import java.util.ArrayList;
  
I don't think you need to average anything to beat the sample bots, of course it can be improved with averaged values, and while doing it very simple you don't perform so well against better bots but is a good starting point. If you implement [[Circular_Targeting]] as explained in the last paragraph of [[Circular_Targeting/Walkthrough]] you can hit very well most sample bots and should still be very easy to implement, it can hit very well SpinBot ans Walls, but of course has some problems with some of the non so predictable. But with a very bad movement it still beats them all because they fire head on, and is easy to make it fit into a nano (where pattern matching is possible, but not easy at all). It will not be so good against better movements, but I found it the simplest gun that can hit all sample bots. -[[User:Zyx|zyx]] 21:48, 2 February 2009 (UTC)
+
/*
 +
* SavantWS- By CrazyBassoonist.Version 0.1- Initial release. Still awaiting
 +
* judgement on whether I can trulycall this *drumroll*... The first true
 +
* wavesurfing nanobot!
 +
*/
 +
public class SaventWS extends AdvancedRobot {
 +
final static double BULLET_POWER = 2.5;
 +
final static int MOVE_UNIT = 20;
 +
final static int ASSUMED_SPEED = 14;
 +
final static int MAX_GF_REACH = 300;
 +
static double GF;
 +
static int dir;
 +
static double enemyEnergy;
 +
static ArrayList<SaventWS.wave> waves;
 +
 +
public void run() {
 +
dir = MOVE_UNIT;
 +
waves = new ArrayList<SaventWS.wave>();
 +
 +
turnGunRightRadians(Double.POSITIVE_INFINITY);
 +
}
 +
 +
public void onScannedRobot(ScannedRobotEvent e) {
 +
wave w;
 +
int et,i,closestWave = 1000000;
 +
 +
setTurnRightRadians(Math.cos(e.getBearingRadians()));
 +
if (enemyEnergy > (enemyEnergy = e.getEnergy())) {
 +
// The only way this was fit into a nano was by having the robot
 +
// make assumptions about half of the wavesurfing.
 +
// Since we aren't using bearing at all, all we do is mark our
 +
// position and the time the wave will pass us.
 +
waves.add(w = new wave());
 +
w.x = getX();
 +
w.y = getY();
 +
w.endTime = (int) (getTime() + e.getDistance() / ASSUMED_SPEED);
 +
}
 +
 +
for (i = 0; i < waves.size(); i++) {
 +
w = waves.get(i);
 +
// Find our closest wave, that's the only one we want to surf.
 +
if ((et = w.endTime) < closestWave && getTime() < et) {
 +
 +
// If we haven't reached the GF we want to be at, move there.
 +
if (Point2D.distance(getX(), getY(), w.x, w.y) < GF) {
 +
setAhead(dir);
 +
}
 +
closestWave = et;
 +
}
 +
}
 +
 +
// Gun from duelist nano, smallest radar lock/gun available (AFAIK).
 +
setTurnGunLeftRadians(getGunTurnRemainingRadians());
 +
setFire(BULLET_POWER);
 +
}
 +
 +
// Reverse when we hit a wall.
 +
public void onHitWall(HitWallEvent e) {
 +
dir = -dir;
 +
}
 +
 +
// Choose a new GF to move to. This isn't really a GF, but it approximates
 +
// it.
 +
public void onHitByBullet(HitByBulletEvent e) {
 +
GF = MAX_GF_REACH * Math.random();
 +
}
 +
 +
static class wave {
 +
double x;
 +
double y;
 +
int endTime;
 +
}
 +
}
 +
</pre>
 +
I haven't test it yet, but I think it can work just like the one you uploaded. And I think it has enough room for simple random gun to put in. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 17:02, 30 July 2009 (UTC)
  
== Roborumble Questions ==
+
Hm... maybe it's just me, but I'm not sure the idea of a wave surfing nano is such a good idea. Perhaps Nat touched on it when he said that it did about as well in micro as in nano land. Basically, my interpretation of wavesurfing is that it dodges guessfactors. It works best against GuessFactor Targeting, but most of the bots in Nano-land (at least the top ones) use symbolic pattern matching. And, it seems like always going to the same place on a wave will make it really easy to be hit with a pattern matcher. In micro, there are more GF targeters, which might be one reason that it's doing just as well ;) So perhaps it would be better to keep this as a micro, and maybe develop the gun a  bit. Of course, i'm still a bit new to robocode, so i might be giving bad advice.
 +
And thanks, your bot was responsible for helping Kitten to 14th place :D [[User:Spinnercat|Spinnercat]] 17:47, 30 July 2009 (UTC)
  
Just wondering.... How long does it usually take before a bot gets ranked in the roborumble?--[[User:CrazyBassoonist|CrazyBassoonist]] 17:11, 15 February 2009 (UTC)
+
@Spinnercat:  Glad to help. And by the way, you are completely right. A nano wavesurfing implementation will probably never be strong at all, because it uses a ton of code(if you look at the code, my radar/gun are combined into 2 lines total) and it could never fit in the things that make wavesurfing strong. I'm trying to make a wavesurfing nano just to see if it can be done. You're also right about it being a lot more effective in micro land, I'm actually working on a SavantMicroWS with wavesurfing right now.
  
Very short if there are clients around. I know that right now no active client is processed. I've run 300 battles just for my BlackHole for about lat 6 hours ago and there no more battles since then. If you want immediate rank, try running your own client! Make sure use use Darkcanuck server. (at first, I don't want to run client, but with interest in Ocnirp 1.0, I stand in front of my laptop for a whole night to see its ranking!) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 17:43, 15 February 2009 (UTC)
+
@Nat:I'm not really sure what you mean by bullet dodger, but I tend to think of a robot that
 +
moves a certain distance when the other robot fires. It's true that this robot's movement looks alot like it is doing that, but if you use the graphics version you can see what it is really doing--[[User:CrazyBassoonist|CrazyBassoonist]] 18:03, 30 July 2009 (UTC)
  
Thanks, can you tell me how long it takes before it uploads the results? And how do I make it use the Darkcanuck server?--[[User:CrazyBassoonist|CrazyBassoonist]] 18:26, 15 February 2009 (UTC)
+
I'd certainly say this counts as a wave surfer. Not a strong one, nor a learning one, but it does appear to surf the waves in a limited capacity. A highly-imprecise flattener-only surfer is still a surfer, and that's what this is I'd say. By the way, your "Wave Tracking Voodoo" is nearly exactly the same as something I once had done myself to make a very small codesize bot to dodge pattern matching, it seemed to be kind of broken and I couldn't quite get it into nano size, but I suppose it technically surfed too. I should probably polish it and release it as a micro some time... :) --[[User:Rednaxela|Rednaxela]] 20:33, 30 July 2009 (UTC)
  
Follow [[RoboRumble/Starting_With_RoboRumble]] page, in order to config with Darkcanuck server, replace every http://rumble.fevvir.com/rumble/ (or something like this) to http://darkcanuck.net/rumble/. After rebuild robot database and download missing bot (took ~30 minutes for me), the result will appear immediately! &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 18:45, 15 February 2009 (UTC)
+
Interesting. SavantWS could probably be changed into an extremely buggy version of that and still be a nano. All you would have to do would be to change the direction and location to move to randomly when a wave passes it instead of when it hits a wall or gets hit.--[[User:CrazyBassoonist|CrazyBassoonist]] 21:05, 30 July 2009 (UTC)
  
Okay, I'll do that. Thanks--[[User:CrazyBassoonist|CrazyBassoonist]] 18:51, 15 February 2009 (UTC)
+
Hey, sure, I'll gladly share my thoughts. I only refrained before because I don't know much about AceSurf or SavantVS. Anyway, yes, I would certainly call this a Wave Surfer. The term "Wave Surfing" is kind of like "GuessFactor Targeting": it has a clear and simple meaning, but 90% of the time, things like [[Precise Prediction]] or [[Visit Count Stats]] come along with it, so people start to associate the term with all those other things, too. I can't really comment on whether it's the "first NanoBot Wave Surfer", though, just because I don't know much about AceSurf or SavantVS. You could always say something like, "it's arguably the first NanoBot Wave Surfer". =) Or just say that you think it is - no harm in that. Pretty cool, by the way! --[[User:Voidious|Voidious]] 02:09, 31 July 2009 (UTC)
  
If you want result for TBull, I think you need to put EXCLUDES=*BlackHole* in your setting for temporary, since my BlackHole has same priority as your, but my bot come first so it will battle my bots until it reach 2000 battles before start battle with your bot. Just don't forget to set EXCLUDES= whenever your bot reach 2000 battles :) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 19:07, 15 February 2009 (UTC)
+
Thanks! If you look at the code, robots like SavantVS and AceSurf actually use no waves at all, so I think I'll call it the first if noone else has an objection:-)--[[User:CrazyBassoonist|CrazyBassoonist]] 02:46, 31 July 2009 (UTC)
 +
== Bad Results ==
 +
For some reason, the new Acraepheus was doing well then started getting zeros. Is this the result of a bug with a different version of robocode, or bad results being uploaded?--[[User:CrazyBassoonist|CrazyBassoonist]] 22:01, 19 May 2009 (UTC)
  
Oops, I've done something wrong. What does "PARTICIPANTSURL" and "UPDATEBOTSURL" need to be set to?--[[User:CrazyBassoonist|CrazyBassoonist]] 19:09, 15 February 2009 (UTC)
+
By the way, I have 1.6.2--[[User:CrazyBassoonist|CrazyBassoonist]] 22:08, 19 May 2009 (UTC)
 +
: The results I'm running show your bot doing fairly well.  Perhaps it is a client issue or something.  --[[User:Miked0801|Miked0801]] 22:41, 19 May 2009 (UTC)
 +
:: It appears the [[User:Voidious|Voidious]]'s server is the one giving you all the 0s.  Perhaps you have an exception or something that only shows up in version 1.5.4? Dunno. --[[User:Miked0801|Miked0801]] 22:44, 19 May 2009 (UTC)
  
No and Yes: PARTICIPANTSURL is correctly set to old wiki, but UPDATEBOTSURL is needed to be set to new server. But, I almost go to bed now (I'd 2:20 am in my country where I need to work up at 5:30 this morning) so I may don't answer you shortly &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 19:21, 15 February 2009 (UTC)
+
You're right, thank you very much for drawing that to my attention. Does anyone know of any issues like this that occur in 1.5.4 but not in other versions?--[[User:CrazyBassoonist|CrazyBassoonist]] 22:50, 19 May 2009 (UTC)
  
Nat's AtomicMini is giving me trouble, whenever I run roborumble it ends up stuck trying to download it. Does anyone know of a way to prevent that from happening?--[[User:CrazyBassoonist|CrazyBassoonist]] 19:48, 15 February 2009 (UTC)
+
Argh, not sure what the problem is, but killed my clients for now. I'll add you to my exclude list before I start 'em again until we figure it out. --[[User:Voidious|Voidious]] 23:00, 19 May 2009 (UTC)
  
Which version of robocode do you use? I have this problem myself, too. But my client end up in skip it. I will reupload every of my robot to new place by this Thursday. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 19:56, 15 February 2009 (UTC)
+
Thanks. By now I'm guessing that what I need to do is figure out what is making errors in 1.5.4 and fix it then re-upload those versions. --[[User:CrazyBassoonist|CrazyBassoonist]] 23:06, 19 May 2009 (UTC)
  
1.62 I think. I didn't check. I am now getting a message that says "could not connect to http robocoderepository.com/Controller.jps?submitAction=downloadclass&id=(the bots id)" for every robot. :-(--[[User:CrazyBassoonist|CrazyBassoonist]] 22:28, 15 February 2009 (UTC)
+
Sorry, I was on my way out the door before. Here's the error being hit in 1.5.4:
 +
<pre>
 +
Acraepheus 2.2 (1): Throwable: java.lang.NoSuchMethodError: oog.Acraepheus.getGraphics()Ljava/awt/Graphics2D;
 +
java.lang.NoSuchMethodError: oog.Acraepheus.getGraphics()Ljava/awt/Graphics2D;
 +
    at oog.Acraepheus.onScannedRobot(Acraepheus.java:75)
 +
    at robocode.peer.robot.EventManager.onScannedRobot(Unknown Source)
 +
    at robocode.peer.robot.EventManager.processEvents(Unknown Source)
 +
    at robocode.peer.RobotPeer.tick(Unknown Source)
 +
    at robocode.peer.RobotPeer.turnRadar(Unknown Source)
 +
    at robocode._AdvancedRadiansRobot.turnRadarRightRadians(Unknown Source)
 +
    at oog.Acraepheus.run(Acraepheus.java:71)
 +
    at robocode.peer.RobotPeer.run(Unknown Source)
 +
    at java.lang.Thread.run(Thread.java:619)
 +
</pre>
 +
I don't mind updating my clients, but unfortunately, there's no guarantee someone else won't run 1.5.4 as long as it's still allowed...
  
I think it the rule of roborumble to use version 1.5.4 or 1.6.0. I once saw that PEZ say that 1.6.1.4 is allowed, too. You might have to change your version. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 09:42, 16 February 2009 (UTC)
+
--[[User:Voidious|Voidious]] 23:52, 19 May 2009 (UTC)
 +
: And I believe that error would happen in 1.6.0 too, I had the same problem once, since then I always get the Graphics2D object out of the onPaint method only. --[[User:Zyx|zyx]] 01:03, 20 May 2009 (UTC)
  
1.6.1.4 is best actually. There are a number of rumble-related bugs fixed that were in 1.6.0 and older. I've tested this version extensively. However, I need to note that all version download just fine. If you're getting those errors it either means '''1)''' robocoderepository.com is down (again...), '''2)''' your computer can't access it for some reason OR '''3)''' Those bots were lost at robocoderepository.com, which seems to happen a bit. Missing ones can be found in the zip files linked on [http://robowiki.net/cgi-bin/robowiki?RoboRumble/StartingWithRoboRumble RoboRumble/StartingWithRoboRumble]. --[[User:Rednaxela|Rednaxela]] 03:36, 17 February 2009 (UTC)
+
Well it looks like it's just a problem with the debugging graphics. Line 75 is this: <pre>Graphics 2D g=getGraphics();</pre> Shouldn't hurt that much to remove it, I probably should have left the debugging graphics out anyway.--[[User:CrazyBassoonist|CrazyBassoonist]] 00:32, 20 May 2009 (UTC)
  
Well, actually I know that it is my fault, as it only started happening after I edited the text file to try to make it use the darkcanuck server.I successfully downloaded about half the robots, so I'm not going to run it for fear of giving wrong results.--[[User:CrazyBassoonist|CrazyBassoonist]] 04:07, 17 February 2009 (UTC)
+
I've now got it fixed, thanks for the help. How long does it take the rumble to remove robots that have been removed from the participants list? Even some of my very old robots seem to be there still--[[User:CrazyBassoonist|CrazyBassoonist]] 01:08, 20 May 2009 (UTC)
  
You can edit config file to "UPLOAD=NOT" to prevent wrong results been uploaded. Actually, I think 1.6.2 has some unidentified bug. SandboxDT can't run on 1.6.2 on my machine, but 1.6.0 can. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 12:15, 17 February 2009 (UTC)
+
It's not a static delay, as far as I know it's just that it only allows removals from Darkcanuck's clients. That's usually within a day or so, in my experience. No need to wait on posting your new versions, though, at least if you ask me. =) --[[User:Voidious|Voidious]] 01:17, 20 May 2009 (UTC)
  
 +
Thanks, I was more concerned about the old versions being gigantic problembots for others due to the zeros. Is it normal to see scores that you can't replicate in tests? I've tried my robot against barracuda 1.0 about 20 times by now, and the lowest score I've recorded so far has been 42%. How could it have ended up with 32% against it in the roborumble?--[[User:CrazyBassoonist|CrazyBassoonist]] 01:42, 20 May 2009 (UTC)
  
==New Targeting==
+
Nope, and I also get incredibly frustrated when I see battle results that I can't duplicate locally. But there can be a surprising amount of variance in Robocode battles. --[[User:Voidious|Voidious]] 01:49, 20 May 2009 (UTC)
  
 +
: Behold, the demon known as Standard Deviation - bane of all robocoders looking for consistant results :) --01:57, 20 May 2009 (UTC)
  
Well, I've been working on my targeting some, and I developed a gun that worked pretty well (by my standards). Although its not as accurate as the simpler methods, It can't be fooled in the same ways so I consider it to be much better. There's just one problem with it.... It doesn't work at all with a moving robot. Sigh. Back to the drawing board. Here's the code for it, though, I've kind of been wondering what kind of targeting this would be considered:
+
But wait a second.... I realize that that's within the realm of probability, but what about the 10% against pkkillers.PKassassin? I average around 50% on him in my own tests.... And acraepheus hasn't been doing too well against duelistMicro, but 3% is really pushing it=( Anyway, standard deviance or not, I must sleep now so I'll try to see what it is tomorrow--[[User:CrazyBassoonist|CrazyBassoonist]] 02:06, 20 May 2009 (UTC)
<pre>package oog;
 
import robocode.*;
 
public class RADGun extends AdvancedRobot{
 
double oldTime=0;
 
double newTime;
 
double oldBearing;
 
double newBearing;
 
double t;
 
double totalTime;
 
double gunTurn;
 
public void run() {
 
newTime=getTime();
 
turnRadarRightRadians(Double.POSITIVE_INFINITY);
 
}
 
public void onScannedRobot(ScannedRobotEvent e) {
 
double absBearing = e.getBearingRadians()+getHeadingRadians();
 
newTime=getTime();
 
totalTime=newTime-oldTime;
 
newBearing = absBearing;
 
gunTurn=oldBearing-newBearing;
 
if(e.getDistance()/13<=totalTime){
 
oldBearing=absBearing;
 
oldTime=getTime();
 
System.out.println("gunTurn is:"+gunTurn);
 
}
 
setTurnGunRightRadians(robocode.util.Utils.normalRelativeAngle(absBearing-getGunHeadingRadians())-(gunTurn));
 
setTurnRadarLeftRadians(getRadarTurnRemainingRadians());
 
setFire(3);
 
 
}
 
 
}
 
</pre>
 
Also, I've noticed that my talk page is getting pretty crowded, should I delete some of the stuff there?--[[User:CrazyBassoonist|CrazyBassoonist]] 03:14, 19 February 2009 (UTC)
 
  
No, you shouldn't. Instead, you can categorized the comments. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 08:58, 19 February 2009 (UTC)
+
: In both cases, the other bot only has a couple hundred bullet damage (way cool we can see that on Darkcanuck's server), which leads me to believe your bot must have errored out somehow... --[[User:Voidious|Voidious]] 02:10, 20 May 2009 (UTC)
  
  
== Random Robot Question ==
+
Okay... I downloaded 1.6.1.4, and I'm not getting any errors so far--[[User:CrazyBassoonist|CrazyBassoonist]] 21:01, 20 May 2009 (UTC)
  
Just wondering, if randomly firing between all the angles that the enemy robot could travel to should hit all robots equally, would combining it with a movement that picks all the points it could travel to and randomly chooses one create a robot that gets a similar score against every robot?--[[User:CrazyBassoonist|CrazyBassoonist]] 17:40, 22 February 2009 (UTC)
+
== Changes checking ==
  
No, it does not. Usually, GF gun will HIT those random movement much. Random gun should be OK. There some old discussion on the old wiki:
+
I'm curious, how can you answer things so fast? I actually checking the recent changes every 10 minutes. But when I'm working, I may left it for hours without checking. Are you using RSS/Atom client which refresh every minute? &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 13:51, 27 May 2009 (UTC)
: "The very good movement and random gun work better than very bad movement and super good gun."
 
That's all, you can only HIT most top bot by luck even with the best gun :) I think the movement type you said is name "EscapeAreaMovement" used by Lolita (a part of ancient cx.Princess). But the author, who is [[PEZ]], said himself that this movement doesn't work well, he will go on work with all those flat movement. Of course, that's a long time ago when Wave Surfing has not yet invented. On that time, people focuses on flat movement to dodge SandboxDT. So, I supposes you to do a kind of random gun + flat movement instead :) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 18:00, 22 February 2009 (UTC)
 
  
Hmm, well I've heard that GF hits random movement well, but I don't really see why a GF gun would work better than others against random movement. Isn't GF targeting all about keeping track of what angle hits the most? If you were moving randomly, all firing angles would be equally effective--[[User:CrazyBassoonist|CrazyBassoonist]] 18:38, 22 February 2009 (UTC)
+
Theres no secret to it, Its just that I often find myself checking the wiki while developing robots. There's not much to do when waiting for a thousand round melee battle to finish--[[User:CrazyBassoonist|CrazyBassoonist]] 13:55, 27 May 2009 (UTC)

Latest revision as of 05:50, 8 October 2009

       Archive        This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.     

Fuatisha

Wow, where did this bot come from? Congrats on 5th place in nano (and thanks for bumping Kitten to above NanoLauLecktrik again xD)! Wanna tell us about your bot, and what you did? Does it use the nano wavesurfing as in savantWS? Or does it use a misleading endgame to fool the PM guns? Both I think are slightly unlikely based on the scores, but I'm curious now! And unless I'm mistaken, you didn't include the source with the .jar, you might want to consider keeping it open source, like most nanos ;). Spinnercat 01:09, 5 August 2009 (UTC)

Well, first of all it is open source. You can download the source at http://robocoderepository.com/BotDetail.jsp?id=3720. Sorry for not including it, but honestly the problem is that I keep thinking I am including the source while my robots never seem to have the source with them. About Fuatisha, I decided that I would try to make a competitive robot for once instead of stuff like SavantWS that are kind of cool but aren't that great score-wise. So I finally decided to copy a weekendobsession type patternmatcher(the name means copy in swahili). For the movement, it uses stop and go, switching to an oscillator if that fails. The oscillator is technically based off of nanolaulectric, but its been changed a lot using some ideas from robar I read about on the wiki. It randomly changes the frequency of the oscillator when it gets hit, and it uses the enemy's distance to decide how far to move. And you're welcome for the kitten score boost, it's starting to seem like all of my nanobots are just kitten food.--CrazyBassoonist 01:48, 5 August 2009 (UTC)

By the way, It's 5th place status is not official until it gets two thousand battles, I believe--CrazyBassoonist 01:49, 5 August 2009 (UTC)

Misleading Endgame

Rednaxela's comments about signature moves gave me an interesting idea. As bots can still gather data after they are disabled(I think), it might be possible to throw off your enemies targeting system by moving in a misleading way if they get disabled. Does anyone think this would have any effect at all?--CrazyBassoonist 19:50, 31 July 2009 (UTC)

I'd think this could have a very significant effect on some bots, however I think most decently strong bots make sure not to record data on the enemy when disabled. My non-codesize-restricted ones make sure of this anyway. It certainly wouldn't hurt to implement in any case. Actually, the way RougeDC moves when there are no bullets in the air, would already be misleading to any disabled bots that watch it, however RougeDC doesn't let them live long when disabled anyway :) --Rednaxela 20:26, 31 July 2009 (UTC)

It might be worth looking in to this... many bots only use (or heavily weight) waves that they fire on, so it wouldn't work. But even if these waves only carry 5% of the weight, you still might be able to throw their targeting off by a bit. You'd probably want to be careful that they're actually disabled before doing this, and maybe fire some bullets at times so that the battlefield inactivity thing won't kick in. Like Rednaxela said, it probably wouldn't work against many top bots, but it might be worth looking in to, my guess is that it would probably be enough to bump a decent bot quite a few places. Spinnercat 00:46, 1 August 2009 (UTC)

It might work especially well against nano patternmatchers. I'm pretty sure that all the weekendobsession type nano PM bots gather data after they are disabled, and it would be very easy to fool them by making it look like you were repeating the pattern they saw while disabled--CrazyBassoonist 01:06, 1 August 2009 (UTC)

It may help you a little bit, yeah. When you are disable, Robocode just restrict you to move and fire, right? One funny thing is that in the virtual gun system of BlackHole, I just detect when the gunheat is zero I fire the virtual bullets, so when it get disabled it fires the VB every tick.

Repository Problems

For some reason I cannot access robocoderepository.com, does anyone know why that might be?--CrazyBassoonist 02:25, 19 May 2009 (UTC)

I've been having troubles since monday. is the pages not loading or a 404 thing? --HACKhalo2 02:28, 19 May 2009 (UTC)

I don't have any problem. Maybe your ISP blocked it? » Nat | Talk » 06:50, 19 May 2009 (UTC)

I'm not sure. It will load for me on one computer, but not on the one with Robocode on it.--CrazyBassoonist 12:15, 19 May 2009 (UTC)

SavantWS

Quick poll... Can I call this the first ever wavesurfing nanobot?--CrazyBassoonist 23:50, 29 July 2009 (UTC)

Some info about how it works: When the enemy fires, it logs a wave with information about when the wave will pass it and it's position, and only surfs the closest wave. It tries to move to a certain location on the wave,and it changes its destination when it gets hit. I think this is substantially different enough to be considered WaveSurfing because unlike robots like SavantVS and acesurf, SavantWS actually moves when a wave passes it in stead of changing when the enemy fires. If only it had enough space for a velocity segment, it might be really killer; as it is it has to use a duelistnano gun and it can't change direction except for on wall hits.--CrazyBassoonist 01:09, 30 July 2009 (UTC)

That being said, I would like to get opinions from other people on the wiki who know more about wavesurfing than I do before I go off and claim that this is the first wavesurfing nano, just in case my interpretation of it is wrong or it has been done this way before and I'm not aware of it.--CrazyBassoonist 01:33, 30 July 2009 (UTC)

I think it is, however it would be good if you can open sourced it so we can confirm it. » Nat | Talk » 11:06, 30 July 2009 (UTC)

Sorry again (How many sorry I need to post today? Perhaps I should stop posting 'till tomorrow), you hid your source under the source part of RobocodeRepository.com. I'm using Lynx the time I download it for first time (I'm setting some Linux server and get bored =)) and RR.com, unlike the wiki, has very bad HTML layout. I don't think it is Wave Surfing. I think I can squeeze it to 329 bytes, I'll post it if you want, but not here. I think I still call it random mover, you didn't use real GF, but a random GF. And the way you detect if is quite weird (or voodoo, in Voidious' term) » Nat | Talk » 11:30, 30 July 2009 (UTC)

Aghh, I didn't realize I hadn't packaged the code with it. Here's the code, along with a few bugfixes and debugging graphics so you can really see what it's doing:

package oog.nano.savantWS;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;

import robocode.*;
/*SavantWS- By CrazyBassoonist.
 * Graphics version.
*/
public class SavantWS3 extends AdvancedRobot {
    final static double BULLET_POWER=2.5;
    final static int ASSUMED_SPEED=14;
    final static int MAX_REACH=150;
    static double GotoPoint;
    static int dir;
    static double enemyEnergy;
    static ArrayList waves;
    public void run(){
    	dir=1;
    	waves=new ArrayList();
    	
    	turnGunRightRadians(Double.POSITIVE_INFINITY);
    }
    public void onScannedRobot(ScannedRobotEvent e){
        setTurnRightRadians(Math.cos(e.getBearingRadians()));
        if(enemyEnergy>(enemyEnergy=e.getEnergy())){
        	//The only way this was fit into a nano was by having the robot make assumptions about half of the wavesurfing.
        	//Since we aren't using bearing at all, all we do is mark our position and the time the wave will pass us.
        	wave w=new wave();
	        w.x=getX();
	        w.y=getY();
	        w.endTime=(int)(getTime()+e.getDistance()/ASSUMED_SPEED);
	        waves.add(w);
        }
        
        move();
        for(int i=0;i<waves.size();i++){
    		wave w=(wave)waves.get(i);
    		Graphics2D g=getGraphics();
    		g.setColor(Color.blue);
    		int ex=(int)(getX()+e.getDistance()*Math.sin(e.getBearingRadians()+getHeadingRadians()));
    		int ey=(int)(getY()+e.getDistance()*Math.cos(e.getBearingRadians()+getHeadingRadians()));
    		g.drawOval((int)(ex-ASSUMED_SPEED*(getTime()-w.endTime)),(int)(ey-ASSUMED_SPEED*(getTime()-w.endTime)),(int)(2*ASSUMED_SPEED*(getTime()-w.endTime)),(int)(2*ASSUMED_SPEED*(getTime()-w.endTime)));
        }
        //Gun from duelist nano, smallest radar lock/gun available(AFAIK).
        setTurnGunLeftRadians(getGunTurnRemainingRadians());
        setFire(BULLET_POWER);
    }
    //Reverse when we hit a wall.
    public void onHitWall(HitWallEvent e){
    	dir=-dir;
    }
    //Choose a new place to move to.
    public void onHitByBullet(HitByBulletEvent e){
    	GotoPoint=MAX_REACH*Math.random();
    }
    
    //Cheaper to do this here.
    public void move(){
    	int closestWave=1000000;
    	int graphNum=10000;
    	Graphics2D g=getGraphics();
    	for(int i=0;i<waves.size();i++){
    		wave w=(wave)waves.get(i);
    		//Find our closest wave, that's the only one we want to surf.
    		if(w.endTime<closestWave&&getTime()<w.endTime){
    			setAhead(dir*(Point2D.distance(getX(),getY(),w.x,w.y)-GotoPoint));
    			graphNum=i;
    			closestWave=w.endTime;
    		}
    	}
    	if(graphNum!=10000){
	    	wave GraphicsWave=(wave)waves.get(graphNum);
			g.setColor(Color.red);
			g.drawOval((int)(GraphicsWave.x-GotoPoint),(int)(GraphicsWave.y-GotoPoint),(int)GotoPoint*2,(int)GotoPoint*2);
    	}
    }
    public class wave{
    	double x;
    	double y;
    	int endTime;
    	public wave(){}
    }
}

A bit about the voodoo in this, as nat says:

  • Wave Tracking Voodoo-It does track waves. The thing is it tracks the waves using the wave's predicted hit time in lieu of normal methods.
  • GF voodoo-You are very right that it does not use GF's. Calling that variable GF was more of a joke. As you can see I have changed it in this version. What it really does is create a danger area for each wave, with the size changing based on it getting hit.
  • Surfing implementation-I think of this as more of a goto bot,as it tries to get to a certain spot on every wave.
  • Waves drawn with the graphics-I think those could reasonably be called (buggy)waves. It draws them without gathering any extra information besides the enemy's location/absolute bearing. You can really see what it's thinking a lot better with the graphics on.
  • Assumed bulletspeed-I think that this is one of the big problems for this robot. You can see how it works a lot better if you try it against a robot like ahf.Acero.

An interesting note: Almost exactly the same APS in microrumble and nanorumble. I'd be very interested in hearing what everyone has to say about this (thanks nat)--CrazyBassoonist 16:18, 30 July 2009 (UTC)

It looks more like a random-distance bullet dodger that change the distance every time it is hit. And it try to get to the same distance for every bullet. Actually I have already got the code from the RR.com. I can squeeze it for 9 bytes more. This is 239 bytes:

package oog.nano;

import robocode.AdvancedRobot;
import robocode.HitByBulletEvent;
import robocode.HitWallEvent;
import robocode.ScannedRobotEvent;

import java.awt.geom.Point2D;
import java.util.ArrayList;

/*
 * SavantWS- By CrazyBassoonist.Version 0.1- Initial release. Still awaiting
 * judgement on whether I can trulycall this *drumroll*... The first true
 * wavesurfing nanobot!
 */
public class SaventWS extends AdvancedRobot {
	final static double BULLET_POWER = 2.5;
	final static int MOVE_UNIT = 20;
	final static int ASSUMED_SPEED = 14;
	final static int MAX_GF_REACH = 300;
	static double GF;
	static int dir;
	static double enemyEnergy;
	static ArrayList<SaventWS.wave> waves;
	
	public void run() {
		dir = MOVE_UNIT;
		waves = new ArrayList<SaventWS.wave>();
		
		turnGunRightRadians(Double.POSITIVE_INFINITY);
	}
	
	public void onScannedRobot(ScannedRobotEvent e) {
		wave w;
		int et,i,closestWave = 1000000;
		
		setTurnRightRadians(Math.cos(e.getBearingRadians()));
		if (enemyEnergy > (enemyEnergy = e.getEnergy())) {
			// The only way this was fit into a nano was by having the robot
			// make assumptions about half of the wavesurfing.
			// Since we aren't using bearing at all, all we do is mark our
			// position and the time the wave will pass us.
			waves.add(w = new wave());
			w.x = getX();
			w.y = getY();
			w.endTime = (int) (getTime() + e.getDistance() / ASSUMED_SPEED);
		}
		
		for (i = 0; i < waves.size(); i++) {
			w = waves.get(i);
			// Find our closest wave, that's the only one we want to surf.
			if ((et = w.endTime) < closestWave && getTime() < et) {
				
				// If we haven't reached the GF we want to be at, move there.
				if (Point2D.distance(getX(), getY(), w.x, w.y) < GF) {
					setAhead(dir);
				}
				closestWave = et;
			}
		}
		
		// Gun from duelist nano, smallest radar lock/gun available (AFAIK).
		setTurnGunLeftRadians(getGunTurnRemainingRadians());
		setFire(BULLET_POWER);
	}
	
	// Reverse when we hit a wall.
	public void onHitWall(HitWallEvent e) {
		dir = -dir;
	}
	
	// Choose a new GF to move to. This isn't really a GF, but it approximates
	// it.
	public void onHitByBullet(HitByBulletEvent e) {
		GF = MAX_GF_REACH * Math.random();
	}
	
	static class wave {
		double x;
		double y;
		int endTime;
	}
}

I haven't test it yet, but I think it can work just like the one you uploaded. And I think it has enough room for simple random gun to put in. » Nat | Talk » 17:02, 30 July 2009 (UTC)

Hm... maybe it's just me, but I'm not sure the idea of a wave surfing nano is such a good idea. Perhaps Nat touched on it when he said that it did about as well in micro as in nano land. Basically, my interpretation of wavesurfing is that it dodges guessfactors. It works best against GuessFactor Targeting, but most of the bots in Nano-land (at least the top ones) use symbolic pattern matching. And, it seems like always going to the same place on a wave will make it really easy to be hit with a pattern matcher. In micro, there are more GF targeters, which might be one reason that it's doing just as well ;) So perhaps it would be better to keep this as a micro, and maybe develop the gun a bit. Of course, i'm still a bit new to robocode, so i might be giving bad advice. And thanks, your bot was responsible for helping Kitten to 14th place :D Spinnercat 17:47, 30 July 2009 (UTC)

@Spinnercat: Glad to help. And by the way, you are completely right. A nano wavesurfing implementation will probably never be strong at all, because it uses a ton of code(if you look at the code, my radar/gun are combined into 2 lines total) and it could never fit in the things that make wavesurfing strong. I'm trying to make a wavesurfing nano just to see if it can be done. You're also right about it being a lot more effective in micro land, I'm actually working on a SavantMicroWS with wavesurfing right now.

@Nat:I'm not really sure what you mean by bullet dodger, but I tend to think of a robot that moves a certain distance when the other robot fires. It's true that this robot's movement looks alot like it is doing that, but if you use the graphics version you can see what it is really doing--CrazyBassoonist 18:03, 30 July 2009 (UTC)

I'd certainly say this counts as a wave surfer. Not a strong one, nor a learning one, but it does appear to surf the waves in a limited capacity. A highly-imprecise flattener-only surfer is still a surfer, and that's what this is I'd say. By the way, your "Wave Tracking Voodoo" is nearly exactly the same as something I once had done myself to make a very small codesize bot to dodge pattern matching, it seemed to be kind of broken and I couldn't quite get it into nano size, but I suppose it technically surfed too. I should probably polish it and release it as a micro some time... :) --Rednaxela 20:33, 30 July 2009 (UTC)

Interesting. SavantWS could probably be changed into an extremely buggy version of that and still be a nano. All you would have to do would be to change the direction and location to move to randomly when a wave passes it instead of when it hits a wall or gets hit.--CrazyBassoonist 21:05, 30 July 2009 (UTC)

Hey, sure, I'll gladly share my thoughts. I only refrained before because I don't know much about AceSurf or SavantVS. Anyway, yes, I would certainly call this a Wave Surfer. The term "Wave Surfing" is kind of like "GuessFactor Targeting": it has a clear and simple meaning, but 90% of the time, things like Precise Prediction or Visit Count Stats come along with it, so people start to associate the term with all those other things, too. I can't really comment on whether it's the "first NanoBot Wave Surfer", though, just because I don't know much about AceSurf or SavantVS. You could always say something like, "it's arguably the first NanoBot Wave Surfer". =) Or just say that you think it is - no harm in that. Pretty cool, by the way! --Voidious 02:09, 31 July 2009 (UTC)

Thanks! If you look at the code, robots like SavantVS and AceSurf actually use no waves at all, so I think I'll call it the first if noone else has an objection:-)--CrazyBassoonist 02:46, 31 July 2009 (UTC)

Bad Results

For some reason, the new Acraepheus was doing well then started getting zeros. Is this the result of a bug with a different version of robocode, or bad results being uploaded?--CrazyBassoonist 22:01, 19 May 2009 (UTC)

By the way, I have 1.6.2--CrazyBassoonist 22:08, 19 May 2009 (UTC)

The results I'm running show your bot doing fairly well. Perhaps it is a client issue or something. --Miked0801 22:41, 19 May 2009 (UTC)
It appears the Voidious's server is the one giving you all the 0s. Perhaps you have an exception or something that only shows up in version 1.5.4? Dunno. --Miked0801 22:44, 19 May 2009 (UTC)

You're right, thank you very much for drawing that to my attention. Does anyone know of any issues like this that occur in 1.5.4 but not in other versions?--CrazyBassoonist 22:50, 19 May 2009 (UTC)

Argh, not sure what the problem is, but killed my clients for now. I'll add you to my exclude list before I start 'em again until we figure it out. --Voidious 23:00, 19 May 2009 (UTC)

Thanks. By now I'm guessing that what I need to do is figure out what is making errors in 1.5.4 and fix it then re-upload those versions. --CrazyBassoonist 23:06, 19 May 2009 (UTC)

Sorry, I was on my way out the door before. Here's the error being hit in 1.5.4:

Acraepheus 2.2 (1): Throwable: java.lang.NoSuchMethodError: oog.Acraepheus.getGraphics()Ljava/awt/Graphics2D;
java.lang.NoSuchMethodError: oog.Acraepheus.getGraphics()Ljava/awt/Graphics2D;
    at oog.Acraepheus.onScannedRobot(Acraepheus.java:75)
    at robocode.peer.robot.EventManager.onScannedRobot(Unknown Source)
    at robocode.peer.robot.EventManager.processEvents(Unknown Source)
    at robocode.peer.RobotPeer.tick(Unknown Source)
    at robocode.peer.RobotPeer.turnRadar(Unknown Source)
    at robocode._AdvancedRadiansRobot.turnRadarRightRadians(Unknown Source)
    at oog.Acraepheus.run(Acraepheus.java:71)
    at robocode.peer.RobotPeer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:619)

I don't mind updating my clients, but unfortunately, there's no guarantee someone else won't run 1.5.4 as long as it's still allowed...

--Voidious 23:52, 19 May 2009 (UTC)

And I believe that error would happen in 1.6.0 too, I had the same problem once, since then I always get the Graphics2D object out of the onPaint method only. --zyx 01:03, 20 May 2009 (UTC)

Well it looks like it's just a problem with the debugging graphics. Line 75 is this:

Graphics 2D g=getGraphics();

Shouldn't hurt that much to remove it, I probably should have left the debugging graphics out anyway.--CrazyBassoonist 00:32, 20 May 2009 (UTC)

I've now got it fixed, thanks for the help. How long does it take the rumble to remove robots that have been removed from the participants list? Even some of my very old robots seem to be there still--CrazyBassoonist 01:08, 20 May 2009 (UTC)

It's not a static delay, as far as I know it's just that it only allows removals from Darkcanuck's clients. That's usually within a day or so, in my experience. No need to wait on posting your new versions, though, at least if you ask me. =) --Voidious 01:17, 20 May 2009 (UTC)

Thanks, I was more concerned about the old versions being gigantic problembots for others due to the zeros. Is it normal to see scores that you can't replicate in tests? I've tried my robot against barracuda 1.0 about 20 times by now, and the lowest score I've recorded so far has been 42%. How could it have ended up with 32% against it in the roborumble?--CrazyBassoonist 01:42, 20 May 2009 (UTC)

Nope, and I also get incredibly frustrated when I see battle results that I can't duplicate locally. But there can be a surprising amount of variance in Robocode battles. --Voidious 01:49, 20 May 2009 (UTC)

Behold, the demon known as Standard Deviation - bane of all robocoders looking for consistant results :) --01:57, 20 May 2009 (UTC)

But wait a second.... I realize that that's within the realm of probability, but what about the 10% against pkkillers.PKassassin? I average around 50% on him in my own tests.... And acraepheus hasn't been doing too well against duelistMicro, but 3% is really pushing it=( Anyway, standard deviance or not, I must sleep now so I'll try to see what it is tomorrow--CrazyBassoonist 02:06, 20 May 2009 (UTC)

In both cases, the other bot only has a couple hundred bullet damage (way cool we can see that on Darkcanuck's server), which leads me to believe your bot must have errored out somehow... --Voidious 02:10, 20 May 2009 (UTC)


Okay... I downloaded 1.6.1.4, and I'm not getting any errors so far--CrazyBassoonist 21:01, 20 May 2009 (UTC)

Changes checking

I'm curious, how can you answer things so fast? I actually checking the recent changes every 10 minutes. But when I'm working, I may left it for hours without checking. Are you using RSS/Atom client which refresh every minute? » Nat | Talk » 13:51, 27 May 2009 (UTC)

Theres no secret to it, Its just that I often find myself checking the wiki while developing robots. There's not much to do when waiting for a thousand round melee battle to finish--CrazyBassoonist 13:55, 27 May 2009 (UTC)