[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  General
. . -> [Subject]  Making a Whole New World...From Scratch! (MUD)

Making a Whole New World...From Scratch! (MUD)

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Ben K   USA  (1 post)  [Biography] bio
Date Tue 03 May 2011 04:04 AM (UTC)
Message
Greetings, everyone. This will be my first post here, so I'm going to keep it as concise as I possibly can in an effort to make friends rather than enemies.

I was a Wiz/Liege/Arch/Assistant for several years on an older MUD. (CD Server in C, files written in LPC) The codebase and source for this MUD was the original Genesis game, which remains active to this day. My old MUD, however, has closed its doors forever - leaving me one hobby short!

I'm a creative writer at heart, and my imagination is my strong suit. For years I've had an entire world swimming in the recesses of my mind, but I've never put it to any use. Now I have the perfect reason - and opportunity - to put my experience and imagination to good use and create a whole new world all my own for others to enjoy.

Problem being, the world has changed. When my old MUD first went up, C languages were fairly common for servers and LPC was a basic and common writing language. As I began researching the steps I might need to take to begin my own MUD-pie, I quickly became aware that many MUDs today use different languages than I am used to for their servers, scripts, and so on.

I already have the finer points of the game world and style of play worked out and written down, complete with maps, classes, races, combat systems, object types...et al. But, seeing as how I find myself in uncharted waters with much of my experience being obsolete, I thought I'd ask the fine experts here at Gammon for their advice :)

My main goal is to create a new hobby for myself that is fun and challenging. I don't care about how many hours it takes or how much work is involved; I have unlimited time, and would be perfectly happy to "Localhost" my MUD for the first couple of years while I work on it by myself. I have taken some classes for C and C++, and have untold volumes of documentation and textbooks regarding numerous coding and scripting languages, databases, etc.(ranging from simple HTML to Javascript, SQL, and Lua). I just want to make it clear that my main concern is not necessarily doing things "the easy way". I want to do things the way that will challenge me and allow me to simultaneously learn and create a new world that people can actually enjoy when/if it goes online. If nothing else, I'll use a local machine and broadband access to play just with friends and family.

I know that I can find answers to my questions elsewhere, and I have been sitting at this computer for the last several hours researching, taking notes, copy/pasting, and generally learning what I can. But those answers have led to some new questions, and I would appreciate a direct response to my most pressing concerns.

So, all of that background information covered, here are my basic questions:

1. Is it worth my time to invest in creating my own MUD server? What are the pros & cons of using a pre-designed server vs. creating my own? If I'm rusty in C++, exactly how difficult would it be for me to alter a predesigned source code?

2. What codebases and languages are advisable for the server and the MUD itself? What's the current "state-of-the-art" design, and what's the most reliable fallback? Is LPC dead?

3. My old MUD used a lot of archaic coding that - according to modern articles - is very inflexible. That being the case, what should I look for to increase the game's flexibility?

4. What's the easiest way to create a MUD (using new design and language) that I can host on my own computer for my own improvement and design before making it available to anyone else? Are there any specific programs that I should be downloading (aside from MUD clients) to help me in this task? (All of my old work was done in Notepad and Ed().)

5. Are there any superior websites (besides this one) that offer tutorials or examples of new MUD creation, codebases and servers? Most links that I've found lead to Error 404's.

6. How am I doing on keeping it brief? ;)

I'll end my rant here. That was much longer than I'd hoped it would be, but somehow it seemed important to be very clear; I'm not completely inexperienced in this field, but the field has been changing around me while I've been working with older systems. I'm just looking for some advice on what steps - aside from conceptual design - I should take before any others.

P.S., I read Nick's amazing posts on one of the forum threads revolving around what to hash out before even beginning to think about coding a server. I am proud to announce that I have completed those steps, so I'm as prepared as I can be aside from re-enrolling in another C++ course to refresh my memory.

Thank you in advance for your suggestions, and best regards.

"The Only Rule Without Exception is This: There is an Exception to Every Rule." - Ben K.
[Go to top] top

Posted by Daniel P   USA  (97 posts)  [Biography] bio
Date Reply #1 on Tue 03 May 2011 05:13 AM (UTC)

Amended on Tue 03 May 2011 05:24 AM (UTC) by Daniel P

Message
I doubt I could answer every one of your questions...however, I can safely say that there are a few commonly used already-programmed servers out there, the main ones even hosted here on Nick's site.

ROM - http://www.gammon.com.au/forum/bbshowpost.php?bbsection_id=8
SMAUG - http://www.gammon.com.au/forum/bbshowpost.php?bbsection_id=5
PennMUSH - http://www.gammon.com.au/forum/bbshowpost.php?bbsection_id=6

