2011-10-19

VirtualBox Common Lisp Environment for Google AI Ants Challenge

(see the end of this post for remarks I've gotten about the vbox image)

So, the next Google AI Challenge seems to be almost ready to get going, albeit six months later than I expected.

As blogged about earlier this year I have been worked on the Common Lisp starter bot for the challenge, an alternative starter bot with a proxybot, some YouTube videos and now a VirtualBox image with an Emacs+Slime environment ready to go.

Due to the long delay for this challenge to get started some of these projects aren't quite up to date anymore but they should still be quite usable and at least get you started or help you along.

The VirtualBox image is up to date as of writing this post and any comments on it would be welcomed. I will not make a new image (although someone else is free to do so) but if possible I will provide a patch on the AI Challenge forums.

On booting the image it will start up SBCL, Emacs and Slime (connected to SBCL) with some instructions in the scratch buffer.  Perhaps it is a good start for another Lisp-in-a-box project.

I am not sure how much time I will be able to spend on the current challenge due to also participating in the online Introduction to Artificial Intelligence and starting a three month sabbatical gig writing an iPad client for a startup November 1st.

Specific Remarks about the VirtualBox Image

14:23 < Xach> the remapping of [] and () confused me though.
Right, I've been computing like this for so many years that I totally forgot about this.  The parens have been swapped with the brackets otherwise Lisp programming becomes quite painful.  If you want to reset this check out keycodes 18, 19, 34 and 35 in ~/.xmodmaprc and reboot the image.

Now that I think of it, Control and Caps Lock are probably swapped as well.  That's done in the ~/.xmodmaprc as well.

Labels: , , , , ,

2011-07-23

Common Lisp Proxy Bot Videos for Google AI Ants Challenge

I have made two screencasts showing the setup and usage of the proxy bot for the upcoming Google AI Challenge. This was at the request of McLeopold.

For the Planet Wars challenge I've tried to explain the use case for a proxy bot on the forums. Please read that post if you have no idea what the proxy bot does, although I will try to sum it up now: the proxy bot allows one to develop your actual bot in the usual 'Lispy' way[1] while the game engine runs and kills the proxy bot.

Since it uses sockets for communication it ought to work for other languages than Common Lisp but this hasn't been tested.

[1] Running Lisp image and, for example, Emacs + Slime.





Labels: , ,

2011-03-31

Preparing for the next Google AI Challenge

Work is in progress for the next Google AI Challenge and I've been working on the Common Lisp starter package. At the request of the organizers the starter package has been made very basic.

A more extensive starter package with proxy-bot functionality is available at: http://github.com/aerique/google-ai-challenge-2011-1-ants/.

Proxy-bot functionality is meant to allow for more Lisp-like development of your bot. You can keep your actual bot running in, for example, a Slime session while the proxy-bot is started up and killed by the game server. The proxy-bot connects to your actual bot in the Slime session to play the game, ie. it just passes on state and orders between the game server and your actual bot.

Labels: , ,

2010-10-11

Planet Wars: You Can Still Participate

The Planet Wars competition has been running for a month now and the deadline for submissions is Saturday the 27th of November 2010.

Don't let the fact that it has already been running for a month dissuade you from participating. If you're an experienced programmer a weekend of solid work will get your bot in the top 500 (out of a little more than 3000 participants currently) and maybe even in the top 100. If you're less experienced perhaps a week or two of work will get you the same (and if not, you will still learn a lot!).

Some perspective: my bot briefly entered the top 25 this weekend (but it's on its way out of the top 50 currently) and I've been working on it in my spare time the last two or three weeks. I'm not experienced in AI programming and I've got a full time job, a wife and two young kids to distract me.

So, grab a Common Lisp starter pack and get hacking!

One tip: The map format is very simple (check the maps directory in any starter pack). Make simple maps to test your attack and defense routines on.

Some helpful links:

  • dhartmei's TCP server: with this you can play games against others from your own machine (ie. without uploading) and it gives you more games in a shorter amount of time than the official server.
  • JBotManager: I use this utility exclusively for replaying games.
  • Test scripts for running your bot against the example bots on all the maps. If you win against these bots 95% of the time you'll end up in the top 500 and if you win against them 100% of the time you'll probably end up in the top 100.
  • A strategy guide with links to other strategy guides.
  • Parsing the game output state: this will allow you to get a played game back from the official server in a way that can be fed back into your bot. This has helped me find some bugs of games where my bot crashed on the official server which I missed when testing locally.

Labels: , ,

2010-09-21

Planet Wars: Common Lisp Starter Package, part 2

It took a while but Common Lisp is finally supported on the official Planets Wars game server (Google AI Challenge)! (In the meantime one could use dhartmei's server (and you still can since it offers some advantages like more games in a shorter time).)

Both Gábor Melis and I updated our starter packages which can be found here:
My starter package has been improved a little since earlier versions (most importantly no reliance on *features* anymore) and it comes with a silly bot that is currently slowly climbing the ranks: http://ai-contest.com/profile.php?user_id=4055

Labels: , ,

2010-09-09

Planet Wars: Common Lisp Starter Package (Google AI Challenge)

The Google AI Challenge should start any day now and I and "anwyn" have both made Common Lisp starter packages. anwyn's follows the API of the other starter packages more and is perhaps a little more lispier (I like LOOP a lot) and mine's a little more bare-bones: just the basic communication with the game server and a silly example and you have to do the rest.

One little extra in my starter package is a "proxy bot". Since the initial starter packages use conventional languages, developing and running the bot is also pretty conventional: a basic edit, compile, run (crash, coredump) loop. The proxy bot takes it on himself to be the one that's started up and shut down every time[1] instead of your real bot, so you can keep the latter running in an, in my case, Emacs + Slime session.

(I don't have to tell the advantages of this to this audience.)

This proxy bot is perhaps useful to people writing their bots in Clojure and Scheme (and Haskell?) as well. Although they will have to adapt their main loop a little to allow for socket communications besides the normal way of talking to the game server.

Also, there's an unofficial server on which you can test your bot against others: http://www.benzedrine.cx/planetwars/

[1] You don't really have a choice with the Planet Wars game engine.

Labels: , ,

2010-09-06

New Google AI Challenge: Planet Wars

There's a new Google AI Challenge: Planet Wars.

It seems they're also working on adding support for Common Lisp due to the number of people that used it in the last challenge. Awesome!

Labels: , ,

2010-02-10

Google AI Challenge 2010 part 2

They've finally added Common Lisp as a supported language to the Google AI Challenge.  (Just before they stopped adding new languages, phew!)

There were some issues getting my starter pack to work on their server since they're running an older SBCL (1.0.18 on Debian) and that didn't support the "--script" switch.  That combined with them being very busy meant it took a while.  We were passing error messages and solution back and forth only once every other day.

So now the code is on the server side is compiled (#'save-lisp-and-die with :executable t) which means you can make good use of the two extra seconds you get for the first move (which some other languages need for starting up).  Anyway, check the Makefile and example.sh for details.

There's still some issues with the starter pack if you're running locally and you don't want to run "make" for every other change (and ofcourse you don't want that!) so check the "Common Lisp pack?" thread in their forums for discussion and solutions.

Labels: , ,

2010-02-05

Google AI Challenge 2010

For those who've missed it: Google AI Challenge 2010

There's no Common Lisp starter pack (edit: since this is getting misinterpreted I meant a CL starter pack for the AI Challenge) but after a particular nasty adventure spelunking for days through an archaic database at work, fighting through the 20 years of cruft that has been build up inside of it and finally finding and fixing the problem I decided that I needed a break and wrote an initial version of a Common Lisp (SBCL) client.

Perhaps someone with connections at the University of Waterloo and some work can finish it and make it an official starter pack? I've got to go back to work ;-)

Relevant links:

Labels: , ,