A MUD engine in python
Requirements:
ErisMUD is written in Python and supports many features: Rooms, NPCs, inventory, player stats and skills, a basic damage/healing framework, ANSI colors, help system, etc. SQLite is used to store the data, so no files are required for building (unlike LPMUDs). Short and easy internal commands take care of the development and maintenance.
This game was listed as missing in action: it was no longer available when the site closed.
License: freeRequirements:
- Python
- SQLite
- pysqlite
| Sound: | Play in X: | Play in Console: | Multiplayer: | Network Play: | 3D Acceleration: | Source Available: |
|---|---|---|---|---|---|---|
| no | no | yes | yes | yes | no | yes |
Submitted by nath on 2005-06-13.

I've been fooling about with muds for ages, and I like LPMud a lot, but writing a mu* in a C-like language seems just plain wrong. A mu* cries out for a much more LISP-y language, and seeing that the most LISP-like mud system I've seen is in the DUMB server, which runs on a Java VM and hasn't been maintained in 5 years, it's right out. Something Pythonic sound likely to be worth a switch to me.
I'll try to read about compression schemes but for now, none is used.
The design is monolithic though distinctly separating the server from the "MudOS" is a future goal.
I've toyed with LPMUDs for years but I wasn't happy with the filesystem design, I prefer using a database. Also, LP development is terribly slow and a lot of servers/OS are proprietary.
Thanks for the comments.
~Manu
Thanks for the bug finding. :)
That's supposed to be a good thing?
That said, once I get a stable release that I'm satisfied with, I may work on a basic stock RPG system.
~Manu
On the other hand, this means that developers have to spend more time re-implementing code (and probably all making sub-optimal half-baked implementations) and less time implementing the actually important parts of the MUD - the world and story.
Shipping a stock ruleset would probably be a good idea, once you're comfortable working on it. Nobody would be forced to use it, but it would probably be a good thing not to force MUD creators to reinvent the wheel.
The DIKU-based muds were quick and easy to set up, but difficult to set up differently, which was a major factor in the glut of awful muds in the late 90's. If you want to set up a mud, it's either going to be a ton of work, or a very generic mud. Pick one.
A database on its own has a lot of advantages. The truly big MUDs, the professional ones like GS IV and Dragon Realms, all run off of Oracle DBs. The database lets you efficiently manage large amounts of data.
So far as using SQLite, it's an excellent database engine for non-concurrent usage. Where-as something like GS IV is extremely heavily loaded (well, it _used_ to have 5,000+ players on at a time, back before the graphical MMORPG revolution), the average MUD doesn't need that kind of concurrency and SQLite is one of the best choices to use for a database for that work load.
The author added threading. Unfortunately.
First, there is not a single good reason for threading. The only threaded behaviour implemented so far is something that should be timer based, not thread based. I.e., every 10 seconds of the game loop running, it should execute the heal code. Absolutely no need for threads at all.
Second, the threading is buggy. The simplistic heal routine has a race condition. The two SQL statements are not in any sort of a transaction, so it's possible for the state of the SQL tables to change between their execution (it's a thread, that happens).
I also am confused about the style of the code in the healing method... why is the author assigning what should be local variables to the self object?
The healing method could also just be made simpler by using better SQL. Instead of querying the current HP with one SQL call, and then updating it with another, you can just use something like:
That removes the race condition, reduces the amount of code to maintain, reduces the number of SQL statements thereby increasing efficiency, and doesn't have a chance of pushing the current HP over the maximum. Just take that out of the thread and implement real timer handling code, and you'd have a great implementation of healing. If the author would like some more design feedback and assistance, he should head over to mudmagic.com and post on the forums there.
The MUD doesn't seem to implement telnet at all, yet. It is required for certain features (echo negotiation for password entry, MCCP, etc.).
The biggest problem is that all clients are speaking telnet, and the server needs to understand that or else risk potential breakage. At the absolute bare minimum, there needs to be IAC escaping. If the byte value 255 is ever sent out, it *must* be turned into the sequence IAC IAC (two bytes of value 255). Otherwise, the client will try to interpret the byte and those following it as a telnet command. When the server receives data, it also needs to understand IAC. It needs to turn an IAC IAC sequence into a single IAC byte. It needs to catch or ignore the three-byte IAC WILL, IAC WONT, IAC DO, and IAC DONT sequences. It needs to understand the IAC SB command and that it has to ignore everything up to IAC SE (and don't forget to handle IAC IAC escapes inside the subrequest!). It needs to handle or ignore the other two-byte IAC commands.
I wrote a quick-n-dirty explanation of the issues of implementing telnet at http://www.awemud.net/wiki/Home/Projects/ZMP/Implementing+Telnet. Additionally, my project PyCL at that site is a Python MUD client with a telnet parser and sender in it; the author of ErisMUD is free to reuse that code (under its license terms) or use it for studying purposes.
Maybe you're just bringing up these "programming issues" publically because you're hoping that the people catching it will shy away? Perhaps make use of the "better" solution that you're offering?
Competition's always good I guess, but you really ought to grow up.
Maybe you've heard of this Free Software/Open Source thing where people contribute to their neighbor projects and help each other out. That being why I explained why the author's approach was flawed and described how to correct it, instead of just saying it's broken and to use something else. My sharing of my knowledge and experience with others might *gasp* actually be altruistic in nature.
If that's a concept you can't understand, that's your own loss. ::shrug::
Not that I agree with the poster or anything, but you're not making a very convincing argument either.
That aside, there are good comments. I'm far from being a python guru, this is my first public project. I'll reply in depth on the mailing list, which you can subscribe to by visiting the ErisMUD website.
PLEASE do not answer me here, this is just wasting space.