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."
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.
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.
www.HearMySoulSpeak.com
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).
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.
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?