Monday, April 21, 2008

MiniMUD Postmortem

If you didn't catch my last post, I created MiniMUD for the Ludum Dare 48 hour game competition. It was great fun, and thought I would do a postmortem on how things went.

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.
Overall it was a great experience, and I am pretty satisfied with what I accomplished in 48 hours. I will definitely be able to use a lot of what I learned in future projects.

Sunday, April 20, 2008

Code a MUD in 48 hours?

What is all this crazy talk about? It all started a couple of days ago when I was figuring out what to do for the weekend. For reasons that will remain unknown, I was going to have a lot of free time, and not be able to do much of anything physical. As I was seeking what to do, I came across the Ludum Dare 48 hour game development competition. The basic idea is to create a game from scratch in 48 hours based on a theme that is announced right as the competition begins. I have wanted to do one of these for a long time, but never had the chance to. Sounded like the perfect idea.

Literally minutes after the competition began I got a confirmation email from Joyent with details for my hosting slice for Facebook Apps. Joyent has a deal that gives you a free virtual server for developing Facebook apps. I applied quite a while ago, but hadn't heard from them since they seem to be quite a bit back logged. I was now eager to play with the new server, so I figured I would join the two causes.

If you have been reading my blog for a while, you know that I am interested in creating a web based MUD. The theme was minimalism, which a MUD seemed to suite fairly well, so for better or worse, I decided to create a minimal MUD on the web as a Facebook application.

48 hours later and I give you MiniMUD. I didn't get everything done that I wanted to, but I am pretty satisfied with what I did get done. It has the following features:
  1. Basic rooms that you can walk around
  2. Monsters to fight, that also fight back
  3. You gain experience from killing monsters which you can spend to raise your skills
  4. Talking, emotes, and general messaging when events happen
  5. PVP
  6. Leader board that shows the user, character and experience
If you would like to check it out, you will need a Facebook account, and add the MiniMUD app. Create a character, and then click the game tab. Type help to get a list of available command. It is also much more fun when you play with a friend ;)

It was, of course, written in Python with some other cool stuff, but I will post more about that later in a postmortem (once I have had a chance to sleep :) ). So there you have it--a minimal MUD in 48 hours!

Tuesday, April 8, 2008

Some thoughts on Google App Engine

A lot has been said about the new Google App Engine that was announced today. Here are some thoughts that I have been having about it.

1. It makes a lot of annoying stuff really simple. From pushing code live, to managing what version of your code is running live, to collecting usage stats, to setting up and managing the systems (not to mention a setup that is inherently very scalable). I think a lot of people are overlooking how big this really is. The barrier to entry and time from idea to proof of concept has just decreased dramatically.

2. It makes what is incredibly difficult now attainable for the average developer. Making a scalable web application is no easy task. It will still take some work, but will at least be within the reach of a lot more developers now.

3. It is free. Sure I might at some point go over the limits, but as a developer that is a problem that I would love to have. That would mean that I am developing something that people are really using and enjoying. Since it is already on the Google infrastructure, I can spend my time figuring out how to make money rather than spend my time (and a lot more money) figuring out how to make that app now scale that has suddenly gotten popular. I would much rather be on that side of the fence.

4. It's alpha. Come on guys, cut them some slack. There is already a lot of complaining about what it can't do, but if you read their docs, you will find that most of those things are being worked on, and they are openly soliciting developer comments to see what is needed most.

5. Yes there are limitations. But I see those limitations more of a blessing than a curse. It is those same limits that help your app to scale, and prevent you from making mistakes that make scaling more difficult. Sure you might have to think a little differently when designing the app, but then again, you are going to have to do that sooner or later anyways if you want to make your app scale.

Unfortunately I didn't make the first 10,000 developer cut to get an account, but I anxiously await my chance to play around with it.