March 21, 2009

PodSixNet is a lightweight network layer I've written to make it easy to write multiplayer games in Python. It uses Python's built in asyncore library and the simplejson 3rd party library to asynchronously serialise network events and arbitrary data structures, and deliver them to your high level classes through simple callback methods.

Click here to download it

I wrote this library because I'm forever thinking up multiplayer game designs and then starting, but never finishing, a new multiplayer game library for every multiplayer game idea. In other words, I get bogged down writing low level code and eventually lose interest in my original idea as it proves tricky to implement. I decided to get the multiplayer game library written once and for all so that whenever I get an idea for a multiplayer game, I can now prototype it up rapidly. I'm quite proud of the fact that this library is only a handful of simple classes, and weighs in at just two hundred odd lines of code. This is of course because I built it on top of Python's already cool asynchat (used by Twisted) and simplejson.

Two example apps are included with the source to help you get started. The first one is a simple console based chat program, and the second is a pygame based collaborative whiteboard. For each example start one copy of the respective server, ChatServer.py or WhiteboardServer.py, and then start multiple copies of the client to test.

Would really love to hear about it if you use this in a game!

March 9, 2009

If you are a mutt user like me, and you are running Debian GNU/Linux or even Ubuntu, I highly recommend apt-get installing 'mutt-patched'. One of improvements it brings is a small 'folder list' down the left hand side of your terminal window. You can configure this folder list to monitor subfolders for new mail. This is a boon if you have procmail filters which direct different types of mail (e.g. mailing lists, work mail, etc) into different subfolders. In essence it's gmail-like functionality, or any modern GUI mailer for that matter, but for the console user. I'm excited to be joining the 21st century!

Info on configuring this setup can be found in /usr/share/doc/mutt-patched/examples/sidebar.muttrc

Have fun!

March 3, 2009

Need to settle an argument? Recently, I finished coding up this Rock Paper Scissors game that you can play online against someone else. Have fun.

Rock Paper Scissors

Feb. 18, 2009

GhostWave

Last night I put the finishing touches on an RjDj scene that I've been working on in my spare time called GhostWave. It's a dark algorithmic drum & bass generator which lets you hum the bass lines. If you have the latest version of the RjDj single (free!) installed on your iPhone or iPod Touch, you can simply visit this page from safari on the phone and click the following link with your finger:

GhostWave.rjz

By itself it does very little but make randomly raw semi-melodic noise. Shake it quite hard a few times to start some hi-hats tickering, and then hum a bass line into the mic. To record and loop your hummed bassline, put your finger on the little ghost as you hum your melody in time to the hats. Let go when you're done and the melody should loop. Once you're done, shake it vigorously a few more times to bring in the beat. After listening for a while the beats will fade, but you can bring them back by shaking some more, and you can continue to press the little ghost to record more melody loops.

Let me know what you think.

Have fun!

Nov. 8, 2008

Today I finished reading A field guide to genetic programming, a free, self published, creative commons licensed computer science book written by practitioners in the art of evolving computer programs. I say art because as the book makes clear this science is still quite young and experimental, mostly based on heuristics and rules of thumb. This is exactly what makes the book so valuable a resource. Outside the basic evolutionary algorithm the number of different ways of representing candidates, eliminating the unfit, reproducing new candidates, choosing population size, choosing mutation rate, etc. etc. make it incredibly complex to form a systematic analysis of the different aspects of the technique. The book gives experienced advice about all of these aspects and also suggests areas that need further study.

The book is ideal for people who want to get up to speed with the front line of current developments in the field. By the end of the book one is armed with enough knowledge to dive right in and start creating and using programs that evolve programs. A basic understanding of computer science concepts are all that is needed to grasp the concepts in the book, so anyone with a first year level of a computer science degree, or a few years of programming experience, should have no problem.

I purchased a hardcopy version of the book for easy reading and it came as a paper-back the size of a sheet of A5. The illustrations on the outside of the cover and througout the book lend it a lighthearted and easily comprehensible air and the writing itself is more enthusiastic than you would expect from a scientific text, making it an easy read. The examples provided are consice, easy to understand, and directly to the point, and the book is incredibly well referenced providing numerous texts to follow up some concepts in more detail.

Perhaps the most compelling feature of the book is the multitude of successful, practical applications of GP to real world problems which are found throughout it's pages. Before I read it, I was already convinced that the only way that we will evolve human equivalent intelligence will be through some type of artificial evolutionary process. Now I am even more convinced of that. Here are some choice quotes from the late Alan Turing, as always, far ahead of his time:

"There is the genetical or evolutionary search by which a combination of genes is looked for, the criterion being the survival value."

("Intelligent Machinery", Turing, 1948)

"We cannot expect to find a good child-machine at the first attempt. One must experiment with teaching one such machine and see how well it learns. One can then try another and see if it is better or worse. There is an obvious connection between this process and evolution.

'Structure of the child machine' = Hereditary material

'Changes of the child machine' = Mutation

'Natural selection' = Judgement of the experimenter"

("Computing Machinery and Intelligence", Turing, 1950)

What higher computer science accolade is there than Alan Turing's posthumous recommendation? In short, great book. Find out more at the official website and purchase it online at lulu.com.