I personally like to play with PennMUSH. There is no hardcoded delay between commands (such as in SMAUG), so response time, especially on a localhost, is fairly instantaneous. The database storage is in a single file which is then parsed into active memory and then periodically dumped back to the file, based on your configuration. Correct me if I'm wrong, but I believe the other two types of servers rely on multiple databases based on the type of object you're working on..such as one file for exits, one file for rooms, etc.

One thing I've picked up is that PennMUSH is a sort of off-shoot of the older TinyMUSH server, which was spawned from TinyMUD (http://en.wikipedia.org/wiki/TinyMUD). So it's pretty safe to assume that the codebase for this family of MU* servers is fairly classic.

Also, I know that PennMUSH is actively being developed and upgraded: http://code.google.com/p/pennmush/downloads/list . If you're on Linux, well..on Linux, EVERYTHING is uber-easy to compile. The developers have included Visual C++ projects (6, 2005 and 2008) which you should be able to compile if you have Visual Studio installed on your machine. The Express version of this suite is free from Microsoft.

As for softcoding within the game, no there are not a lot of tutorial sites on this, but there are a small number of sites which host example systems that you can glean a lot of self-taught information from. This and wracking my brain over the help files is how I've learned most of what I know. The best one I've found so far is at http://mushcode.com/ .

