LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2006, 02:53 PM   #1
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Rep: Reputation: 15
Lightbulb Considering writing a server for a virtual world (text-based, like MUD) - Which lang?


I am considering building a multi-user world (similar to a MUD, in principal) where users could telnet/mud-client to the server and play. However I'd need it to be able to multithread and allow for multiple users to be logged in at once.

I know the traditional language of choice would be C/C++, but I'm wondering if there'd be another language that'd be easier. (I'm just getting back into software design, and am interested in trying new languages.)

The system would need to be such that it could be easily ported between OSes with little or no code modification.

I was also considering integrating the world with a MySQL database.

Which language would you suggest, and why?

The server needs to be able to not only manage numerous clients simultaneously, but it must be able to communicate between different users, send large amounts of data (e.g. send files b/w users while in-game) and various other tasks.

Any suggestions?

Also, would anyone be interested in working on a project like this?

(( If you've ever read Snow Crash by Neil Stephenson, imagine the Metaverse, only text-based (for the moment). I know Linden Labs created Second Life, which is similar... But I'd like to create something a little different. ))

Any ideas/comments would be greatly appreciated!

Last edited by iceportal; 09-21-2006 at 02:54 PM.
 
Old 09-21-2006, 03:44 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Well Java's easy with less to worry about with the memory management and even has the Enterprise Edition for use with webapp servers like Apache-Tomcat, but Python is also multi-platform, object-orientated etc. and the latest version, 2.5, was just released. You may have more fun adding the mysql support module, and getting used to the whitespace vs {} use.
 
Old 09-21-2006, 04:04 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Just choose the language you feel most comfortable with. If you plan to have a small number of users, you have a very wide choice. If you need to support quite many users, however, think about performance, load balancing and so on.

Also, there are really many MUD or MUD-like engines. It takes quite a long time to write a good one, so it may be a good idea just to take an existing ones, apply needed patches (if any) and deal with the world, not the engine.
 
Old 09-21-2006, 11:35 PM   #4
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
@Proud: I considered Java, as I've used it before and am quite familiar with its syntax. However, I've recently been wanting to learn Python... Maybe this would be a good way? Though it'd be a good bit difficult at first. I think Java would be a good choice, as most users have some form of Java on their machines (Windows/OSX/Linux/Solaris all come with support, and I'm pretty sure BSD and HP-UX do too. Not that anyone's going to game with HP-UX...) It would be easier for the less-tech-savvy to use a Java system.

