Please check out Rage of Vengeance !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. Mud In Python? Wed Jun 30, 2004 [8:43 PM]
zylr
Email not supplied
member since: Jun 30, 2004
Reply
Im just wondering if anyone can give me a good reason not to write a mud in Python with the Twisted Matrix framework. I have not been able to find a MUD done in Python. So if anyone could tell me why or why not and if i should use the Twisted Matrix APIs, it would be appreachated.

And, i cant spell.


2. RE: Mud In Python? Wed Jun 30, 2004 [9:27 PM]
AdamMil
Email not supplied
member since: Sep 10, 2003
In Reply To
Reply
If you are expecting to find a flourishing Python-based MUD community, then I think you answered your own question.
http://www.tigermud.com
TigerMUD's goal is to be a simple, extensible Windows MUD server in C#. SharpDevelop and Mono let TigerMUD run on Linux.


3. RE: Mud In Python? Wed Jun 30, 2004 [9:40 PM]
xael
Email not supplied
member since: Jun 3, 2004
In Reply To
Reply
Well, my friend managed to code a working 'socket accepting program' with a command interpreter in about 56 lines.

So, i'm thinking Python would probably be a very good choice. And though there may not be a flourishing Python based community, Python is EXTREMELY well documented (plus, if you know what you're doing, then you won't really need that much help anyway)

**DISCLAIMER**: I know very little about Python code. So don't take my word. I suggest doing lots of research.


4. RE: Mud In Python? Wed Jun 30, 2004 [11:24 PM]
muir
Email not supplied
member since: Sep 14, 2003
In Reply To
Reply
The standard Python network libraries are absolute waste; that being said, it'd probably take you less time to write your own server (five, six hundred lines) than it would to learn the TM API from what I saw :)

.


5. RE: Mud In Python? Thu Jul 1, 2004 [1:10 AM]
thyrr
Email not supplied
member since: Nov 21, 1999
In Reply To
Reply
I've done it both ways. Just setting up a simple telnet server is pretty straightforward with Twisted Matrix, and it takes care of the details so you don't need to write your own telnet stack.

As you pointed out, the Twisted documentation definitely needs works though, and I haven't figured out how to use any of the other twisted dot products. It took a whole 5 minutes to figure out how to get the client's IP address -- connection.transport.getPeer().host .

But at least it's cleaner than my old homebrewn asyncore-based telnet server code ;)


6. RE: Mud In Python? Thu Jul 1, 2004 [4:41 PM]
zylr
Email not supplied
member since: Jun 30, 2004
In Reply To
Reply
Well, i already know a lot about python, and TW, so i think its the way to go. I guess i would write several classes. the TW Protocol and Factory of course, a command parser, one for login and i guess one for mysql connections, if i used MySQL for rooms and players(should i?).

Sound good?


7. RE: Mud In Python? Thu Jul 1, 2004 [7:55 PM]
thyrr
Email not supplied
member since: Nov 21, 1999
In Reply To
Reply
Whether to use MySQL (or any other managed database) is a significant discussion on its own. You probably want to think very carefully about it, and maybe search for threads in the forums. If you do, Twisted has classes to make things easier than Python's not-so-great DB API.

There are also other options like ZODB, an object-oriented database designed for Python.


8. RE: Mud In Python? Fri Jul 2, 2004 [5:02 PM]
zylr
Email not supplied
member since: Jun 30, 2004
In Reply To
Reply
What do i loose by doing it with mysql?
Also, i was wondering how Python compared to Java in mud programming.


9. RE: Mud In Python? Fri Jul 2, 2004 [7:30 PM]
thyrr
Email not supplied
member since: Nov 21, 1999
In Reply To
Reply
I don't use MySQL, so you'd have to ask someone else, but I think pure Python objects would be faster than fetching from a database. Depends on caching, how often you need to access new data, how large the world is, do you need searching/indexing, etc. And whether using the database for storage, or keeping your objects in there. I don't know if it's significant or not.

Java would be faster, but not as flexible, IMO.


10. RE: Mud In Python? Sat Jul 3, 2004 [1:18 PM]
xael
Email not supplied
member since: Jun 3, 2004
In Reply To
Reply
We use MySQL (as opposed to File I/O, but we're using C, so maybe file io is better in python. iunno) for tons of stuff, including our room and help database, and eventually our player files and bulletin boards, etc. So far, i've found that it compliments (once again, I only know for C) the MUD EXTREMELY well, as well as giving us the option of doing stuff online later if we want to. If you know enough to get MySQL working with Python, I would suggest going for it. :D


11. RE: Mud In Python? Thu Jul 15, 2004 [8:35 AM]
Sorceror
Email not supplied
member since: May 15, 2003
In Reply To
Reply
I think Python is a splendid language for a codebase. I created a framework codebase complete with server, database, and event handler in less than 800 lines. Better yet, every object in the game is represented by a python script file, so no worrying about having to script in another language.

Still working out the kinks, but when it's presentable I'll post a link to the sourcecode on this thread.

As for Twisted Matrix, never heard of it.


12. RE: Mud In Python? Sat Jul 24, 2004 [5:53 AM]
Sorceror
Email not supplied
member since: May 15, 2003
In Reply To
Reply
You can download the un-documented, un-exampled version of the source code at http://www.rosegiver.com/AMud/MUDPyE%20v0.1.rar. Someday soon I'll write some documentation. Have fun with it.




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]