[Home]Requests

Robo Home | Changes | Preferences | AllPages

Ask any questions related to Robocode here and you will very probably have the question answered in a short while. -- PEZ
Has this page ever been used?(doing the random page jumping thing right now :-))--Dan

Yes, it has. I remember asking a question here shortly after finding this site. Look at the "view other revisions" link at the bottom. -- Tango

Old revisions get garbage collected every 14 days. However, this page has been used, yes. But we usually are quite good at moving questions and answers to the page where it belongs. (Or, create the page if it doesn't exist.). As you can see your question was indeed answered in a short while. =) -- PEZ

Oh yes, i forgot the 14 day thing... luckly our memories go back further than that, so we can be confident in our answers. :-) -- Tango

Is there any way to create a page like say MultiMode without first havign to namedrop it on another page?? I wanted to make that page but didn't really want to change any of teh other pages... --Brainfade

So you want to create an orphan page? That's generally not a good idea. But it's easy to do. Just enter the name of the non-existing page in the URL like any existing page and then edit it. Looks like so: http://robowiki.net/?NonExistingPage -- PEZ

You've just made a link to that page here, so it isn't an orpan, but you should find somewhere to list it. I'll take a look and see where it fits. -- Tango


Is it possible to remove the achived ranking tables from the random page link? If you're looking for something interesting to read to kill a few minutes, a ranking page doesn't really help. I don't know the system well enough to know if it's possible, but I thought it was worth asking. -- Tango

No, I don't think that would be any easy to achieve. Outside the system I guess would be easier. Maybe a script that can eat the "All Pages" list could do the trick. I'll give it a think. -- PEZ


My question is it possible to generate a random number within a certain range in Java? Yes, I know I am a newbie. Seeing as the only stupid questions are the ones never asked. I wanted to do something different, so I decided to do something I don't think I've seen before, a random pattern. That is to say, a set of patterns that after a set has completed it goes onto a random one because of the value of a variable. I know how it could work, but I don't know if it is possible. -- StereoRebirth

This is just a mathematical problem. Using Math.random() you can get doubles between 0 and 1. If you want numbers between min and max, then you start from min and then add (max - min) multiplied by Math.random():

 min + Math.random() * (max - min)
Do you see how this equation can be at the least min, and at the most max, as Math.random() ranges from 0 to 1? Hope this helps. -- nano

Thank you nano, I understand now, thank you for helping me. I'm new to java, but it is close enough to basic that I didn't have much trouble learning the basics. Again, thanks. I didn't know what the random function was. Once more, thank you. -- StereoRebirth

Three times ought to be enough. Welcome to the wiki! Introduce yourself here: StereoRebirth. By the way, since your screen name has a capital in the middle of it, you don't need to do the double angle brackets around your name, the wiki will automatically link to your page. :-) --David Alves


The problem bot index would be more useful if it were (rating difference from scores - current rating difference) rather than (predicted % - actual %).

Currently a bot that you lose to 35%-65% when you're expected to win 55%-45% will have the same problem bot index as one that you beat 75%-25% when you're expected to beat it 95% - 5%, since both have a difference of 20%. However the latter will damage your rating more. My method of calculating PBI gives the first bot an index of (-165.3) - 53.59 = -218.89 while the second one gets a PBI of (-786.3) - (-293.4) = -492.9

--David Alves

It's the old S-curve problem again, isn't it? I can see what you're saying, but I'm sure PEZ will complain that it's even more voodoo, and he would have a point. Prehaps we could have both? -- Tango

Nah. We already live with the rating points. I'd say that if David's suggestion gives me a better indication on what bots are dragging me down I'll definately put my vote there. That's the stuff I always wonder about! -- PEZ

Here's a more concrete example. Take Aristocles 0.2.2. Using the current problem bot indices, you'd might think that csm.[NthGeneration 0]?.04 (PBI: -21.6) was hurting its rating slightly more than ch.rhj.rbc.RHJ1_1.0 (PBI: -20.2). However, the real picture is a little different... the RHJ1 score is hurting its rating much more than NthGeneration? score. Against RHJ1 you have a rating difference from the scores of 250.9, and a current rating difference 659.6. Using my method of calculating PBI, 250.9 - 659.6 gives -408.7. Against NthGeneration? you have a rating difference from the scores of -115.0, and a current rating difference of 119.5. Using my method of calculating PBI, (-115.0) - 119.5 = -234.5. In summary, even though the current Problem Bot Index lists NthGeneration? as a bigger problem, your rating is being damaged a *lot* more by RHJ1. --David Alves

Sounds like a good update. Another thing which I've been hankering after recently is the ability to compare the results or PBIs for two different bots, e.g. the current and last version of your bot, for when you can't work out why the heck you dropped 3 points. ;-) -- Jamougha

I'm in favour of both the proposed ideas, but what would we do with the specialisation index? Would we calculate it the same way, just using the new PBIs? That would probably work... -- Tango

@Tango Yep, that would work. Specialization index would become more accurate too. Rammers would have *massive* specialization indices.

