Sunday, 22 January 2012

Mud progress

It has been a long time since I've worked on my MUD code-base.  Most recently, which is to say not that recently at all, I've been concentrating on the roguelike game code.  Today however, I managed to get myself to spend a little time on the standard text-based game code.


I was playing around with my container code, and for some reason, that got me motivated to add a 'weight' property to objects.  This is of course pretty straightforward.  For now, a player can gauge the weight of an object by using the 'consider' command on it.  And a player can see how much weight he is carrying, and capable of carrying, but looking at himself.  Not sure if there is a standard way to expose these two pieces of information, but if there was I'd prefer to go with it.  For now, this will do, as will my use of kilograms as the unit of measurement.

Message formatting

My message interpolation pretty much works for the purposes I put it to, but I started to wonder why this wasn't something better documented out on the web.  Ideally there would be a MUD wiki somewhere which would define the standard approaches which everyone took.  The agreed upon rules for pluralisation, verb conjugation or whatever.  Yeah, standard libraries are available for this these days, but they come at a cost.  Most that I located are overly complicated and surprisingly arcane.

In any case, looking at the text I generate when someone 'looks' at another object, I found myself expanding the message formatting.

vo = ViewedObject(viewer=actor, object=self, verb=self.containerVerb)
"{0.Pn} {0.v}: {1}".format(vo, "...")
viewing self: "You carry: ..."
viewing other male: "He carries: ..."
viewing object: "It contains: ..."
I already handled 's' (short description) and 'v' (verb).  Now after adding a 'gender' property to objects, I also support 'pn' (pronoun).  Something resembling verb conjugation is also supported, where the viewer gets a pluralised verb if he is not viewing himself.  Good enough, and quick and straightforward is the goal.

Procrastination led to some web browsing:

  • Message Expansion.
    This thread has several parties discussing the approaches at use in their MUDs.  Some are prohibitively complicated, but there are some good points made.
  • Generating grammatically correct MUD-style attack descriptions.
    The question is from someone completely new to the topic, and the answer gives a great breakdown of the various aspects which need to be addressed.
Nothing I am interested in looking into. A good approach for me is to look back at these when issues arise, and to stay straightforward.

Next steps
  • Finish implementing encumbrance concept.
  • No idea!  Trying to balance resisting feature creep, and not having a MUD code-base that isn't complete enough to use.

No comments:

Post a Comment