Search

Gibson: AI Scripting Prototype

For the past few years, I’ve been kicking around the idea of a general framework for AI development using high-level dynamic languages. It’s one of those grandiose ideas that’s oh-so-hard to get off the ground and I’ve had several false starts on its development. Over my spare time in the last few weeks, I’ve whipped up something that has the potential to be a good start.

The prototype isn’t terrible visually impressive, but it gets the point across. Each moving colored circle represents an autonomous agent. Each of the agents shown here is being controlled by code written in a different language- Ruby, Javascript and Scheme, respectively- all running simultaneously, in the same world.

The agents, the world they exist in, and how the two interact is all written in Java. The brains of the agents are then written in whatever JSR-223 scripting language implementation the author cares to use. The Java-level APIs that control the bot and its perception of the world are exposed to the scripting layer, so hackers who want to play around and create emergent behaviors among their bots can focus on expressing the algorithms to do so, in their language of choice, and don’t have to worry about things like the physics of the world or how a bot draws itself to the screen.

You can download the source and prebuilt jar here. Once unpackaged, you can run it with:

java -jar dist/gibson.jar [list of agent-controlling scripts]

The script engine manager automatically detects which scripting engine to use based on the extension of the file. It depends only on the Java 1.6 standard library and whatever scripting languages you want to use with it. I’ve packaged JRuby, Rhino, and SISC (the Java implementations of the previously mentioned scripting languages) and their dependencies so you can run the included test scripts.

This is, of course, just a prototype I hacked up over a few days. Most this code will be chucked out the window as I refactor, rearchitect and generally flesh out how I want this thing to work. Once I get some momentum, I plan to make the source repository and all the planning documents publicly exposed somewhere. The code is licensed under the MIT License, so do whatever you want with it.

I’m calling this thing Gibson, after the esteemed sci-fi author and tasty cocktail. Pick your favorite interpretation.

Comments

Comment from Nick
Time: July 13, 2007, 12:15 am

WOOT! ;D

Write a comment