@Jam Be wary of PBIs vs. bots that you're supposed to beat by a lot. As the predicted % difference approaches 100%, even a small PBI will become enormously damaging to your rating. In your case, RaikoMX's rating is probably being dragged down the most by bvh.hdr.Hodur_0.3. Current rating difference: 682.7, rating difference from scores: 408.6. Dave's PBI: -274.1 I think you'll find that it's lowering your rating much more abc.Tron_2.02, amz.[NanoDeath 2]?.1, dam.[MogBot 2]?.9 or zen.Lindada_0.2, all of which appear to be bigger ProblemBots using the current PBI. --David Alves

You may well be right... it really feels crazy that getting to the top is about optimizing the heck out of your scores against the low ranked bots, but at least a new PBI would make doing it systematic. -- Jamougha

I still don't really understand the ELO system. How easy would it be to modify the system so we can see how the rating is calculated (ie. you add a kind of PBI for each bot together, add 1600, and you have the rating)? It would be good to be able to see exactly where your points are coming from. -- Tango

I think this is a step towards making the ratings more understandable. What this method of calculating PBIs means is that if you threw out the results from all other bots, your rating would be that much higher or lower. bvh.hdr.Hodur_0.3 has a Dave's PBI of -274.1 for RaikoMX 0.24, so if you calculated RaikoMX's rating ONLY using the data vs. bvh.hdr.Hodur_0.3, RaikoMX's rating would be 274.1 rating points lower! I think that's about as clear as a PBI can be. :-) --David Alves

Is that an approximate thing, or is that exactly how it works? If it is, then that's very informative. -- Tango

That's exactly how it works. Edited above posts to make the method clearer. :-) --David Alves

If you're using MinimumRiskMovement, does anyone have an idea what the most commonly called getXXX() function(s) is? Not that i really need it, just out of curiousity... --Starrynte

Strange question :/ My Movement uses getX() and getY() three times per tick... --Krabb

It's a strange question because it's implementation-dependent :-) If I didn't store my current position globally beforehand, I could totally see getX() and getY() being called around 10000 per tick in Coriantumr. As it is, I'm guessing getEnergy() and getOthers() are the most often called bits in Coriantumr and Shiz's movements (Coriantumr might not actually call getEnergy in movement code, though).

Ok, I am not good at recognizing abbreviations.
PM=PatternMatching
HOT=HeadOnTargeting
.
.
What does AM mean (in terms robocode of course, it means ante meridiem in terms of time, amplitude modulation in terms of radio)?
--Starrynte

Context? Perhaps AntiGravityMovement? I noticed someone referring to "MR movement" the other day on here, and it took me a minute to realize it referred to MinimumRiskMovement (which is a term I think I made up). -- Kawigi

I thought AM usually meant AdaptiveMovement, but yeah, it probably depends on the context. -- Voidious

I was looking around in the API and i saw class Rules. How would you call the methods in Rules(not that you need to, you could just hardcode the calculations)? --Starrynte

Using Rules, is actually smaller then most hard-coded calcuations, however, its also unsupported by a number of roborumble clients as I think it was added in robocode 1.1.3. Just do

Rules.<name of function here>

like so
double bulletPower = 3.0;
double bulletSpeed = Rules.getBulletSpeed(bulletPower);

bulletSpeed would now be equal to 11

--Chase-san

Ok thnx...I have another question! If you call waitFor(<a condition>); and you don't call execute(); after that, will the bot get disabled because it made too many setXXX() calls? --Starrynte

Sounds unlikely, I think waitFor() calls execute(). -- Kawigi

Hem, nevermind, I don't have a problem with what I was talking about. I would perfer if none raided my math until I get everything sorted out. --Chase-san

I have a question, I was looking at both DT and Shadow, probably the two most difficult to defeat robots in all time. I noticed they both have classes such as a, o, i, e, etc. Instead of other construction types. What is this codestyle? --Chase-san

That is obfuscated code, to prevent the decompiling of .class files. -- ABC

Isn't that just a little paranoid? I didn't think it was "that" completetive around here. --Chase-san

Yes, it's a little paranoid, but it's also true that people can easily decompile Java bytecode if they wish. It's also pretty easy to setup the obfuscation. I know David Alves does (or did) the same. He's got his compiler setup with the obfuscator and it happens automatically whenever he packages a new version. -- Voidious

My bot is closed source itself, however I'm not so paranoid as to obfuscate it. If someone really wants my code that bad they can just ask and probably recieve. (mind you, my bot also isn't as super as Shadow) --Chase-san

Yes, it's paranoid. I started using it on the first version of Shadow using WaveSurfing to try to force people to figure it out by themselves instead of just copying it. It worked, it didn't take Jamougha long to code his own version and open-sourcing it for everybody else :). Another thing that made me do it was when a bot appeared in the IBM Robocode competition (a long long time ago :)) that dethroned Tron in the melee competition. It turned out it was a decompiled version of Tron with some very small changes, like variable names, etc. Anyway, I don't like obfuscation, I just got used to using it. I would gladly share Shadow's source with anyone that asks for it with good intentions, I just think it's a bad way to learn about it, every single bit of Shadow's code is explained in this wiki. --- ABC

