The Steampunk Empire

The Crossroads of the Aether

Hephzibah Marsh
  • Female
  • Campbell, CA
  • United States
Online Now
Share on Facebook
Share Twitter

Hephzibah Marsh's Friends

  • Terra Rouge
  • Commodore Falcon Kensington
  • Dawn Davis
  • Madame Erzebet Sedwick
  • Misty Joseph
  • Andrei Mihalache
  • Jimmy Diggs
  • Lady. Cog
  • CPT Edward Leviticus
  • Grace Welch
  • Noele Wayne
  • Lady Sophronia Bloodthorne-Clark
  • Latrisha Brown
  • Peter Davis
  • Dr. C Morerless

Hephzibah Marsh's Discussions

Show off your Jack-o'-lantern

Started this discussion. Last reply by Hephzibah Marsh Nov 6, 2013. 18 Replies

As we were strolling through the Museum of Country Life in Ireland, we came across this little gem.…Continue

Tags: halloween, Jack-o'-lantern, pumpkin

Show Us Your Creations for Halloween!

Started this discussion. Last reply by Lisa Rooney Nov 2, 2013. 26 Replies

Halloween is one of my favorite holidays! I love all the creativeness that go into the costumes.Got a costume for yourself? Your puppy? Your children? Yourself? Share and show them off here. Doesn't have to be steamy!This year our plans are to dress…Continue

Tags: fun, costumes, Halloween

Tardis Dress: Bigger on the Inside

Started this discussion. Last reply by Amalia Gilbert Jan 25, 2013. 8 Replies

A collegue of mine sent me this morning from Arisia 2013.  What an amazing dress! With the door closed, With the Door Open.…Continue

Amazon/createSpace new breakout contest

Started this discussion. Last reply by James R. Murray Jan 14, 2013. 1 Reply

Hi everyonne, Thought I pass this on since we have quite a few writers on the Empire! Good luck if you decide to enter. HContinue


Dance my puppets

In many traditional multiplayer text engines for MUD/MUSH/MU*, the player connects to the game with an account name that also becomes their character's in-game name. When they log into the game they immediately "become" that character. If they want to play with another character, they need to create a new account.

A single-login system is easy to implement but many code bases try to expand with some sort of "account system" where a single login "account" will allow you to manage one or more game characters. Matthew “Chaos” Sheahan  beautifully argues for the benefits of an account system in the April issue of Imaginary Realities; you can read his article here.

Evennia and account systems

First a brief show of how Evennia handles this. We use the following separation:

Session(s) <-> Player <-> Objects/Characters(s)

The Session object represents individual client connections to Evennia. The Player is our "account" object. It holds the password hash and your login name but has no in-game existence. Finally we have Objects, the most common being a subclass of Object we call Character. Objects exist in the game. They are "puppeted" by Sessions via the Player account.

From this separation an account system follows naturally. Evennia also offers fully flexible puppeting out of the box: Changing characters (or for staff to puppet an NPC) is simply a matter of "disconnecting" from one Character and connecting to another (presuming you have permission to do so).

The Multisession modes of Evennia

This is the main gist of this entry since we just added another of these (mode 3). Evennia now offers four different multisession modes for the game designer to choose between. They affect how you gamers may control their characters and can be changed with just a server reload. 


Mode 0

This is emulates the "traditional" mud codebase style. In mode 0 a Session controls one Character and one character only. Only one Session per account is allowed - that is, if a user try to connect to their Player account with a different client the old connection will be disconnected. In the default command set a new Character is created with the same name as the Player account and the two are automatically connected whenever they log in. To the user this makes Player and Character seem to be virtually the same thing.


Mode 1

In this mode, multiple Sessions are allowed per Player account. You still only have one Character per account but you can control that Character from any number of simultaneously connected clients. This is a requirement from MUSHes and some slower-moving games where there are communities of gamers who want to conveniently track the progress of the game continuously on multiple clients and computers. 


Mode 2

In multisession mode 2, multiple Characters are allowed per Player account. No Characters are created by default in this mode, rather the default command set will drop you to a simplified OOC management screen where you can create new characters, list the ones you already have and puppet them. This mode offers true multiplaying, where you can connect via several clients simultaneously, each Session controlling a different Character.


Mode 3

