Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Perl for MMORPG Server

by saberworks (Curate)
on Jun 27, 2004 at 04:11 UTC ( [id://369914]=perlquestion: print w/replies, xml ) Need Help??

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

While browsing the shelves of Barnes & Noble and reading the pages of Massively Multiplayer Game Development, I have come across a disturbingly high number of people recommending Python for MMORPG servers. Since I'm not a big fan of the Python syntax, and I have been using perl for quite some time, I was wondering if there are any advantages of choosing Python over perl for this type of program.

Basically, there will be a 3d coordinate system and the server will have to handle physics, collision detection, network connections, authentication, player actions, NPC AI, battles, load balancing, etc.

Any opinions on whether perl would be a decent choice for this (over Python)? Any suggestions as to writing some fairly simple-but-applicable benchmarks?

Replies are listed 'Best First'.
Re: Perl for MMORPG Server
by skyknight (Hermit) on Jun 27, 2004 at 12:45 UTC

    Why should that necessarily be disturbing? Python is a perfectly nice language. Instead of being a language bigot, take the time to use several different languages and learn their strenghts and weaknesses. I truly love Perl, but it's not the right tool for every job. There are plenty of times when Java, Python, LISP, C or even some highly specialized mini-language make more sense.

    Have you ever written code in Prolog? Try doing that, if you really want to twist your brain in ways that will make you appreciate the power imparted to you by learning to choose the correct tool from a set of them.

    I think the biggest strength of Perl is how its rich syntax allows for very expressive code. This, of course, is also a double edged sword. Really advanced Perl code can also look like line noise to the unitiated. Python, on the other hand, is less "powerful", but perhaps deliberatedly so. It has a much cleaner syntax, and was written from the ground up to be an object oriented language. As such, Python does not cause nearly the degree of culture shock when non-gurus approach it, and it may thus be a more desirable language when trying to pull in people from an eclectic background. Its syntax is very C-like, and nearly everyone has written C.

    All of this high level philosophizing aside... A very simple argument for using Python as the language for an MMOG is that powerful utility libraries may have already been made available in Python. Irrespective of whether Python was initially the best choice of language, it may now be the best choice simply because of momentum. Did you know that the width of standard gauge rail is based on the width of a horse's ass?

      See, that's exactly what I'm trying to ASK. I'm not stating that perl is better, I'm asking whether Python is actually better, because I'm willing to use Python if there's a compelling reason to. Articles and books have asserted that Python was great but failed to support that argument with anything factual.
Re: Perl for MMORPG Server
by fglock (Vicar) on Jun 27, 2004 at 05:03 UTC

    a disturbingly high number of people

    That's a good thing. How about to reuse their code, and then start writing Perl extensions?

    As with other network based applications, I don't think the benchmarks would show significant differences between languages.

Re: Perl for MMORPG Server
by valdez (Monsignor) on Jun 27, 2004 at 09:04 UTC

    Not related to Perl, but ACM Queue dedicated an entire volume to Game Development: ACM Queue Vol. 1 No. 10.

    Ciao, Valerio

Re: Perl for MMORPG Server
by simonm (Vicar) on Jun 27, 2004 at 10:40 UTC
    For what it's worth, take a look at PerlMoo, now Mooix. I'm not sure that any of this code would be directly usable in your project, but it incorporates a number of interesting ideas that might help you approach this problem. (Relevant docs are here and here.)

    Janitored by Arunbear - fixed PerlMoo hyperlink

Re: Perl for MMORPG Server
by adamk (Chaplain) on Jun 27, 2004 at 06:58 UTC
    I'm trying to understand what you would actually need to make the MMORG happen. Vast chunks of shared memory? Large numbers of processes/threads?

    I know perl 5.8.x is now supposed to have stable threads, but it this within it's reach?
Re: Perl for MMORPG Server
by andyf (Pilgrim) on Jun 27, 2004 at 19:10 UTC
    MMORPG servers.

    I'd say Perl is your perfect choice. I can't attest to the merits of Python but lets look at your requirements list shall we?

    3d coordinate system

    Math::Big
    Games::3D - looks like an interesting starting point
    Use big floats to define your object base 3D. Use nested relative rather than global absolute system if you want the universe to grow without bounds.

    physics

    Physics::Particles
    Physics::Springs


    collision detection

    Math::Matrix
    Math::Vector

    network connections

    Perls net capabilities are vast, start by looking at these.
    Net::Server
    IO::Socket
    Net::Socket

    authentication

    Authen::* - all kinds of authentication

    NPC AI

    Games::AIBot
    AI:Fuzzy
    AI:Categoriser

    battles

    Games::Object
    Games::Maze

    simple-but-applicable benchmarks?

    I've written a couple of games using UScript (Tim Sweenys Unreal scripting language) which is fairly clunky interpreted Java. I would put it alongside Perl in terms of practical all round speed, so I don't see any reasons Perls performance should bother you. The only hardcore code needed is where you have collision detection for hundreds of objects going on at once, and/or too many traces. If you want real time action physics you shouldn't be using a fat server model anyhow, you need replicated object physics and you will need C for speed here. As I understand it MMORPGs span many servers, so you should build 'load balacing' right into the framework of your universe, that is each server handles parts of the universe that are not only local and relevant to it, but are within its capabilities to compute. For a complex and diverse problem like this, I really can't think of a better language than Perl.

Re: Perl for MMORPG Server
by MrCromeDome (Deacon) on Jun 27, 2004 at 18:30 UTC
    Disclaimer: I am hunting down the article in which I read this, so keep that in mind before --'ing me ;)

    From what I've seen of the MMORPG community, a lot of them choose to develop their game backend and content with Python because it is allegedly easier for non-programmers to pick up and work with than other languages such as C, C++, and Perl. Not knowing the former but knowing all the latter well, I cannot attest to the truth of this statement.

    That being said, I've had an easier time teaching people C and Powerbuilder as a first language than I have Perl? Why? I'm not 100% certain, but I'm guessing it's because there are so many ways to do things in Perl. I love TIMTOWTDI, but I can see where it is overwhelming for a new (or non) programmer. Personally I'm glad I learned other languages before Perl - I appreciate it that much more.

    Coming back from that tangent, I do have to say I've been tempted on too many occasions to try to write a game engine in Perl. Something that I didn't see mentioned is PerlMUD (unless it was and the name changed???). Worth a look if youre curious.

    Good luck and have fun!
    MrCromeDome

Re: Perl for MMORPG Server
by coreolyn (Parson) on Jun 28, 2004 at 12:42 UTC

    Beneath my career in IT is a game programmer that's been looking to design/write a MMORPG since long before the acronym existed. I too wanted to use Perl when I learned it, but as I came to understand the scale and scope of the project I wished to persue I realized Perl would not be the optimal language choice. There may be some places where some 'glue code' would be needed and it could well be that Perl would be Perlfect for those pieces.

    Python is a language that you will probably need to know as one of the most demanding pieces of your project will be in creating 3D models and as the cost of modeling software is so high you will probably want to use Blender. Blender has a Command line interface for Python already in place. When it comes to Physics and AI engines don't forget the "Massivley" in MMORPG! While I'm thinking that either CORBA or Possible and EJB might be the correct vehical for distributing information between the objects, C/C++ strictly for the speed requirements continues to be the best candidate.

    Just my .01

      POE has good support for message passing across servers/instances.

      Just the other day (as both my MMORPG games went down for maintenance at the same time) I was thinking about how to engineer those server farms to support dynamic updates. And POEMMORPG has a good ring to it.

      --Solo
      --
      You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

      I've been playing with Blender since March. But I didn't even know it had a Python CLI! :) I don't expect to master it until the end of the year. One of the nicest and fun pieces of open source code I've used. The interface is a pig to master if you have previous experience in 3DMax/Milkshape/Unreal, but when you do get used to it you start to love it. They recently reactivated the games engine which is part of Blender too, version 0233, I haven't looked at that yet. Also sitting on my disk is a folder called Crystal Space A friend of mine in Canada put me onto this a year ago, and he is in a team developing a game with it. So far I ran the demos and wrote a 'hello cube and light' world. Crystal space looks very impressive in scale, its also very open ended programatically the demos show HUD and menu interfaces, particle systems and all sorts of goodies for the games developer. Perl and Python are usable here. Let's not forget Gimp for 2D, which is also Perl scriptable, perfect for procedural textures.


      Games development is rather costly in time and skills. It's rare for one person to be capable of doing it all. The last mod project, SAS I was involved with sucked up 60 man-years of labour at least! You are very very lucky in this world if you happen to be a great 3D modeller, and a good coder, and sound designer, character animator, voice artist, musician, texture artist, level designer and tea maker. Thats what you need to make all the content. Skilled coders who start out to write a game usually make a nice engine and thats where it ends, they never reckoned on the cost of the content (one impressive exception is WoutersCube). I'm guessing that with modern games the content outweighs the engine development by a factor of 3 to 1 at least. The perfect solution imho is to make a framework that is so extensible that the players write their own content. Can't you already do that in Sims in a weak kind of way? I confess not have gaming experience with MM, I tend to prefer FPS realtime and strategic combat (Operation Flashpoint) which are limited to 30 or 40 players and a few tens of square kilometers space. Once a game like this gets released the community write the content. Presently OFP 3rd party content dwarfs the original Bohemia Studios release. The reason I think OFP and Unreal are successful, and why I stay with them, is that despite being proprietry software they are very open in releasing development tools and documentation to the community (plus there are many fanatic gamers who reverse engineer and document too). For open source I think there is a definite gap for a killer game, proof of concept of integrating all the above tools. I'm sure this team already exists if you look for it. Good luck, If you do find out let me know, I'd be very interested.

      >Beneath my career in IT is a game programmer that's been looking to design/write a MMORPG since long before the acronym existed.

      I know this is a Very Late post to an Old thread, but: Me too.
Re: Perl for MMORPG Server
by Dotcher (Initiate) on Jun 29, 2004 at 00:40 UTC
    I believe that most modern MMOG servers are built primarily in C/C++, with Python/Perl/Lua/whathaveyou used for scripting various parts.

    Owing to the amount of data these things have to handle, and quickly, I've a feeling that networking, object management, physics and the like are best done in C/C++ or the like.

    As for Python over Perl, I've been told (but have no personal experience in this, mind), that Python has a cleaner embedding interface than Perl.

    Personally, I'd prefer to use Parrot for this sort of project - best of all worlds. However, there's the slight limitation that it's not done yet...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-24 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found