Robocode Rumble: Tips From the Champs 129
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."
Robocode's Rival (Score:4, Informative)
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 [gotdotnet.com], 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)!
Re:Robocode's Rival (Score:3, Interesting)
Re:Robocode's Rival (Score:1)
I'm a J2EE consultant by trade.
I just find terrarium more fun than robocode.
If I had the time, I'd write a nice project to rival it in Java.
Re:Robocode's Rival (Score:1)
The Java alternative, JXTA (at jxta.org) handles this with the notion of http peers. Java has a surprising number of thriving open source projects (JBoss, Ant, JXTA, Tomcat, Jetty, etc.).
And then you have just plain fun events like this Robocode.
Re:Robocode's Rival (Score:2, Troll)
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)
Re:than what? (Score:1, Troll)
Anything. The literature often brags about how OO improves stuff, makes maintenance allegedly easier, etc. You tell me what they are comparing. I did not write all that.
I generally compare it to procedural with liberal usage of a database. Databases and OOP tend to fight over territory. In procedural/relational the "noun model" is mostly in the database or reduced to relational formulas. In OOP the noun model is mostly via code structure. Databases are overall superior IMO than code for managing noun models and noun-related structuring. At least for me. Databases are more powerful than code when things scale or change. In summary:
OOP:
tasks: In code
noun model: Via code structures
P/R:
tasks: In code
noun model: Via relational database and formulas
BTW, I never compared them WRT robot games. However, the literature implies that OOP is for every domain.
Others? (Score:1)
Starcraft clone? What about Freecraft? (Score:1)
Re:Others? (Score:1)
Terrarium [gotdotnet.com] is an AI programming game where developers write herbivorous and carnivorous bugs (and plants) in any .NET language, then let them try to survive in a P2P "terrarium" of other bugs and plants. Microsoft holds periodic contests (US contests and International contests) for Terrarium bugs, and there seems to be a fairly active community around the whole thing. And the best part is that you're learning .NET, while at the same time having fun.
Re:Others? (Score:1)
Re:Others? boson looks promising? (Score:1)
Freecraft are advertising for some much needed artists to help them, but look good otherwise.
--
If you laid all the MicroSoft users in the world end to end around the equator, 2/3 of them would drown.
Similar skillsets (Score:3, Funny)
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."
Re:Similar skillsets (Score:2)
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.
Re:Similar skillsets (Score:2)
Re:Similar skillsets (Score:1)
1) Most of the times, some of the best strategies are simple ones. More complex better ones may exist, but they are not generally worth the trouble. I once saw a long run of a genetic state machine prisoner's dillema solver. Although some very interesting complex strategies came up after VERY long run times, the tit-for-tat strategy, which is one of the simplest, dominated most of the run.
2) I used to be interested in viri writing and the like when I was 12-14 and a mediocre coder. Once I got good at what I did, I realized that constructive tasks are much more rewarding then destructive. I assume it is probably like this with most coders. People who want to cause havok don't have the patience to build complex systems typically, and builders of complex systems don't want to rip others hard work apart because we have more respect for it.
Re:Similar skillsets (Score:2)
Kintanon
Re:Similar skillsets (Score:2)
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.
Robot Battle (Score:2, Informative)
Not trying to troll.. just wanted to point out.
I can beat that... (Score:2)
RoboWar [archive.org]
CORE WARS - 1984 (Score:2)
CORE WARS [mcraeclan.com], 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?!
Re:CORE WARS - 1984 (Score:2)
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 [koth.org] 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?
Re:Java slow (Score:1, Troll)
Java
seems
fast
to
me.
Really.
Sincerely, Shellon Turtlebum
Re:Java slow (Score:1)
I really hate how everyone keeps saying that Java is slow.
C++ is faster, but not by much. Several years ago, Java was slower than dirt. You had a right to complain, then. Since then, most people won't even try it, believing its still that 'slow old Java'. The speed difference between the newest version of Java and C++ is negligable on modern technology.
And AI doesn't depend on each clock cycle to be effective. Especially when every cycle is even in robocode.
Re:Java slow (Score:1)
Your statement that C++ will always run faster than Java clearly is based on hearsay, not experience. Ignorant coding will make any language slow. I've seen unoptimized java code run faster than C++ equivalents. Why? Because the VM can profile the code while running and recompile on the fly, unlike statically compiled C++. A statically compiled program will never know if loops are long or short and cannot unroll them to greatest advantage.
Re:Java slow (Score:2, Interesting)
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.
Creator's thoughts (Score:2)
I tried this... (Score:2, Interesting)
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
Re: I tried this... (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 [ibm.com]) 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 [ibm.com]. 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. :-)
/.ed IBM (Score:1, Offtopic)
something similar - MelBotWars (Score:4, Informative)
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.
Re:something similar - MelBotWars (Score:2)
Re:something similar - MelBotWars (Score:2)
Re:something similar - MelBotWars (Score:1)
Still... A more expensive tool won't make you a better artist.
--
Re:Everyone's offtopic, I'll join too! (Score:1, Funny)
genetically generated code? (Score:4, Interesting)
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).
Re: genetically generated code? (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...
Re: genetically generated code? (Score:3, Interesting)
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?
Re: genetically generated code? (Score:1)
Are you allowed to give more details? Stuff like that is always fascinating.
Re: genetically generated code? (Score:2)
Re: genetically generated code? (Score:2, Interesting)
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.
[OT] inventiveness of EC (Score:1)
On that note, I can't help but mention this story [newscientist.com].
Re: genetically generated code? (Score:1)
there are plenty of places to find info on this on the internet. one such place is The Hitch-Hiker's Guide to Evolutionary Computation [uu.net]
if you want to learn about some of the many variations of GA, try doing a search on ieeexplore.ieee.org (assuming you are a member) or try www.researchindex.org (free) note that these are both research sites, and so learning something like this from research papers can have a steep curve. i'm sure many academic books cover the subject, too. another topic that would be interesting to use is neural networks (some might say that is obvious, and i would agree) the realm is similar to GA, but VERY different in the guts of the solution.
--paul
Re: genetically generated code? (Score:3, Informative)
Regards,
Slak
Re: genetically generated code? (Score:2)
Anyone still doing work along these lines?
--
Re: genetically generated code? (Score:1)
--
Re: genetically generated code? (Score:1)
Framsticks [poznan.pl]
Re: genetically generated code? (Score:1)
This is just what I'm looking for. :)
--
Re: genetically generated code? (Score:3, Informative)
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.
Re: genetically generated code? (Score:2)
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.
Re: genetically generated code? (Score:1)
I'm unconvinced! Unless you're going to code the bots yourself using a bit of pyschology, your only measure of success is going to be how could your robots are at beating the examples you give them.
Re: genetically generated code? (Score:2)
Re: genetically generated code? (Score:1)
That said, I agree, pure random bytecode is not the way to go.
Re:genetically generated code? (Score:1)
using this method would take several quadrillion times if not more.
maybe if you took the top 200 bots, and just swapped their code in and out.... who knows.
but pure random bytecodes is not feasible.
Re:genetically generated code? (Score:1)
Hmm, perhaps I found a topic for my genetic programming class...
Re:genetically generated code? (Score:4, Informative)
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 [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.
Re:genetically generated code? (Score:2)
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".
how about a 3D robocode. (Score:1)
I'm no expert on the subject but last I know there were some GL bindings for Java. It would be cool to have the robots battle in 3D space (with some real physics thrown in). Maybe in Robocode version 20.
Re:how about a 3D robocode. (Score:2)
Re:how about a 3D robocode. (Score:1)
It's pretty point-and-click based, and the major part is putting the parts on your bot but it's still really fun for a while.
Re:how about a 3D robocode. (Score:1)
RealTimeBattle (Score:1)
The biggest advantage of this one is that you can program your robot in any langages by interacting with stdin/stdout. Another good thing is realtime. And like it's written in C, it's quite portable
Some robots of Robocode have parameters optimized by genetic evolution.
I hope to see better robots with new technologies like Animat with sensor/actuator, Evolutionnary Neural Network, Multi-Agent (for team battle)
Re: RealTimeBattle (Score:3, Interesting)
RealTimeBattle [sourceforge.net] 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" [mindspring.com] - 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.
Re: RealTimeBattle (Score:2)
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.
Book Suggestions (Score:2)
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...
Re:Book Suggestions (Score:1)
Re:Book Suggestions (Score:2)
For that I'd recommend searching the web. Lot's of AI stuff out there.
Fermat's Info (Score:2)
If anyone's interested, here is a description [ntu.edu.sg] 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 [robocoderepository.com] for all the test bots and related information you will ever need.
Arun Kishore
[about to sleep...]