This mode allows gamers not only to play multiple Characters on the same Player account (as in mode 2) but to also connect multiple Sessions to each Character. This is a multi-character version of Mode 1, where players can control the same Character via Player logins from several different clients on different machines in any combination.

It's interesting that some of these modes may seem silly or superfluous to people used to a certain type of MU* yet are killer features for other communities. It goes to show how different the needs are for users of different game styles.

Webby stuff

Latest Evennia come with a range of improvements, mainly related to its integration with the web.

New and improved ways to expand the website/webclient

Thanks to the work of contributor Kelketek, Evennia's Django-based web system (website and webclient) has been restructured to be much easier to expand. Previously you had to basically copy the entire web/ folder into your game and modify things in-place. This was not ideal since it made it inherently harder to update when things changed upstream. Now Evennia makes use of Django's collectstatic functionality to allow people to plugin and overload only the media files and templates that they need. Kelketek wrote a new and shiny web tutorial explaining just how things work. 

Websocket-based webclient with OOB

Evennia's webclient was an ajax-based one using a long polling ("comet") paradigm to work. These days all modern browsers support websockets though, a protocol that allows asynchronous server-client communication without the cludgery of long polling. So Evennia's new webclient will now use websockets if the browser supports it and fall back to the old comet client if it does not.

The new client also has full support for OOB (Out-of-band) communication. The client uses JSON for straight forward OOB messaging with the server. As part of this, I had an excuse to go back to clean up and make the OOB backbone of Evennia more complete. The server-side oob commands are borrowed from MSDP but the server side is of course independent of communication protocol (so webclient and telnet extensions can call the same server-side callbacks). I've not yet finalized the documentation for how to use the OOB yet, that will come soon-ish.

Bringing back python memory

Lately I've done work on the memory management of Evennia. Analyzing the memory footprint of a python program is a rather educational thing in general.

Python keeps tracks of all objects (from variables to classes and everything in between) via a memory reference. When other objects reference that object it tracks this too.
Once nothing references an object, it does not need to be in memory any more - in a more low-level languages this might lead to a memory leak. Python's garbage collector handles this for us though - it goes through all abandoned objects and frees the memory for usage by other things. The garbage collector will however not do its thing as long as some other object (which will not be garbage-collected) still holds a reference to the object. This is what you want - you don't want existing objects to stop working because an object they rely on is suddenly not there.

Normally in Django, whenever you retrieve an database model instance, that exists only in memory then and there. If you later retrieve the same object from the database, the model instance you have to work with is most likely a new one. This is okay for most usage, but Evennia's typeclass system (described in an earlier blog entry) as well our wish to store temporary properties on models (existing until next server restart) does not work if the model instance we get is always different. It would also help if we didn't have to load models from the database more than necessary.

For this reason, Evennia uses something called the idmapper. This is a cache mechanism (heavily modified for Evennia) that allows objects to be loaded from the database only once and then be reused when later accessed. The speedup achieved from this is important, but as said it also makes critical systems work properly.

The tradeoff of speed and utility is memory usage. Since the idmapper never drops those references it means that objects will never be garbage collected. The result was that the memory usage of Evennia could rise rapidly with an increasing number of objects. Whereas some objects (like those with temporary attributes) should indeed not be garbage collected, in a working game there is likely to be objects without such volatile data. An example might be objects that are not used some of the time - simply because players or the game don't need them for the moment. For such objects it may be okay to re-load them on demand rather than keep them in memory indefinitely.

When looking into this I found that simply force-flushing the idmapper did not clean up all objects from memory. The reason for this has to do with how Evennia references objects via a range of other means. The reference count never went to zero and so the garbage collector never got around to it. 

With the excellent objgraph library it is actually pretty easy to track just what is referencing what, and to figure out what to remove. Using this I went through a rather prolonged spree of cleanups where I gradually (and carefully) cleaned up Evennia's object referencing to a point where the only external reference to most objects were the idmapper cache reference. So removing that (like when deliberately flushing the cache) will now make the object possible to garbage-collect.

This is how the reference map used to look for one type of Evennia object (ObjectDB) before the cleanup. Note the several references into the ObjectDB and the cyclic references for all handlers (the cyclic reference is in itself not a problem for reference-counting but they are slow and unnecessary; I now made all handlers use lazy-loading with weak referencing instead).