@Mara: I've considered using a premade MUDbase, but the one I like most is CircleMUD, and it's not (from what I remember) completely open source. (e.g. I couldn't include it with Debian, due to the DFSG.) The CircleMUD license is somewhat restrictive. Also, I've had little success getting any other codebase to compile properly. (Maybe I'd have more luck now that I've got more linux experience.)

All in all, the fact is that the codebases I like are all C/C++, and I'd prefer something a little more portable. One compile, and that's that.

Java seems right for the job.

Now I've gotta get back into my Java swing...

If anyone out there is interested in working on this project with me, please let me know!

And if you've got any other suggestions, I'd be grateful!
 
Old 09-22-2006, 04:29 AM   #5
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Just some more stuff FYI: Python is definately suited to networked programs such as this, with strong string processing and internet protocol support. Also if you've ever used functional programming languages you may quickly come to love the slice notation. Creating stand-alone portable apps is supported too. Lastly, Google's been using it for years!

Btw, when you said you may be using MySQL, did you mean just for the server program that you'll be maintaining, or were you planning to release that too? Because then you may want to look into other databases like Berkely DB, which is as I understand it, more file-based than relational, but with a management layer to make life easier for all, and easy to distribute.

Last edited by Proud; 09-22-2006 at 04:30 AM.
 
Old 09-22-2006, 10:44 AM   #6
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
I was thinking that I could use MySQL to store world data, including room descriptions, item descriptions, user-made scripts, actual files, and various other things.

I'm not sure, though, if it would be feasable to bundle MySQL with my software... Could become trouble.

It might be better to do it the Traditional MUD Way and just have everything in individual files.

I'm going to allow users to create their own world on their own computer, as well as items and such. And items/rooms/etc will be scriptable in a simple script language, so that they can generate their own content (e.g. LSL for Second Life).

It's an extremely complex idea.

- Users will have the ability to host their own server, seperate from the main server. This server would be accessible to them offline (e.g. loopback) so that they could create when there's no internet connection. When they're online, they could invite other users into their server (in which case those users would be transferred from the main server to the users' personal server.
- Users can travel between servers and make links between servers. However, users may only make links to places that are public access - a user couldn't make a permanent link into another user's server unless the second user gives explicit permission. However, they could connect to any public access linkstation on the main server.
- Users can create their own world while in-world (like a MUSH, you can build while you play). They can only modify items they've created or rooms they own. Exception is if someone gives them explicit permission to modify their rooms or items. (Similar to Second Life, again.)
- Items and rooms will be scriptable, in a simple, easy-to-use language. There will be limits on scripts, of course, so that nobody creates anything too.... mean.
- Users can attatch real-world files to items in-game and transmit them to other users. For example, if you downloaded the text to Oscar Wilde's "Picture of Dorian Gray" from the Gutenberg Project, you could create a book in-game and attatch the file to it. Then, you could give it to a friend, and they'd be able to take the file from the book and have their own copy of the file. (FTP, maybe?)

I'm not sure how I'd want to structure everything though, in terms of licensing. I'm thinking I'd GPL everything, since I'm allowing everyone to run their own servers, but this could lead to trouble if someone starts running a custom build and links up to the main server. Maybe include a warning for users, stating "You may visit other users' domains, but be warned: they're using their own personal server, and the rules there might be VERY different from the main grid."

It would also open me up to hackers, but at the same time it would allow others to help me fix problems faster...

Meh, I'll GPL it.

...

Well, I'm thinking I should stop spewing all this information here, make a SourceForge project instead.

With a basic idea, though... Do you think Python would be good for this?

Last edited by iceportal; 09-22-2006 at 10:47 AM.
 
Old 09-22-2006, 12:04 PM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Though I haven't worked with Python myself, everything I've read and seen indicates that it will work well, unless you are looking for extremely high performance. I used to be an administrator/owner/coder on a MUD, and it was completely written in C. We eventually had a codebase in the 100s of thousands of lines... a language that supported classes would've been nice. Too many similar functions: char_to_room(CH *player,ROOM *rm);, etc.

It definitely sounds like you have an interesting project going here, though maybe a bit on the ambitious side.
 
Old 09-22-2006, 12:18 PM   #8
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Quote:
Originally Posted by iceportal
I'm pretty sure BSD and HP-UX do too.
FreeBSD has official Sun JDK / JRE binaries; other members of the BSD families don't. However, many other BSDs can run Linux and FreeBSD binaries under emulation. Plus, there are decent free (in all senses) Java virtual machines out there. (Most specifically I'm thinking Kaffe.)

Last edited by taylor_venable; 09-22-2006 at 12:19 PM. Reason: Incorrect "quote" tags.
 
Old 09-22-2006, 12:21 PM   #9
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Ambitious as hell, I know.

Especially since I don't know Python.

From what I've seen, though, Python could well be the language of choice for this project.

The website states that it can be learned in a few days, so I'm assuming it's not the most difficult language to learn, though having been used to C/C++/Java syntax, it'll be an interesting switch getting to know Python.

First, though...

I want to document exactly how I want the system to work.

Extensive, extensive planning.

I want there to be no question about how this thing should exist.

Granted, I can't account for every possibility, but consider the system a base for an extendable environment. Much like the Linux Kernel is the base for an extendable OS. The basic server would start with the default server settings and a single, plain room. Nothing more, nothing less. All content within the world would be added by the users. (The main server, of course, would be maintained and created by the main server administrator.)

Now I'm using this thread as a brainstorm session... Hope nobody minds.

If any of you have ideas you think would be fun to implement into this system, let me know!
 
Old 09-22-2006, 12:23 PM   #10
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Java networking isn't that difficult, but I'm not sure how easy it would be to implement command parsing and such... I don't know much about threads or other advanced features, either.

And if Python is as simple and powerful as it sounds, I'm thinking I'd love to learn it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't read mud-list with Gnome mud blastradius Linux - Games 1 12-01-2007 05:55 PM
Best server distro for Mud + Newbie. DBUK Linux - Distributions 1 09-16-2004 06:56 AM
Apache, I Can not get Name based Virtual Server to work kcasey Linux - Software 3 01-23-2004 11:09 PM
Webmin Vitualmin SUEXEC Apache Virtual Named Based Server Setup Questions ? Confused! wishiwas Linux - Software 0 12-02-2003 09:47 PM
Mud Server quozt Linux - General 1 07-31-2003 08:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration