11 Oct, 2006, ThomasB wrote in the 1st comment:
Votes: 0
Hey,

this would be my first post, so I hate to start off by asking for help, but I could sure use some help.

For my Computer Science III course, independent study, I finally decided on creating a MUD, and I'll spend the duration of the year creating the MUD, fixing issues that arrive and then maintaining it.

After looking around a bit, with Google and Ask.com, at MUD-creation tutorials I realized several things. First: These tutorials are AWFUL. Second: I don't know the first thing about servers and hosting. Third: I don't understand the notion of code bases. If y'all are willing, I'd love to address these in order. :biggrin:

Ignoring the first… I suppose. Hah!

Second: I don't know the first thing about servers and hosting.
The fact that I'd need to put this all on a server didn't even occur to me when I thought about doing this. Just testing a compiled file doesn't say much, how will it interact over a server with people not on my computer? So I start poking around. Most free, online places to host don't want to have a program running 24 hours a day, if they're even able to do such. I also want more control over my game, rather than letting someone somewhere else hold onto it for me. I managed to get my hands on a laptop from a friend. If I can get all the malware off of it, I can use it for the duration of the school year. I figure I'll just put my server on that. That sounds good in theory, I suppose, but I don't know much else. The next problem is, let's say I have a game. It's compile and in some file (or several, more than likely), how do I telnet to it? What makes telnet interact with the program? I've looked around a bit, and I just can't find the answer to this. It's driving me insane. (If I have to put UNIX on the laptop, I'm okay with that. I can always have two operating systems, it's running XP home edition at the moment.)

Third: I don't understand the notion of codebases.
Everything I've read goes something like: Write your game in c++ (or some other language), but use DIKU, SMAUG, this or that. This seems so contradictory to me! How do you write your program in C++ and use SMAUG or whatever? And how about writing codebases? How is this done?

I know this is a lot to ask, so if you only want to answer some of it, go for it, or none at all! Links to tutorials, anything, it's all very appreciated. Thank you very much, and I can promise when I manage to learn a bit more I won't be a bother, I'd love to start contributing with code samples and advice etc. etc.
11 Oct, 2006, Davion wrote in the 2nd comment:
Votes: 0
Quote
The next problem is, let's say I have a game. It's compile and in some file (or several, more than likely), how do I telnet to it? What makes telnet interact with the program? I've looked around a bit, and I just can't find the answer to this. It's driving me insane. (If I have to put UNIX on the laptop, I'm okay with that. I can always have two operating systems, it's running XP home edition at the moment.)


I'd first off sugest using a *nix based OS for this, seeing as most of the support out there (in this immediate community) revloves around said OS. That, and I've never even bothered to figure out winsock so I can't comment! Linux atw!