Also, you can create a character on M*U*S*H ( telnet://mush.pennmush.org:4201 ), the creator of which (Javelin) just 'retired' to regular wizard status at the beginning of April. They've got a fairly solid and committed playerbase that is pretty much all up on hard and softcoding and can answer any technical question you may have...at least that which makes sense ;).

Hope this helps. Personally I wouldn't tackle designing an entire SERVER, but that's me. Instead, download one that's already been designed with an included minimal database, learn its softcode and build within it.

Seriously though, in spite of all these outdated sites and 404s you find (and I've probably found the same ones), there is still a sizable developer community which I'm sure has a number of brains you will be able to pick for really in-depth information.
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #2 on Wed 04 May 2011 03:51 AM (UTC)

Amended on Wed 04 May 2011 04:41 AM (UTC) by Nick Cash

Message
Well, I'll add my 2 cents.

Quote:

1. Is it worth my time to invest in creating my own MUD server? What are the pros & cons of using a pre-designed server vs. creating my own? If I'm rusty in C++, exactly how difficult would it be for me to alter a predesigned source code?


With some C/C++ knowledge you should have little difficulty getting up and running with ROM, SMAUG, or one of the many other servers out there. If your ideas fit well with the existing mechanics of a server (or could with a little effort) then I see no reason to write it from scratch. However, if your goal is to make the game entirely your own and learn more about computer programming along the way, then MUDs make excellent hobby projects for learning about a variety of tasks (basic data structures, databases, networking, even threading).

Personally, I've always enjoyed using custom MUD servers as small personal projects to help teach me new things in programming. To this day I work on a MUD server in my spare time if only to have an excuse to work with Lua and learn more about embedding/extending languages. Once you know a bit about programming then making a basic/small MUD server can also be a decent way to learn the in's and out's of a new programming language.

Quote:

2. What codebases and languages are advisable for the server and the MUD itself? What's the current "state-of-the-art" design, and what's the most reliable fallback? Is LPC dead?


I've never been in the LPC loop, but it has always seemed to me that it is about as dead as Latin.

As far as languages go, I would recommend using Python if you are newer to programming. If you know C/C++ then you can certainly go that route. Personally, I like writing C++ (I know, I' know, I'm also probably insane), so I like to mix C++ with various scripting languages. You could also hack the entire thing together in Ruby or Lua, but both of those might be a little more difficult for you. Ruby is one of my all time favorite languages, but it requires you to think a little differently about programming.


Quote:

3. My old MUD used a lot of archaic coding that - according to modern articles - is very inflexible. That being the case, what should I look for to increase the game's flexibility?


Most MUDs are written in systems languages that are compiled and run. This means every time you want to integrate new changes you need to restart the game. This is inconvenient and annoying sometimes (depending on how your workflow is), but you can get around it with techniques like copyover/hotbooting. This allows you to restart the game while maintaining your list of connections. You can also obtain a lot of flexibility through good, dynamic design techniques. However, with systems languages (like C/C++) there can be a lot of work to maintain large degrees of flexibility.

One more modern concept is to have your core components written in C/C++ and to outsource game logic to a scripting language (like Lua or Python). This is nice because the stuff that tends to change a lot (game logic) can be updated on the fly and there is no need to reboot the game.

However, unless you are expecting a lot of connections or complex game mechanics, you could just opt to make the entire game in a scripting language (Python, Ruby, Lua). With the correct techniques you could easily set up a system similar to that described above (having scripts specifically for game logic that are separate from the rest of the base) without the need to handle two different programming languages.

What is best depends on the specs of your game and the host you plan to use. In the end there tends to be little reason to not do all of it in a scripting language though. My only exception is typically for learning purposes.

Quote:

4. What's the easiest way to create a MUD (using new design and language) that I can host on my own computer for my own improvement and design before making it available to anyone else? Are there any specific programs that I should be downloading (aside from MUD clients) to help me in this task? (All of my old work was done in Notepad and Ed().)


You have a couple of options in terms of running/working on the server locally. Your best option, of course, is to run Linux. Ubuntu is a user friendly distro that can be easy to learn with. Linux is also free, so there is no cost to download it and play around.

If you run Windows and would rather not give it up then you can use Cygwin, which emulates a Linux environment on Windows. This is generally a less than ideal option given the need for Cygwin specific updates to packages and limited access to optional libraries. A far better option is to run your own virtual machine using something simple like VirtualBox. Using VirtualBox you can run Linux (say, Ubuntu or Debian) on top of Windows. You can share folders between the host system and guest system, which makes editing files convenient if you have a favorite code editor on Windows. You can also bridge your network connection so you can connect locally and across the net.

Quote:

5. Are there any superior websites (besides this one) that offer tutorials or examples of new MUD creation, codebases and servers? Most links that I've found lead to Error 404's.


A lot of the old resources have indeed gone down. However, MudBytes (http://www.mudbytes.net/) is very much alive. They have forums, a MUD list, code repository, and more.

Quote:

6. How am I doing on keeping it brief? ;)


About as good as I am :P

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 04 May 2011 07:22 AM (UTC)
Message
It is hard to know what to add. The previous responses have been very pertinent and relevant.

I have in the past started a few server projects. One at least is here (a pretty minimal one).

If I ever started again (along the lines of what you are proposing) I would carefully consider the very things that usually bogged me down when I got a few weeks into writing a new server, such as:


  • Management of spawned objects. That is, as a designer you might create the specs for a steel sword that does 5 hp damage. But the server has to create perhaps thousands of them and put them on mobs, in inventories, etc. And some will have differences (eg. wear and tear, enchantments, curses) so you need to keep track of that somehow.

  • Disconnecting the connected player from their character, at least to an extent, so it is possible to do things like be mind-controlled, stunned, etc. And so you don't just escape from a fight by dropping the connection.

  • You may want to think about some sort of more modern user-interface. We have had lengthy discussions about that in the past. Some people think that anything that is not pure text is "not a MUD", whilst others think that an enhanced user interface is just moving with the times.


Certainly you could write from scratch. C++ would be my choice there, and read up on STL (standard template library) because that makes managing strings, lists, maps etc. so much easier.

Another approach is to code entirely in a script language. I had a fairly simple MUD server written entirely in Lua a while back.

Or, a hybrid design. The core in C++, but things like mob interactions, fights etc. done in a scripting language (eg. Lua, Python). As an example of that in action, Aardwolf has a quite extensive Lua scripting interface. Whilst the server is not open source, the scripting interface is well-documented.

PennMUSH is quite a good idea, the server itself is written and has a lot of flexibility in it. I'm not sure how good it is as a "combat" server, it wasn't designed for that originally.

Or, try SmaugFUSS, which has been tidied up, and is a nice "combat" server, freely available, and you just need to make your own areas. However modding it to add novel features might prove challenging.

Quote:

What's the easiest way to create a MUD (using new design and language) that I can host on my own computer for my own improvement and design before making it available to anyone else?


Using Cygwin is probably a pretty good way, if you are using Windows. The end-result should be easily transferred to Linux later if you need (eg. for hosting). If you have a Mac, just use the Unix tools.

Organization is probably the key thing here. A MUD server quickly grows to dozens of files, so splitting things up (source-wise) into player/objects/rooms etc. early on is a good idea. Likewise data files (eg. directories of rooms).

And if possible make it so the MUD itself discovers the installed areas. For example, rather than having to read an "area list" file, just scan the directory which has room definitions in it, and load them all up. This makes it really easy to add or take away areas.

Good luck with your project.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Serenity   (18 posts)  [Biography] bio
Date Reply #4 on Thu 05 May 2011 12:11 PM (UTC)

Amended on Thu 05 May 2011 12:17 PM (UTC) by Serenity

Message
I have programmed a C++ Mud Engine that uses XML (for data) and lua (for scripts). I can say that it took me quite some time to get right. It's written completely from scratch and is about 30K lines of code. I allows multiple mob scripts per mob and can run thousands of lua script simultaneously.

That said, I'm not a builder, so I'm still looking for a creative person to craft a world based on my engine. That way I can see if the engine's missing features.

Some features that are different from other engines:
- instances (like on many mmog's)
- individual item/mob spawn rates
- combat system based on World of Warcraft system
(item ratings etc)
- drop tables for loot
- only has my feature-demo areas.

so I can save you the C++ part. Let me know if you're interested.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


27,292 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]