Slashdot Mirror


Robocode Rumble: Tips From the Champs

Jason writes "The Robocode Rumble is over and the winners have been declared. Who are they and what are the secrets of their success? Dana Barrow talks shop with some of the mad scientists behind the winning Javabots and with Mat Nelson, who reveals what he has planned for Robocode 2.0. You can get the free download here."

37 of 129 comments (clear)

  1. Robocode's Rival by FortKnox · · Score: 4, Informative

    Robocode is great. Its a neat exercise to get people intersted in OOP and Java.

    Being a Java programmer, I've also looked at C# and seen what MS did to improve the language (lets face it, C# took the good things of Java, and fixed the bad things in Java).

    The C# version of robocode?
    Terrarium, and damn is it fun (I just wish you could change the stats of your offspring to 'adapt' instead of/in addition to just passing off AI)!

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    1. Re:Robocode's Rival by Tablizer · · Score: 2, Troll

      (* Too bad that good OOP and Java are mutually exclusive. *)

      Everybody and their dog have a different opinion on what "good OOP" is [1]. You will start a huge flamewar by bringing up that. No doubt Smalltalk fans will jump in saying that Smalltalk is the only "true" OO. Then Eiffle fans.....

      [1] This relates to one of the problems with OOP in my opinion: lack of consistency in design methodologies. (oop.ismad.com)

    2. Re:Robocode's Rival by dmorin · · Score: 3, Interesting

      Say what we want about java's failure to do true "write once, run anywhere", but MS has its own version of that. I tried to run Terrarium on my NT box and couldn't do it because I can't get the most recent DirectX. So there. That never happens with Java. Don't ask why my office machine is NT. I don't want to talk about it.

  2. Similar skillsets by Tablizer · · Score: 3, Funny

    The Robocode Rumble is over and the winners have been declared. Who are they and what are the secrets of their success?

    When the slashdotting slows, I expect something like:

    Champ: "Well, I write a lot of viruses. The skillsets are very similar actually. You set it loose and it needs self-contained smarts to destroy anything and everything without getting caught or stopped."

    1. Re:Similar skillsets by Tablizer · · Score: 2

      (* Viruses are never that complex......it's very rare you'll find one that contains even basic AI *)

      Curious why not. There are many K viri out there, and none have AI-like intelligence in them?

      Is this due to size constraints, or are *all* virus writers dull?

      (* Robocode 'bots aren't self-replicating. *)

      I did not mean to imply that they were. Just because it may share many features with viri does not mean it shares all.

    2. Re:Similar skillsets by Hard_Code · · Score: 2

      Some viruses are actually very interesting. There are ones which are polymorphic, which introduce variations in themselves when they replicate. There are even types which start out as a population with randomized payload pieces, and they come together to "mate" and their payloads match up in some unique way. Some are cooperative, and coordinating over the network. Very interesting.

      --

      It's 10 PM. Do you know if you're un-American?
    3. Re:Similar skillsets by Kintanon · · Score: 2

      I always thought the idea of info gathering viruses would be an interesting one. Instead of going out and hosing peoples machines they would scan the systems for promising keyword files and then snag the file and try to get it back to the virus originator (indirectly of course, not just e-mailing it back or something stupid). If someone dumped a bunch of those into the wild they could harvest all kinds of great corporate and personal info!

      Kintanon

      --
      Check out JoshJitsu.info for Brazilian Ji
    4. Re:Similar skillsets by Hast · · Score: 2

      There was one virus which updated itself through encrypted packages distributed on Usenet. That's a pretty neat idea.

      But most just use tried and tested methods. Not very high-tech perhaps, but it works.

      Also if you increase the complexity of the virus it gets easier to detect. Both since size increase and since you are more likely to have easy to detect thumb prints of op sequences.

      But most virus writers are probably quite inexperienced, so they are not going to do really neat stuff. (Or those that do don't get detected. ;-)

  3. Robot Battle by Anonymous Coward · · Score: 2, Informative

    I'm sorry, but some things seem to be VERY similar to Robot Battle, a pretty old game with the same concept: www.robotbattle.com

    Not trying to troll.. just wanted to point out.

  4. I tried this... by Bobulusman · · Score: 2, Interesting

    I don't have a lot of java experience, but I tried this to try to get that experience. Unfortunately, no matter what cool stuff I put in my bot, the tutorial bots beat it on a regular basis. :(

    I think one of the problems was that the way I wrote it, it could fire more shots than average. Unfortunately, you lose a bit of energy with every shot, so all my missed shots led to my bot typically just shooting until a single shot by an opponent killed it. D'oh

    --
    Cogito ergo sum in Slashdot.
    1. Re: I tried this... by Antity · · Score: 2

      I didn't know much about Java and all, and I found the API descriptions in this contest rather lousy. But I tried to write a really simple bot (Ashley) within a few hours and submitted it two months ago. Didn't touch it after. (so everyone below my rank had about 2 months of time to optimize against my bot's play.)

      Well, this really dumb code scored rank 84 in Intermediate. How many people took part in this contest again?

      As I understand it, the best 100 in every class took part in the final fights, so I think many people had a quite good chance to get a nice rank if even my "junk bot" managed 84. :-)

      --
      42. Easy. What is 32 + 8 + 2?
  5. something similar - MelBotWars by theoramus · · Score: 4, Informative

    There's a similar AI robotic combat program Tech tv did a story on called MelBotWars.
    It's basically a plugin for maya which uses the MEL(Maya Embedded Language) programming language for coding your bot's AI, and uses the rigidBody dynamics in Maya for the physics.
    Also, take note that you only need the Maya personal learning edition to use it, which is free.

    1. Re:something similar - MelBotWars by unicron · · Score: 2

      About $5,000 dollars, I think.

      --
      Finally, math books without any of that base 6 crap in them.
    2. Re:something similar - MelBotWars by Chundra · · Score: 2

      Nope. It's now $1999 for maya complete. The biggest differences are that the file formats between the two versions are completely incompatible, and the personal learning edition has these really annoying overlays on just about everything. Otherwise the PLE version is kickass, and successfully lets people learn how to use maya without warezing it.

  6. genetically generated code? by ceswiedler · · Score: 4, Interesting

    Why not do it genetically? I'm not an expert on the subject, but the way I've always thought is that it's clearly possible to "breed" programs to do a particular task, as long as the task is very "ratable", i.e., you have a separate algorithm which will evaluate how well the program did. In this case, the "arena" program which pits the bots against each other serves very well. Generate random Java bytecode, run it as a bot, look at the points scored. Breed well-performing bots with each other by combining bytecode together in various fashions. Repeat several billion times...

    Obviously, the first N iterations wouldn't be syntactically correct bytecode (though I would suggest that you hard-code the 0xCAFEBABE prefix) and would probably throw exceptions almost immediately (resulting in disqualification). Eventually, however, you'd get a program which would at least not produce errors, even if it did nothing productive like moving and shooting.

    What's the best way to combine two bytecode programs to produce offspring which are similar-yet-different, and have the best chance of doing well? You would obviously want a chance of mutation (possibly reducing over time).

    1. Re: genetically generated code? by Antity · · Score: 2, Insightful

      I don't think Java would be a good platform for evolutional programming in bytecode. The test cycles are just too long with Java.

      Think you breed 16 or 50 childs every iteration and have to test them for success/failure, each of them. IMHO this is just too slow with Java. I doubt you'd have got a bot doing more than stand around without throwing exceptions within the contest time...

      --
      42. Easy. What is 32 + 8 + 2?
    2. Re: genetically generated code? by FortKnox · · Score: 3, Interesting

      I don't think the issue is with 'Java' as much as it is with 'Robocode'. Robocode does its battles graphically. To really get a good genetic AI going, you want it all done in memory so you can whip through a ton ov evolutionary steps ASAP.

      A good friend of mine did a genetic algorithm problem as a senior design project in school. It was REALLY cool (but was not done graphically).

      Perhaps if you modified Robocode itself to have a 'memory' mode, then after a buncha evolutionary steps, bring the latest one in for a graphical battle?

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    3. Re: genetically generated code? by Pentagram · · Score: 3, Informative

      I assume the orginal poster meant to evolve programs before the contest. This is difficult though; what measure are you going to use to select the best robots? The sample ones? Your other generated robots? I don't think a genetic approach like this would work very well. I imagine there must be quite a bit of psychology in programming these robots - a robot that is devastating against one robot is likely to be very susceptible against the tactics of another. How do you avoid the rock-paper-scissors vulnerability?

      And evolving the bytecode would be hard. Much easier to use a higher level evolving system. You could constrain the programs you generate to a certain grammar at least to eliminate your problem of evolving syntactically-incorrect programs.

      There have been successful GP systems evolving programs at the machine code level, but none that I'm aware of based on Java bytecode.

      An idea that occurs to me: maybe you could use a simple GA system with a small number of parameters (gun fire rate, shot power, attraction to certain corners etc.) and try and measure your opponents' values for these (maybe hard, I forget how much information you have access to in the game) and try and combine the parameters of the best robots in your tournament. This might take a lot of rounds though before you found the best combination. Or if you were allowed to enter several robots and have them swap genetic material at the end of a round.

      I've played with the system, and it's a lot of fun. Especially if you can get a few friends to enter robots.

    4. Re: genetically generated code? by Pentagram · · Score: 2

      Have a look at the comp.ai.genetic faq.

    5. Re: genetically generated code? by FortKnox · · Score: 2, Interesting

      Geez, it was years ago, but he's an open-source type of guy (actually he introduced me to /. and has a lower UID than me). I'll email him and see if he'll release the whole project out so you can read it.

      I know it was a game where two bots fought one another... it was a linux game (something to do with hacking memory? I never played it, so I can't remember the name). Anyway, IIRC, he pitted two different bots together and fought them. Each bot had 5 chances to win before becoming removed... once removed, it was genetically altered 1 line, then reintroduced.

      He graphed all their behavior (in gnu-plot) and there was VERY noticable steps when one made a genetic breakthrough. He let it run on his machine for months, and I think the end result even beat him using the most obscure technique you could think of (which, IMHO, is the coolest part of genetic AI. It comes up with ways to win that normal people wouldn't even think of).

      Anyway, my name is Josh Marotti, so email me at <firstname>@<lastname>.com, and I'll get back to you on it.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    6. Re: genetically generated code? by Slak · · Score: 3, Informative

      This is possible. Robocode does *not* need to run with graphics and in fact has a whole API to control battles. I've done some of it with BeanShell. And there is RoboLeague software which does the same thing. Combined with the ability to write to the filesystem, and you can store result values. I believe the JollyNinja bot determined sundry parameters this way, though most of the algorithms were designed and implemented by the biological agent known as Simon Parker.

      Regards,
      Slak

    7. Re: genetically generated code? by Aexia · · Score: 2

      You could do it by starting with 100 bots. Sort by win/loss ratio. Take the top 50 bots and breed them with each other one in some fashion. That gives you 2500 bots.

      Now we need to filter those down. That's where a pool of control bots come in. Require new offspring to beat them, possibly within a time limit

      Level 1 - Opponent just sits there.
      Level 2 - Opponent sits there and fires in different directions.
      Level 3 - Opponent moves in a pattern while firing.
      Level 4 - Opponent moves in a pattern and always fires in the direction of bot.
      Level 5 - Opponent chases bot and fires regularly.

      Anyone who can't beat these bots in one try is eliminated. That should get you down to a manageable pool. If you have more than 50, use the time taken to beat the control bots as a tiebreaker. If you have less than 50... well, nature isn't looking at your species too kindly.

      Your new pool consists of the 50 "parents" + the 50 "children". In order to continue, the children have to best each other *and* their parents. Repeat as many times as possible.

      Get a checksum from each bot and maybe someway to track parentage and see who's dominating. This should hopefully avoid compeltely stupid robots and robots that are really good at killing their stupid offspring but nothing else.

    8. Re:genetically generated code? by Hast · · Score: 4, Informative

      You wouldn't get results in this millenium if you did that. First of you want to make sure that you only generate valid code, and from what I've heard bytecode is a bit of a bitch to do by hand so generating java files which you compile is probably a better idea. (Or just use parameters which you tweak, that is the usual way of doing genetic programming.)

      You need to feed the generator with a lot of domain info too, otherwise it will just produce garbage. (Even if it is compilable garbage.)

      If you are interested in this stuff check genetic-programming.org.

      I know that some guy used genetic programming to generate bots for Quake1. They were really stupid though. (He had a sort of blog where he told what had happened lately.) He got bots which would kill you right away if you circle strafed to the left. If you circle strafed to the right they would be completely lost. It's fun but not very usable.

    9. Re: genetically generated code? by Saeger · · Score: 2
      I remember watching some amazing MPEG video of work that Thinking Machines Corp did in the early nineties (before they under). The video depicted artificially evolved creatures swimming/flying/walking/flopping/etc in a somewhat granular 3D space. It was jawdropping, even now.

      Anyone still doing work along these lines?

      --

      --
      Power to the Peaceful
    10. Re:genetically generated code? by kiwimate · · Score: 2

      When I was at university, I learned about an A.I. system which generated "concepts". It started with a base set of rules (say, for mathemetics, addition, subtraction, and so on), and generated new rules, or "concepts". Those were then rated by human experts and used to generate further concepts and determine a relevance ranking.

      This was many moons ago, so I don't remember many details. But one of the most interesting points I do remember was that the generated concepts had a very high usefulness index to start with, but became progressively less and less useful. This was intriguing; you'd imagine that using a base of complex and affirmed concepts would lead to more complex and subsequently useful concepts as the system learned what garnered a high approval ranking from the human experts.

      Mind you, it wasn't perfect. Amongst the cuter generated concepts was a parasitic concept. It didn't generate new concepts itself; it waited until a new concept had been generated and then attached its name to that new concept and claimed it had been the generator.

      Another concept decided that any concepts generated by the system were automatically useless and must therefore be immediately deleted. Funnily enough, the very first concept it deleted was itself. So much for "artificial intelligence".

    11. Re: genetically generated code? by John+Harrison · · Score: 2

      The bots profiled in the article all have source availible. Make your bots compete against those bots that are known to be good. You could even start by stealing some tricks from the champion bots.

  7. Re:Java slow by Procyon101 · · Score: 2, Interesting

    Your generalizing too much here. There are many types of AI, and many languages to do them in. Each language is an abstraction of the problem space you are working in, so rather than making a blanket statement about a good language for AI, you should pair up the AI your talking about with a preferred language.

    1) Genetic algorithms are probably in the category you are talkng about. Good ones take massive processor power to come up with. Once they are done though, the end result is generally small and fast. This type of AI is usefull fr finding a near optimal solution in a complex but static problem space, ie What is the best wing design for this airplane. C, C++, Assembly are typically good languages.

    2) Neural networks. These can take up alot of processing power, or not, depending on their complexity. There is a rather large family of these also, existing in both asynchronous and synchronous forms. These are used to pattern match and generalize. Good for things like handwriting recognition. C++, Java are pretty good languages.

    3) Pattern matching knowledge databases. These are good at cross referencing data by finding subtle patterns in it. The construction of the database and pattern finding is intensive, but use typically is not. Lisp, Java, SQL, Perl can be good here.

    4) Expert systems. Used to categorize information for retrieval based on a information given by the user. Not at all processor intensive. Lisp, java good for this.

    5) State machines. This is where our Robocode fits in. Very object like, I can hardly think of a better language than Java for it's simplicity. These are not very processor intensive. C++, or C# might be good candidates.

    6) High level applied systems, lumping in natural language processing, vision recognition, etc.. These are generally heavy duty specialized systems that can be very data and processor intensive. C++ is a good general purpose choice for these, but each needs to be looked at individually.

  8. Re: RealTimeBattle by Antity · · Score: 3, Interesting

    RealTimeBattle is cool. BTW, you can write your Bots in any language since communication is done using stdio.

    I wrote a bot for RealTimeBattle once ("Defensive Attack" - funny that this beast is still available) and found it to be real fun. I was a bit distracted that for the IBM project you could only use Java. With new experiments like this, I like to be able to use the language I'm best in.

    --
    42. Easy. What is 32 + 8 + 2?
  9. Book Suggestions by Lechter · · Score: 2
    Since we're on the topic of AI/genetic/emergent algorithms. Could anyone suggest any good practical introductory books on these topics? (With some code to look at rather than abstract predictions on how "x" will save human civilization)

    This is a topic I've been interested in for a while, but I've yet to see any good information to start me off...

    --
    credo quia absurdum
    1. Re:Book Suggestions by Hast · · Score: 2

      I've used "Artificial Intelligence:A modern approach" by Russel/Norwig in a class on applied AI. It's pretty good and talks about a lot of different topics. The edition I have had a lot on logic and stuff like that too, so it may be a bit theoretical if you just want to get your hands dirty.

      For that I'd recommend searching the web. Lot's of AI stuff out there.

  10. Re:how about a 3D robocode. by Joseph+Vigneau · · Score: 2

    Java3D actually uses OpenGL (or DirectX) as the underlying rendering layer on many platforms. See here...

  11. I can beat that... by Black+Perl · · Score: 2

    I used to code robots for RoboWar (for the Mac) in the early 90's. It was great fun. It's so old you need the wayback machine to see a page:
    RoboWar

    --
    bp
  12. Creator's thoughts by jcsehak · · Score: 2

    Rumblecode creator Mat Nelson: "Today, Java is fast, though many people still do not realize it. Computer speed has increased at an amazing rate, JVMs are faster than ever, Java has matured, and we even have hardware-accelerated graphics. Java is ready for the client now, and I hope Robocode can help to prove it."

    --

    c-hack.com |
  13. Fermat's Info by Kuts · · Score: 2

    Hi

    If anyone's interested, here is a description of Fermat's movement algorithm described more clearly along with other silly questions. This is the original set of answers I submitted to them.

    And if you're even more interested, visit Robocode Repository for all the test bots and related information you will ever need.

    Arun Kishore
    [about to sleep...]

  14. CORE WARS - 1984 by mekkab · · Score: 2

    blah blah blah, blah blah blah blah.

    CORE WARS, devised in the 60's, played in the mid 80's, this was what you did!

    Now the sadness: I had both corewars and robo war for my mac plus. Guess which one I wrote bots for? That's right! NEITHER.

    Is there anything worse than a lazy geek?!

    --
    In the future, I would want to not be isolated from my friends in the Space Station.
    1. Re:CORE WARS - 1984 by osolemirnix · · Score: 2
      Well, no need to write corewars robots. While graphically less exiting than robocode, core wars redcode pseudo-assembler is a lot easier to improve via genetic algorithms than robocode.

      So instead of seti@home, just run that as a screensaver and you should have a decent core wars bot in a couple of months. Many good bots to pit him against for evolution too.
      :-)

      The ongoing King Of The Hill tournament showed signs of a fractal pattern though, imho. Certain strategies would be good and certain would be bad against others. So after a while there was kind of a repeating circle of strategies, like a paper, scissors, stone game.
      Now it would be interesting to know how robocode differs in that aspect?

      --

      Idempotent operation: Like MS software, wether you run it once or often, that doesn't make it any better.
  15. Re: RealTimeBattle by jsse · · Score: 2

    Just fyi.

    The orignal Robbocode was intented to help people learn Java by tinkering your own robot (in Java Class) to fight the others robots running by the computers. The sole purpose is to help people learn Java.

    May be inspired by the other online combat projects I don't know, but people soon find it to be more fun to fight online, thus Robocode Rumble was born.

    The purpose of Robocode and Robcode Rumble is to encourage people to learn and use Java. You might wonder why it's by IBM not SUN. In case you don't realize, the biggest employer of Java on earth is not SUN, but IBM. :)