Now, how will you telnet too it? You'll have to write a listening server code. Basically you pick a port, bind to it, listen, accept new connections, recieve input, process, send output. For that, google around for Beej's guide to network programming. Great resource on figuring out how to write streaming sockets (that is, if you're going to use C/C++)

Quote
Everything I've read goes something like: Write your game in c++ (or some other language), but use DIKU, SMAUG, this or that. This seems so contradictory to me! How do you write your program in C++ and use SMAUG or whatever? And how about writing codebases? How is this done?


DIKU and SMAUG are codebases written in C (although some have been ported to C++.) Now, what a codebase is, is a game server with features already added. It already handles command interpreting, input and output, world interaction, objects, mobiles, etc. It has a database, may it be SQL or flat files, etc. It's just something people use so they don't have to start from nothing. There's many chunks of code in our repository here that will show you what I mean. If you're more comfortable with C++, check out one of the C++ codebases (I'd suggest Murk because it's pretty small compared to others)
11 Oct, 2006, ThomasB wrote in the 3rd comment:
Votes: 0
I suppose I'll start off and download a unix somesuch then. Any suggestions? I'll be starting from scratch on this, but my dad uses UNIX on a daily basis and I have several books lurking around my home office. I can learn. It's something I've been wanting to try anyways.

So for me to make sure what I've got is correct.

You're saying to make telnet work, I'll need to write, in my code, "when a connection tries to do this, do this"? That makes a lot of sense, and is borderline what I was thinking. Sounds good. I've never come across a DIKU or SMAUG game that I could really get into. I'm a fan of turn based combat etc., and I've never seen a DIKU game that had that. Is it built into the codebase to not allow that, or is DIKU broad enough to were that's not built into it and the designers add it later?

Thanks again, you've shed a lot of light on the topic.
11 Oct, 2006, Davion wrote in the 4th comment:
Votes: 0
Quote
I suppose I'll start off and download a unix somesuch then. Any suggestions? I'll be starting from scratch on this, but my dad uses UNIX on a daily basis and I have several books lurking around my home office. I can learn. It's something I've been wanting to try anyways.


My personal preferences are Debian Linux, OpenSuSE Linux and Gentoo Linux. They're all opensource and free!

Quote
You're saying to make telnet work, I'll need to write, in my code, "when a connection tries to do this, do this"? That makes a lot of sense, and is borderline what I was thinking. Sounds good.

Ya, basically. When you actually get into the programming in c/c++ you'll realize it's a little more complex than that.

Quote
I've never come across a DIKU or SMAUG game that I could really get into. I'm a fan of turn based combat etc., and I've never seen a DIKU game that had that. Is it built into the codebase to not allow that, or is DIKU broad enough to were that's not built into it and the designers add it later?


Diku and derivatives are broad enough for that, although they just don't have it. I do believe we have a turn based combat snippet for ROM (a merc, diku derivative), it was released by Midboss. Should be pretty easy to find.
11 Oct, 2006, Conner wrote in the 5th comment:
Votes: 0
I'm a little late in this conversation, but I happen to favor Fedora Core which is also free, but Cygwin would also work, it's also free, and has the benefit that you don't have to setup a fully dual OS environment as it runs under Windows.

You only need to write your own telnet stuff if you're writing your own codebase, otherwise all the existing codebases will already have that aspect completed for you.

As for what language you're writing your game in, it's going to depend on which codebase you choose. If you go with one of the majority of the diku family members, you're talking C rather than C++.

As Davion already pointed out, there's an existing snippet to add turn based combat to ROM which is a fairly close cousin to Smaug so it could be converted ..or you could look over how it handles it and write your own method based on what Midboss had done.
11 Oct, 2006, ThomasB wrote in the 6th comment:
Votes: 0
Thanks for all the input and for the quick reply. I think I just have one more question for now, and I'll promise to shut up after that :smile:

What all comes for you when you start using ROM, or DIKU or SMAUG and so forth? I read that they handle the connections, and that's a HUGE perk, that's something that is really appealing to me, but what else?

Thanks again! I'm well on my way now.
11 Oct, 2006, Cratylus wrote in the 7th comment:
Votes: 0
ThomasB,

My question is less about *how* you'll get where you're going, and
more *where* it is you're trying to go.

Some of what you say suggests you want to create a mud from scratch.
That sounds like a major, but respectable Computer Science project.

But some of what you say sounds like you're planning to put together
an already-working mud codebase, then modify it. If I were a CS teacher,
I might not be too impressed with "getting a program downloaded and
somewhat modified and compiled".

I think you've done some research and said some things that indicate
you're not trying to be lazy. That's cool. But I'm not getting a real
firm idea of what the desired result is. I also am not getting a feel for
how you'll be judged on it, which I think is an important part of what
I'd need to know to give you advice.

So my first question is, are you actually getting graded? Or is this a
"he showed effort, that's enough." deal?

My next question is, what is it that you *think* is required to get an A?

If just getting a mud up and running is all you need, there are
some ways of doing that in under 1 hour. So I'm guessing that's not
what you're talking about.

What exactly is your desired result?

-Crat
11 Oct, 2006, Remcon wrote in the 8th comment:
Votes: 0
Personaly I would suggest doing one from scratch. Handling the descriptors really isn't that hard nor is the major part for getting one up and compiled. The major things like rooms, objects, mobs, players, descriptors, etc… is where the main work comes in at and even then starting from scratch can probably work out alot better for you.
12 Oct, 2006, ThomasB wrote in the 9th comment:
Votes: 0
Crat,

I want a completely unique world. I definitely do not want to just edit a working MUD. Obviously it'll be similar to some other MUDs just because fantasy is all very similar, but I will have made the world from scratch. I haven't seen/worked with enough MUDs on the coding level (I've done some room building, and I have helped with some logic, but that's about the extent of it) to know if I want to make my own codebase or not. The only alluring part to using a codebase, at this moment, is documentation out there, the ability of people to help me and the fact that some codebases will already handle my connections with TELNET and whatnot (something I know next to nothing about).

My grading works in that I have to have something to show on a moderately regular basis. For this 9 weeks (we have 4 quarters in a school year), I showed him some C++ I had learned in the last class (just some simple math, loops and arrays that I learned in 90 minutes, nothing amazing) and a program for a cell phone that would flash "Welcome" and you could go through menus that displayed other messages, or quit the program. That was very subpar, but we have a new CS teacher this year (a shame, I was madly in love with Mrs. Garcia- haha), so I was limited in my project advancement because I had made prior arrangements etc., so he let it go. On the other hand, he makes up a lot of grades for me because I do a lot of work. I'm in his class everyday (We have block scheduling like a college, so usually you have him every other day) and I come in during my off periods, so he knows I do work so grades do get fudged.

His only firm assignment for my project thus far, has been to come in next class with a basic engine for moving about in the game. I think I'll just throw something together in Java and he'll be none the wiser though, I'm not quite ready to start designing the game at this point, I need to do a bit more research before I jump into that.

The grade isn't my primary concern, it's not a motivator at all. My motivation is that I actually want to do this.

So, to sum up (this is probably my least cohesive reply, sorry): I don't want to edit an existing MUD, I want to create my own MUD and have it work. I'd like to have something to show, and something to connect to (even if I'm the only person that can connect to it) by Christmas (the end of the 2nd quarter).
12 Oct, 2006, Splork wrote in the 10th comment:
Votes: 0
I greatly admire your enthusiasm but looking at this realistically, I honestly don't believe you have have any idea how much work it will be to create a mud from scratch. I happen to work with some phenomenal coders who would have a hard time getting something up in the two months you have given yourself(if they do anything else besides code that is).

Of course there is a chance your idea of a creating a mud engine is vastly different from what I am imagining.

Good luck, its always nice to see people this interested in our hobby.
Splork
12 Oct, 2006, ThomasB wrote in the 11th comment:
Votes: 0
I don't want an entire game in 2 months, I just want something to show that I can connect to. Even if it's just an update on the server, or displays a room I made, or a character (moving or not). I expect to work on this until May, when the school year ends.
12 Oct, 2006, Remcon wrote in the 12th comment:
Votes: 0
Actually, 2 months is more then enough time provided he is able to spend a fair amount of time working on it. For the most part it doesn't take even a month to have well beyond the basics done and working, granted that it depends on what all you want in and how well you understand how all of it fits together. You can also keep it way more basic then the current games and it wouldn't take long at all to do it lol.
12 Oct, 2006, ThomasB wrote in the 13th comment:
Votes: 0
Rather than trying to catch my C++ up to my Java, I've decided that I'll be creating the MUD in Java. I found the interfaces for interacting with SQL files, and I made my first database just a short while ago. Granted it was just a table that held some information about imaginary pets, it's a step in the right direction.

If Java is an awful idea, feel free to tell me so, but otherwise I think it's a good way to go. I read a bit about sockets in a Java book a short while ago, so I know it's doable. It seems like a good idea to me.

I probably won't be using a codebase that's already been made, I'll make my own in the long run I suppose :biggrin:

Thanks for all the help so far!
12 Oct, 2006, KaVir wrote in the 14th comment:
Votes: 0
Splork said:
I greatly admire your enthusiasm but looking at this realistically, I honestly don't believe you have have any idea how much work it will be to create a mud from scratch. I happen to work with some phenomenal coders who would have a hard time getting something up in the two months you have given yourself(if they do anything else besides code that is).


Don't forget, the 16K mud competition took place over only one month, and there were 18 entries!
12 Oct, 2006, Cratylus wrote in the 15th comment:
Votes: 0
12 Oct, 2006, Justice wrote in the 16th comment:
Votes: 0
Sorry for a late reply, but I've been busy for the last week. I've only skimmed the replies, so if I'm covering something that someone else has, I'm sorry.

Personally, to learn a new language, I write a mud in it… yeah, "hello world" is easier, but hardly representative of real problems. I wouldn't worry too much about finding a server and hosting… unless you want it public. For a school project, all that matters is that you are able to prove it works, in this case, you may want to use whatever OS is handy in that class.

The major concerns I have when writing a mud generally fall in this order: managing connections, command parsing, rooms / coordinate plane, objects, mobiles. I generally call them items and creatures (find it more descriptive, and "object" normally has a different meaning in OO languages). Once you've gotten these completed, you should be able to login and "play" it… although there's not likely to be much to do.

Normally in C++/Java, I write an interface called "handler" which I place in a list that the central pulse calls. This lets me control the central game pulse without modifying the central code. You can handle order of execution by the order they're placed in the list. Since it's the core pulse, it doesn't need any parameters.

Anyway, that's what I can suggest. Oh and Java isn't that bad of a langauge for writing a mud in. Just be careful of strings, they are immutable, and with a text based game, you'll be generating alot of them. Earlier versions of java should use StringBuffer, and Java 1.5 > has utilities that emulate printfs.

As for SQL with muds. Keep in mind that connecting to a database and passing queries has some latency. You'll want to handle these in a separate thread, and you shouldn't wait for it. However it's a good way to populate tables and load areas.
12 Oct, 2006, Splork wrote in the 17th comment:
Votes: 0
I am guessing most of the participants of the 16k competition had some knowledge of the inner workings of a mud or in the very least had skimmed a code base or three. In my opinion, from the posts I have read, the author of this thread has not. Which makes this project that much more difficult.

Shrugs, I wish him luck but I firmly stick by my post. But again, my idea of a mud engine is slightly more than a chat room…

Splork
13 Oct, 2006, KaVir wrote in the 18th comment:
Votes: 0
Splork said:
I am guessing most of the participants of the 16k competition had some knowledge of the inner workings of a mud or in the very least had skimmed a code base or three. In my opinion, from the posts I have read, the author of this thread has not. Which makes this project that much more difficult.


That's very true, I was really just responding to your comment about "…phenomenal coders who would have a hard time getting something up in the two months you have given yourself".

Splork said:
Shrugs, I wish him luck but I firmly stick by my post. But again, my idea of a mud engine is slightly more than a chat room…


It really depends how far you want to take it - even several of the 16k mud supported basic combat (among other features). An experienced mud developer with plenty of time on their hands could probably produce a basic game in 2 months, although it would probably lack most of the features associated with muds. But you could certainly create something that several players can connect to and "play".
13 Oct, 2006, Splork wrote in the 19th comment:
Votes: 0
I guess you forgot the rest of the quote…

Splork said:
(if they do anything else besides code that is).


Splork
13 Oct, 2006, Mabus wrote in the 20th comment:
Votes: 0
ThomasB said:
If Java is an awful idea, feel free to tell me so, but otherwise I think it's a good way to go. I read a bit about sockets in a Java book a short while ago, so I know it's doable. It seems like a good idea to me.


Java can be used to make MUD engines. Because of its high resource usage it used to be more prohibitive, but with todays CPU's and memory it is much less so.

Two Java MUD codebases come to mind to me, JavaMud and CoffeeMud. Of the two CoffeeMud has the most current support and an active Yahoo group. Even if you are going to build "from scratch" both of these can be helpful in showing the direction others have taken.

If you want to build a Java engine "from scratch" I recommend reading "Java Examples in a Nutshell" by David Flanagan. Other programming books by O'Reilly can be equally helpful. I think I picked up "Java Enterprise CD Bookshelf" (6 Java books on CD) for less then $10 at a local bargain book store. Your local library may already have all the books you will need.

To get your feet wet in Sockets in Java you could google around the web. A simple example of a multi-threaded chat server can be enlightening for someone starting out with threading and sockets.

Best of luck, and please keep us informed of your progress if you would.
0.0/30