I used Python with Eventlet and Mulib for the backend and YUI for the little bit of JS that I needed. For the Facebook application side of things, I hacked the minifb.py library to work with Eventlet. 634 lines of very ugly Python (I could easily cut it to under 400 with some refactoring), and 217 lines of HTML and JS. It is funny how easy it is to write ugly code when you have such a deadline :).
I originally had no intention of doing anything web based (I had already downloaded and oriented myself with the latest version of Pyglet.) But the approval email from the Joyent made it just way too tempting.
The Good
- Python - I have to admit that I am a bit biased here, but I think it would have been difficult to do what I did with anything else.
- Eventlet/Mulib - Made it super easy to handle the COMET like interactions that I needed. The event system would have been difficult to implement in a traditional web framework, but eventlet made it very easy.
- Joyent - Yay for free hosting! What else can I say? :)
- YUI - Made the basic JS communication pretty simple.
- Creating the room system and monster spawners - While it did take a bit of time to work out, it made it super easy to add new content. If I had only had a little more time, I could have added quite a bit more content.
- Event system - Overall the event system worked out fairly well notifying players of events going on in the world. This was one of the killer features. I don't think anyone would have liked a "turn based" mud. The event system made everything pretty responsive.
The Bad
- Unfamiliarity with Sun Solaris 11 - The downside the the Joyent slice, was the OS. It took me far longer than I would have liked to get oriented, and get the environment set up. The most difficult part was trying to get Python 2.5 to install on it. I easily spent 4 hours just with this stuff.
- Bugs - There are a couple of bugs still. The biggest one is that every once in a while a message will get lost. I didn't have time (and foresight) to implement a queued messaging system to guarantee delivery (even if it was a little late).
- Missed opportunity - I should have focused more on tools for world building inside the game. All the pieces were basically there, I just didn't think about wiring it up in time. Half of the game could have been building the world -- not sure if that would have been cheeting or not :)
- Not enough content - I just ran out of time. I wish I could have focused a little more on adding some more content.
- Bad coding habits - I started cutting and pasting way too much. If I had re-factored the code then, later development would have been much faster, and most likely much more bug free.

7 comments:
Your application still doesn't work for me. I just see a light grey square with a dark grey question mark inside.
I'd love to find some nice javascript MUD console code. I've just gotten my standard library based http server working with comet and while
I like the idea of getting a telnet connection working over it, writing the UI code is less appealing :)
Can you go into further detail about how eventlet "Made it super easy to handle the COMET like interactions"? I am more of a library person than a framework one, and eventlet looked too frameworkish to suit me.
Hi Richard, The big question mark is where an icon and description of the app would normally go. I don't think that it can be added until you submit the app to the general directory, which I didn't want to do yet. On that same page, to the right you should see a blue button that says "Add this application", or if you are not signed into Facebook, there will be a green button that says "Sign Up". Click either of those and you should be on your way.
As for more info on Eventlet, check out the following two posts:
Noodling with eventlet and mulib
Toy chat server with eventlet and mulib
Eventlet is very much a library that lets you use as little or as much as you want of it. Mulib is much more like a framework. They are still a bit young, but I think they show a lot of promise.
Let me know if you have any more questions.
Oh and one more note... The whole MUD engine is written in the one server that uses eventlet. I don't connect it to telnet at all. I just use COMET ad AJAX to handle messaging and to stream the information to the client from the Python server.
I have it added and I still get the question mark. I even tried removing it and readding it. No dice.
richard: Hrmm... a lot of other people have been able to add it without any problems. After adding it, maybe the forward isn't working correctly. Try browsing back to http://apps.facebook.com/minimud, and see if that works. If not, would it be possible to send me a screenshot? My email is chuck at evilchuck dot com. Thanks!
Very cool stuff.. planning to do anything more with it?
anonymous: Thanks! I do have some plans for it, but real life has limited my time. The next release will be mostly bug fixes and refactoring to make the code a bit more maintainable :)
Post a Comment