Jump to content
  • Advertisement

I need some info on making a text based MUD.

Recommended Posts

Hi there, 

I have worked on multiple games in the past: text based/2D/3D.

But now I want to make an mmo, specifically a text based one, known as a MUD.

The thing is I don't know much about making them, I know:

Loads of: C#, Python

A bit of: HTML & JS

Hardly any of: C++, Java


What I would like to know is:

How should I go about the networking? I know some sockets but don't like using others libraries.

Is there any information on the topics that I haven't been able to find?

And mainly, what language should I use. I am willing to learn a new one.




I have done research.


Share this post

Link to post
Share on other sites

You say you have done research, but what did you find? How did it fail to help?

There is not much published information about writing a Mud in 2017 because they've been out of fashion for about 15 years. You can easily find codebases for older muds online - Merc, Smaug, LPC, etc - but they are written in quite old C style and aren't a good match for today.

If I was starting a new mud today, I'd write it in Python 3. I would start out with a simple socketserver, make it act like an echo server, and test with a telnet client (either a proper MUD client, or Putty in raw mode). Then I'd change the logic so that the server validates the input and sends different responses based on the type of input, and from there I'd proceed to add the concept of rooms and navigating between them, etc etc.

Share this post

Link to post
Share on other sites

Thank you that will help alot. Answer to your question: I found lots of information on how old MUDs were created but hardly any on how to work on a MUD today.

Share this post

Link to post
Share on other sites

The old logic works just fine.  They supported hundreds of concurrent players in their day, limited by bandwidth. 

There are many different programming languages, you can use those if you want to.  There are new technologies, you can swap them out if you want to.  Different tools and technologies can make your development faster and easier, but ultimately it still boils down to a shared data source, a world simulator, and remote displays of the data.

Share this post

Link to post
Share on other sites

MUD technology hasn't really changed in the last 20 years. The Internet hasn't really changed (it's a little faster, but ... text!) and you don't need a GPU (again ... text!)

The typical MUD server loop looks like:

  • Read and buffer incoming data from all players that have any
  • Parse any complete line of commands from any player and queue events for whatever those commands are supposed to do
  • Run all events in your event queue until the next event to run is queued for sometime in the future, or the queue is empty

Part of "run events" will be actions that modify your world state, as well as generates observable text, which will queue outgoing "this is what happens" messages to the players. You don't want to have one player fail to read their socket and block the entire server, so use non-blocking mode when writing to each socket, and if the socket can't receive the data it needs, declare the player lost and disconnect them.

That's really all there's to it. You can do this in Python with no sweat. Or some typed language -- C# works fine, too.

A thing you might want to do these days is provide a web interface to the MUD. Typically, this will be done on top of websockets, or perhaps long polling. However, you can set up that service totally separately from the game itself, as a separate port/server/process. (Node.js makes building proxies like that very easy, although I hear there are good websocket libraries for C#, Java, Haskell, Python, and other languages now.)

For the basics of a game server loop in a few dozen lines of code of Python, you can check out this blog post.

Share this post

Link to post
Share on other sites

I would just use either C# or Python - whatever language you're most comfortable in - since performance is hardly a concern for MUDs.
Unfortunately MUDs are a dying breed and you will probably have a hard time getting any players for the game so I would only do it as a programming exercise.
I've mudded a lot years ago and still miss the old MUD I used to play and the people I played with. The communities of those games were truly something special.

Share this post

Link to post
Share on other sites

MUDs are a dying breed and you will probably have a hard time getting any players

This is why you want to do it with a web interface, perhaps on top of web sockets!

Share this post

Link to post
Share on other sites

As mentioned, nodejs (javascript) offers some great client facing options with simple websockets and webserver support. Another reason to consider websocket support is a fairly low barrier to using TLS (letsencrypt.org) instead of the traditional in the clear text communications most telnet/MUD clients use by default. We all want to promote security right?

Also, this project looks to still be active as a reference though I have not done anything more than browse the repository myself so cannot offer any opinions good or bad. https://github.com/shawncplus/ranviermud


Share this post

Link to post
Share on other sites

Blind gamers still enjoy muds, though you will need to somehow get your mud to stand out from the others already available.

One of the most popular muds among blind gamers is Alter Aeon.
A big part of its popularity is due to a client called Mush-Z.
Mush-Z is the MushClient.exe cclient preconfigured with addons to setup text to speech (TTS) for screen readers, and many scripts to add sounds in place of or in addition to text, music triggered by entering a certain area of the mud, and hot keys to make navigation faster and getting stats about yourself or your group faster.
The sounds and music really help the immersiveness a blind player feels.
Blind players only get information through sound, music, and TTS anyway, so the lack of graphics does not bother them.

Find info about Mush-Z here:

Cyber Assault and Empire mud are a couple others that have been popular among blind gamers.

Iron Realms is a company that develops muds commercially:
They have a heavy focus on role playing, meaning players must remain in character when chatting and interacting with others.

Posting on the audiogames.net forum is a good way to advertise to blind players:

Blind gamers are a niche market, but also one that is starved for good games.
I'm not saying that building a mud that blind players can play will be commercially successful, just that if you are going to build a mud as an exercise anyway, blind players are a possible target audience.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!