I am also as dense as a tree stump, it takes a multitude of questions for me to even understand the simplest of things. I dislike copying anybodies work, it is cheating. This however hasn't stopped me from studying bots from Wolverine, Frederick(my sisters bot) to the Raiko's, Chalk, and Dookious to pick up ideas on structure, implimentation and simular. The way I do things are my own and the only bots I have ever released that are based on other robots directly have either been wiki robots, or open source. After you mentioned that tron3 wiggled while it moved, I figured such would make it harder to predict so I figured out a way to do it and did it (it uses logic to head near or away from a best distance, but never directly on the mark, making it wiggle). I'm sure Voidious, DavidAlves and the like are tired of my endless questions. --Chase-san


I don't know if this is the right place to ask this, but could we have the country flags in the rumble have pop-up text saying which country they represent? (For the politically inept, like myself) -- Simonton

Rather complex css/javascripting there, i'm not sure as such doesn't always work the same on all the browsers. --Chase-san

If you just made it the "alt text" of the image, I think it would show up as a Tooltip when you hover the mouse over it in most browsers. -- Voidious


Is Math.abs(x); equal to Math.sqrt(x*x);? --Starrynte

Yep, but the first will process significantly faster I reckon. -- Voidious


Speaking of which, in the predictPosition code of the basic surfer wouldn't that be smaller (and faster) as or better yet (if your going for size maybe)

--Chase-san

Well, I'd rather leave the BasicSurfer code erring on the side of clarity over CodeSize, but yes, you probably could in your own bot. There's also a Rules.* method that you can use in newer Robocode versions. -- Voidious

Well actually, if you look more closely at the code you will notice it is clearer, and is the code used in the Rules files of the newer Robotcode, generally PI/180 is the basic conversion for degrees to radians (or 2*PI/360). So I personally don't see the problem with my code, but I did with the basic code. Which is why I posted this. --Chase-san

Actually, good point. I misread your code and thought "wouldn't that be smaller" referred to CodeSize, but I now see that it should be the same CodeSize both (of the first two) ways, I think. Feel free to change it. :) -- Voidious


When I battle 2 teams (not my current one) together, it's normal. Then when I start a new battle while it's battling, i get a
Exception in thread "Thread-8" java.lang.NullPointerException
        at robocode.peer.robot.RobotClassManager.<init>(Unknown Source)
        at robocode.manager.BattleManager.startNewBattle(Unknown Source)
        at robocode.dialog.NewBattleDialog$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
so then I stop the battle and start a new one with my team i get a
Exception in thread "Thread-10" java.lang.NullPointerException
        at robocode.peer.robot.RobotClassManager.<init>(Unknown Source)
        at robocode.manager.BattleManager.startNewBattle(Unknown Source)
        at robocode.dialog.NewBattleDialog$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
And, if i start directly with my team in a battle, i get a
Exception in thread "Thread-4" java.lang.NullPointerException
        at robocode.peer.robot.RobotClassManager.<init>(Unknown Source)
        at robocode.manager.BattleManager.startNewBattle(Unknown Source)
        at robocode.dialog.NewBattleDialog$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Without teams and just bots it works fine. Help? (version 1.2.3A) --Starrynte

nvm it works now --Starrynte

Just curious, would it save time to do

enemyX = getX() + Math.sin(getHeadingRadians() + e.getBearingRadians()) * e.getDistance();
enemyY = enemyX / Math.tan(getHeadingRadians() + e.getBearingRadians())
rather than
enemyX = getX() + Math.sin(getHeadingRadians() + e.getBearingRadians()) * e.getDistance();
enemyY = getY() + Math.cos(getHeadingRadians() + e.getBearingRadians()) * e.getDistance();
? --Starrynte

Well, I don't know if it would be any faster, however it would give a nice division by 0 issue whenever the enemy is directly north, south, east, or west, as that is 0 degrees, 90 degrees, 180 degrees, and 270 degrees, and the tangent of all of those is either 0 or undefined. -- Rednaxela

Another quick question: Why is it that when you ram a bot, you sometimes don't receive a RobotDeathEvent?? Do you need to set the event priority or something? --Starrynte

(yet another) Quick question: is

if(number*number<=position.distanceSq(myLocation))
any faster than
if(number<=position.distance(myLocation))
? --Starrynte

How do you compile code that has generics? I tried it, and the compiler gave me an error that said

*** Semantic Error: Using type arguments to access generic types requires the use of "-source 1.5" or greater. Compilation will continue using the raw type "java.util.ArrayList", but no class file will be emitted.(not yet implemented)
So I added "-source 1.5" to the preferences, but now it says
Error: "-source" only recognizes Java releases 1.3 (JLS 2 features) and 1.4 (assert statement).
Help? (I think I have jikes 1.22, and java 1.6) --Starrynte

I think jikes doesn't compile 1.5 code. You'll have to use javac.


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited April 10, 2008 11:08 EST by ABC (diff)
Search: