views:

380

answers:

2

I used to play a MUD based on the Smaug Codebase. It was highly customized, but was the same at the core. I have the source code for this MUD, and am interested in writing my own (Just for a fun project). I've got some questions though, mostly about design aspects. Maybe someone can give me a hand?

  1. What language should I use? Interpreted or compiled? Does it make a difference? SMAUG is written in C. I am comfortable with a lot of languages, and have no problem learning more.
  2. Is there a particular approach I should follow to not hinder performance? Object Oriented, functional, etc?
  3. What medium should I use for storing data? Flat files (This is what SMAUG uses), or something like SQLite. What are the performance pros/cons of both?
  4. Are there any guides that anyone knows of on how to get started on a project like this?

I want it to scale to allow 50 players online at a time with no decrease in performance. If I used Ruby 1.8 (very slow), would it make a difference compared to using Python 3.1 (Faster), or compiled C/C++?

If anyone can lend a hand and give some info or advice, I'd be eternally grateful.

+7  A: 

I'll give this a shot:

  1. In 2009, for a 50 player game, it doesn't matter. You may want to pick a language that you're familiar with profiling tools for, if you want to grow it further, but since RAM is so cheap nowadays, the constraints driving the early LPMUD (which I have experience with) and DikuMUD (which your Smaug is derived from) don't apply. (LPMUD could handle ~10-15 players on a machine with 8MB RAM)
  2. The programming style doesn't necessarily lead to performance difficulties, large sites like Amazon's 'obdios' backend are written in C, but just-as-large sites like the original Yahoo Stores were written in Lisp, StackOverflow is written in ASP.NET, etc. I'd /personally/ use C but many people would call me a sadist.
  3. Flat Files are kind of pointless in today's day and age for lots of data storage, there are specific-case exceptions (Large mailservers sometimes use 'maildir' which is structured flat-files, for example). The size of your game likely means you won't be running into huge slowness driven by data retrieval delays, but the data integrity in-case-of-crash are probably going to make the most convincing argument.
  4. Don't know of any guide, but what I'd do is try to get the game started as a dumb chat server to start, make sure users can log in and do something (take their input and dump it to all other users), then build that up to allowing specific logins, so you'll start facing the challenge of username/password handling, and user option setting / storage / retrieval ... then start adding the gamedriver elements (get tic tac toe games working in game), then go a little more complex (get a 5-room setup working with objects you can pick up / drop / bash each otehr with), then add some non-player characters, and THEN worry about slurping in the Diku-derived smaug castles / etc and working with them. :)

This is a bit off the cuff , I'm sure there are dissenting opinions. :) Good luck!

Jon Bailey
Ah, LPMUD... brings back a lot of memories. LPC was actually quite a good fit for developing items and creatures.
Fredrik
Very Solid answer Jon!! I would have mentioned to start the dumb chat program with async communication.It would be a pain to go back and plug that in.
george9170
+1  A: 

This is a text based game, right? In that case, with current hardware, it seems all you would have to worry about is not accidentally creating an O(n**2) algorithm. Even that probably wouldn't be too bad with 50 users.

Dan Hook