Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Perl MUD?

by Spidy (Chaplain)
on Aug 25, 2005 at 02:18 UTC ( #486411=perlquestion: print w/replies, xml ) Need Help??

Spidy has asked for the wisdom of the Perl Monks concerning the following question:

I know everything is possible with Perl (There's just More Than One Way To Do It), and I've been throwing around the idea of writing a MUD in Perl, just to figure out one of the myriad ways to do it. Does anyone have some ideas or suggestions on modules I might want to check out?

Replies are listed 'Best First'.
Re: Perl MUD?
by superfrink (Curate) on Aug 25, 2005 at 03:57 UTC
    I would start with Net::Server::Multiplex to deal with the networking.

    If you have some relational database experience then you might consider storing the game state in a database. As an alternative you could store the game state in a global hash table.

    There is a program called PerlMUD that might give you some ideas.

    And finally: Have fun with it!

      Net::Server::Multiplex is nice, although if you get enough users connected it starts to eat alot of cpu with idle polling.

      Event::Lib works almost the same way externally, and scales much better if you have a system where you can use epoll or kqueues.

      It was trivial for me to switch to Event::Lib from Net::Server::Multiplex, and the change in performance was unbelievable.

Re: Perl MUD?
by planetscape (Chancellor) on Aug 25, 2005 at 04:30 UTC
Re: Perl MUD?
by saberworks (Curate) on Aug 25, 2005 at 17:48 UTC
    Here is the obligatory "check out POE" post. POE is a cool environment that allows you to do network programming fairly easily. Also check out Perl for MMORPG Server - a lot of good perl game coding links in there. In particular for this MUD question, try Re: Perl for MMORPG Server. From personal experience, it was really easy to get a client/server model up and running using tcp/ip and/or udp and POE. Just don't get scared about the parts you don't understand in their tutorials - they will come in time.
Re: Perl MUD?
by kirbyk (Friar) on Aug 25, 2005 at 15:56 UTC
    What I'd really like to see is not so much a MUD written in Perl (though that's fine), but instead, one that uses Perl as the in-game programming language. (Instead of the lisp-like MUSH code, or c-like stuff in a MOO or an lp/diku.) I spent a lot of time on roleplaying TinyMUSHes in a previous life, and it would be awfully nice to be able to implement the complex systems that people implement (like entire RPG rulesets) in perl, rather than MUSHcode. That stuff is ugly!

    I considered once doing a mod-perl like extention to MUSH, but that was shortly before I pretty much stopped playing. It would be an interesting (if huge) project.

    -- Kirby, WhitePages.com

      Mooix let's you use any programming language you want. In-game actions are basically just programs that are run, so they can be written in anything. The webpage hasn't been updated in a while, but I think the development is still fairly active.

Re: Perl MUD?
by Anonymous Monk on Aug 25, 2005 at 15:41 UTC
    There's a commercial program called 'PerlMUD', by Tom Boutell, of gd fame. I remember first seeing it, and that was 8 or 9 years ago, so I've no idea what state it is.

    I've contemplated the question of how to write a MUD in Perl many times - although I've never even started writing one. Writing a MUD in Perl could mean one, or both of two things: writing the framework in Perl (that is, the thing that keeps the MUD running, similar to for instance 'MudOS', 'DGD' or 'Amylaar') and the language of the MUD itself (instead of for instance LPC or Pike).

    I'd first decide what kind of MUD I'd write (and I don't mean the theme, but essentials like can 'anyone' contribute code (for instance in traditional LP muds, anyone reaching level 20 becomes a wizard and can start writing code) or can only 'trusted' people add code? Should the MUD be able to expand/upgrade on the fly (like LP) or does it require a reboot/restart (like Diku)? Only after deciding such questions, I'd go shopping for software.

Re: Perl MUD?
by kael (Monk) on Aug 25, 2005 at 23:30 UTC
    I wrote a mud in perl a long time ago and occasionally go back and work on it a bit more. It's rather far along but ... it is HORRIBLY written. (It was my first real perl project before i even started coming here...)
    It's at http://northlandsmud.com
    It might give you some ideas...
Re: Perl MUD?
by Anonymous Monk on Dec 05, 2005 at 06:21 UTC
    I've run PerlMud 3.0 using the java app that comes with it -> it's by far the easiest mud to set up I've come across (had to change 3 variables -> url, port, pwd) and set it loose ... I even populated it with a few simple bots to give students (I teach EFL) others to interact with ... but switched over to Lambdamoo/enCore for the superior GUI If you go poking around there's lots of perl muds up and running ... PerlMud 2.0 is particularly popular for some reason ... anyway - the one advantage that PerlMud has over other mud/moos (IMO) is the @reload command - which reloads the mud lib on the fly - no shutdown required ...
      I even populated it with a few simple bots

      I'd really love to know how you did that. Are you sure it was with PerlMUD?

      Is ask because there is no support for bots in the software, so I would have to assume you either implemented them yourself or else you are confusing it with another program.

      Either way I'm interested. (Pity this is an anonymous post, otherwise I'd use the CB to ask directly.)



      Wait! This isn't a Parachute, this is a Backpack!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://486411]
Approved by ysth
Front-paged by halley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-09-25 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (116 votes). Check out past polls.

    Notices?