This is how the reference map looks for the same object now. The __instance__ cache is the idmapper reference. There are also no more cyclic references for handlers (the display don't even pick up on them for this depth of recursion). Just removing that single link will now garbage-collect ObjectDB and its typeclass (ignore the g reference, that is just the variable holding the object in ipython).
We also see that the dbobj.typeclass <-> typeclass.dbobj references keep each other alive and when one goes the other one goes too - just as expected.

An curious aspect of Python memory handling is that (C-)Python does not actually release the memory back to operating system when flushing the idmapper cache. Rather Python makes it internally available so that it does not need to request any more. The result is that if you look at Evennia with the top command, its memory requirement (for example while continuously creating new objects) will not actually drop on a idmapper flush, it will just stop rising.  This is discussed at length in this blog, it was good to learn it was not something I did at least.

Apart from the memory stuff, there is work ongoing with fixing the latest batch of user issue reports. Another dev is working on cleaning up the web-related code, it should make it a lot cleaner to overload web functionality with custom code. One of those days I'll also try to sit down and finally convert our web client from long-polling to use web sockets now that Evennia suppports web sockets natively. Time, time ...

Hephzibah Marsh


Latest Activity

Lady Melanie Moonwanderer liked Hephzibah Marsh's photo
Sep 23
Sharon Bramers joined Hephzibah Marsh's group

Irish Steampunk Society

For Steampunk Enthusiast in Ireland! Let's get together to talk about Events and life in Ireland.See More
Sep 23
Sharon Bramers liked Hephzibah Marsh's group Irish Steampunk Society
Sep 23
Sir Jack Dubigail liked Hephzibah Marsh's photo
Aug 16
Sir Jack Dubigail liked Hephzibah Marsh's photo
Aug 16
Leslie Orton commented on Hephzibah Marsh's group Bay Area Steampunk Society
"Jack The Ripper Strikes! Jack The Ripper—Man or Demon? Find out in this edition of The Aether Chronicle! Chronicle%20%2315.pdf To Subscribe To The Aether Chronicle Simply "Follow" The Discussion on Leslie Orton's Page With…"
Aug 15
Rio B. joined Hephzibah Marsh's group

Bay Area Steampunk Society

Let's chat about going ons of steampunkary in the Bay Area!
Aug 10
Captain Bella Blackburn joined Hephzibah Marsh's group

Bay Area Steampunk Society

Let's chat about going ons of steampunkary in the Bay Area!
Aug 4



Hephzibah Marsh's Photos

  • Add Photos
  • View All

Hephzibah Marsh's Videos

  • Add Videos
  • View All

Comment Wall (409 comments)

You need to be a member of The Steampunk Empire to add comments!

Join The Steampunk Empire

At 4:14am on February 17, 2014, Sky Marshall gave Hephzibah Marsh a gift
You have given us an Empire... and we Love you for it... Thank You
At 10:07am on December 26, 2013, Capt. Seekerman said…

Hopefully the Queen Mary event is coming together. Happy New Year!

At 7:09am on December 8, 2013, Nicci T. said…

Hello and Happy Birthday to you!

At 2:04am on December 08, 2013, mlle.deedee Bourget-gauzot gave Hephzibah Marsh a gift
merci, for sharing a slice a cake... too !
At 1:55am on December 8, 2013, mlle.deedee Bourget-gauzot said…

Bonsoir ! Hephzibah Marsh...

I'm just stopping by to wish you a very Happy Birthday today !... I hope that you have an enjoyable day... too !

mlle.deedee gauzot :)

At 5:40pm on November 22, 2013, Capt. Seekerman said…

I see you met Tinker!  I'm looking forward to their release. Capt.S

At 4:41pm on September 16, 2013, Michael Cleveland said…

Thank you for the welcome.  This is new to me; don't know how much time I have to put into it, but interested in learning.  Saw you all on your zoo tour yesterday and was sorry I didn't have time to stop and talk. 

At 6:54pm on September 15, 2013, Amy Francis said…
Thank you kindly for the warm welcome. I'm very excited about finding my path in the Steampunk Empire.
At 2:47pm on September 14, 2013, Christopher Hopper said…
Why, thank you kindly!
At 5:57am on August 16, 2013, VITA LEE said…



© 2014   Created by Hephzibah Marsh.

Badges  |  Report an Issue  |  Terms of Service