[vworld-tech] Python

Richard richard at ccpgames.com
Wed Apr 27 01:31:36 PDT 2005

> On Behalf Of Brian Hook:
> Subject: Re: [vworld-tech] Python
> > We were using Python extensively on UO2 before it was cancelled,
> > and the result at least _looked_ very elegant.  Unfortunately, the
> > game never shipped and so my main concern at the time, that it
> > might perform poorly under load, was never tested.
> This is a legit concern, but for me I'm not worried about the 
> scale of 
> something like UO2.  If Python can handle
> I know Eve Online used Stackless Python, but I don't even know what 
> the hell that is, so I guess I should look into it =)

I use Stackless Python for my personal MUD server.

Where Twisted uses some Deferred construct to build a flow of
execution around a blocking call in what seems to me to be
an awkward way when you have Stackless at your disposal, a call
to my networking code takes the calling tasklet, stores it until
the result comes in and then returns to it the result.  So you
get a clean blocking function call at the higher level and your
other code in their own tasklets continue to do their thing.

This is basically what EVE Online does.  It also adds its own
custom networking layer on top and because unlike my MUD project
it has clients and servers both executing Python code the
networking layer allows simple connection to remote objects and
then calls over to them, all in the same normal simple and
readable style that a local function call would do and exceptions
are also handled naturally, whether they happened locally or
remotely.  This is of course not that hard to implement, but
way too much for my personal MUD server.

I considered trying Twisted for my personal MUD server but
I have always found it hard to approach and to use it with an
otherwise Stackless codebase always felt like settling for
something less usable and less readable and the main joy I 
get from programming in Python is the readability of the
code and ease of use.

As for how well Python based networking solutions scale, on
behalf of my personal MUD server, I cannot judge.  But I
would be surprised if you had problems handling 100 users
on one game server given the extent to which EVE Online uses

My MUD code is a really messy, never having a need to be cleaned
up and only being worked on occasionally, but if anyone is
interested in seeing it as an example of how it might work
if you did it badly just to get it working, I can maybe send
you a copy.  I hate talking about this and not being able to
go into detail about how EVE Online might do things, and I also
hate releasing code given the predilection for people to steal
released code bases (as I am still observing with my LPC code
base to this day, it having been around about 8 years), but
letting people who might be interested in seeing an application
of Stackless in MUD server, see my code is something I can do.


More information about the vworld-tech mailing list