Category Archives: Basternae and ModernMUD

Posts about the Basternae MUD and/or the ModernMUD codebase.

Basternae Zone Contract

I’ve put together a simple “zone permission contract” here:
http://www.basternae.org/BasternaeZoneContract.pdf

It’s probably not necessary, but while I was publishing my science fiction magazine I found it to be a good idea to get everything in “official” writing.

If you have written any zones you’d like to let us use or know someone who has, this can be sent either to my xangis at yahoo mail account or to the following mailing address:

Jason Champion
Zeta Centauri, Inc.
1388 Clydesdale Ave.
Columbus, OH 43229

TODO List Added

I’ve added a to-do list under the ‘Pages’ section. It’s not quite complete and the formatting isn’t all that great, but it might be a useful way to keep track of what needs to be done. At the very least it’ll give readers some idea what I’m working on.

So far I’ve been using simple “todo.txt” files in each of my Visual Studio projects, but that keeps them from being all in one place and is a bit disorganized.

Back From Vacation

OK, so maybe I didn’t announce the vacation in the first place, but I took some time off from working on Bast to enjoy the summer.

I’ve been working on the client a bit, and I had almost forgotten how much I dislike C++.  It’s just so messy and inefficient to work with.  You have to spend about 30% more time to get anything done and then once you’re done you have a pretty good chance of having to do some memory-based debugging.

Enough of the whining (because that’s what it is).  Just posting a note to let folks know work is continuing.

An Upgrade (For Me)

It’s been a busy week at work — just got myself a promotion and haven’t had a chance to work on the MUD as much as I’d like (more tired in the evenings than out of time, really). Most of this week’s effort has been directed toward the editor.

I’m wondering whether it would be a better idea to release a prototype of the editor to get ideas and suggestions or wait until it’s pretty much useable before releasing it.  It’s probably a difference of about 4 weeks in time/effort.

Raph Koster Is Pretty Awesome

Some of you may remember Raph from Ultima Online, Star Wars Galaxies, or Everquest II. He also wrote a few articles for Imaginary Realities webzine (a webzine about MUDs for those of you who don’t know). The site was pretty active from 1998-2001, but at some point it vanished from the face of the Earth.

Well, Raph was nice enough to give permission to reprint his IR articles on FindMUD. They’re a good read, and still relevant today, so if you’re at all interested in MUD design you should read ’em over.

Raph’s blog is also pretty interesting and updated fairly regularly. It’s worth becoming a regular reader.

300 MUDs on FindMUD

Data entry is a lot of work and it takes a lot of time. Even so, I’ve been making steady progress on FindMUD. It’s up to 300 MUD listings now.

Our next goal is to pass MudMagic, which has just over 500 listings. It won’t be blazingly fast, but it will happen.

Automatic Line Wrap

When writing a zone, it can be tough to know where to end your lines of text.

While a standard terminal has 80 characters, some telnet programs start to look weird with any line that is more than 77 characters, and some terminals have 130 or more characters per line (usually depends on screen resolution).

With different zone writers writing descriptions with varying line lengths it can make the MUD look pretty inconsistent from zone to zone.

That’s why I wrote an auto-wrapping function that takes care of all of that.  It will take a description and insert line breaks as necessary.  Right now it just defaults to a 78-character terminal width, but it will be user-configurable when I’m done with it.

This means that zone writers don’t have to worry about line breaks anymore.  They can just type out their descriptions and it’ll be handled by the MUD.

Word wrapping still isn’t perfect, so I’ll need to work on that a little, but it’s pretty neat to have autowrapping in place now.

A Whole New Spell And Skill Engine

Well, maybe not a *whole* engine quite yet, but certainly two thirds of one.

I’ve generated about 500 little XML files to hold all of the skill and spell data for dynamic runtime loading.  It’s all pretty neat — skills and spells can be tweaked by hand without having to compile any code (though the MUD requires a reboot) and they’re loaded at runtime, stored in a Dictionary type, and accessed based on their names.

There isn’t a single hard-coded spell or skill value in the engine.  Hardcoded values were something that always bothered me.

Another thing I did in this process is embed “logical preference” data in the skill and spell files so that the AI engine can be improved while at the same time removing the need for thousands of lines of “spaghetti code” like in Basternae 2.  You see, each spell and skill check in B2 was hardcoded in a specific order and with a specific percentage chance.  Adding a skill or rearranging mob AI meant editing these in more than one place.

Instead (when the AI code is done), we’ll be able to set a few flags on each spell or skill and it will handle it automatically (unless a specific mob has a personality override file).

Oversimplified example:

Fireball.xml:  Type = offensive, Preference = 65, Likelihood = 40
LightningBolt.xml:  Type = offensive, Preference = 50, Likelihood = 50

This means, essentially, that a mob would have a 40% chance of casting fireball during combat, and if that didn’t go off, it would have a 50% chance of casting lightning bolt.  Changing the way the mob performs in combat is just a simple number tweak.

I have some pretty huge plans for mob AI, but this new spell/skill system goes a long way toward making those plans easy to implement.

I also have yet to embed all necessary custom code in the spell/skill files, but one thing that’ll be done is that most information needed to trigger a spell will be embedded in the file.  Instead of manually writing a dozen lines of the same code for each spell to validate the target, check saving throws, set damage type and amount, send messages, and deliver the affect(s), most spells will use one general-purpose function that checks the spell types and flags and executes the spell’s action.

This means that most standard spells that are just damage or single-affect, like “soulshield” or “fireball” won’t have any embedded code at all.  Instead, only super-involved custom spells like the enchantment spell “earthen smith” will have their own embedded instructions.

Well, that was long-winded.  It had to be — I’ve done a lot and I’m pretty proud of what I’ve accomplished with this.

Learned Something New Today

I came across this article on Scripting with C#.

Quick summary: It tells how to load and compile C# code from within a running application so that you can dynamically load scripts.

This is something I’ve been meaning to find out how to do for a while. I’ve always wanted to create a file-based spell system that loads and compiles all spells at boot time so that they aren’t so tightly integrated into the engine. As it was historically, if you removed a single hardcoded spell, such as “armor”, the entire mud would crash or at least be very unhappy.

Well, what good are 400+ hardcoded spells going to do you when you use the mud engine for a sci-fi, historical fiction, or contemporary post-apocalyptic setting? None at all. That’s why getting them once-removed from the core is something I wanted to do. Super-long-term there’s not just one MUD coming out of all this effort.

MUD Connection Stats on FindMUD

One thing I’ve been working on is an automatic ‘ping’ routine that checks the MUDs listed on FindMUD every few days and shows the connection results on a MUD listing so you know whether a particular MUD is still alive or not.

Since I’m no PHP expert, it tends to be rough going sometimes. I know just enough PHP to be dangerous — it’s a lot like C but not *enough* like C for me to be comfortable yet.

Even so, I’ve managed to put together a semi-automatic routine that checks these connections. Here’s how it works:

  1. I go to the site and export the master MUD list. This is a one-click PHP script that gives me a CSV file.
  2. Paste the CSV file into a desktop application I wrote in C# .NET that cycles through the list and tries a connection to each MUD. It generates two SQL queries for me — One that updates the IP addresses for any MUDs whose servers have moved and one that updates the connection results table in my database.
  3. Take those those two queries and execute them on my database server.

It’s a seven minute process and not too much work, but it would be nice if it were fully automatic and happened at a specified interval instead of “whenever I do it”.

The two roadblocks I have at the moment are that the shared hosting I’m using for FindMUD doesn’t seem to allow outgoing telnet connections and they also don’t allow connections to a database from outside the server. Even though I could whitelist my IP address(es) in order to connect to the DB I don’t really want to open up any of my databases.

Being able to do #1 would automatically make #2 a non-issue since connections would be made from the server running the ping test. When I get hosting for Basternae 3 it’ll be on a server I can do whatever I want on, so this process should be able to become fully automatic.

Tweaking The Zone Converter

In working on the new zone editor I noticed that a few things seemed a little off in some of the test zones I was working with.  As much as I would like to blame the editor, since it’s new and untested, it turns out that the zone converter had an issue with race conversion between Basternae 2 and 3 zones.   It was a relatively simple bug, but it was one that made all converted zones look a little stupid.  Being simple, it’s been fixed with minimal effort.

Now that the converter is working pretty well I’m pretty comfortable with accepting zones that were on Basternae 2 if anyone is willing to give permission to use them.

A Price On Your Head

One thing I’m surprised never made it into Basternae — bounties.  It’s only natural that you would be able to set a price on someone’s head in a PvP MUD.

So I implemented about 60% of a bounty system today.   There are still a few details to work out, but the core of the system is in place.

Memory Usage

When booting up the MUD engine with only my two zones (the Thri-Kreen hometown and the Kobold Village), Basternae 3 takes up 22,256 kilobytes of RAM.

That somehow manages to drop to 20,096 kilobytes of RAM when I connect with a single player.  I think it was probably just timed to coincide with a garbage collection.  Moving around for a while brings it back up to 20,500.

A boot up with no zones loaded starts at 22,116 kilobytes of RAM.

So, at this point the MUD engine takes about 22 megabytes of RAM plus however many zones are loaded.  I can’t imagine players taking more than 8 kilobytes, and with zones taking up about 1 megabyte per 3000 rooms, we’ve got plenty of room to grow.

With 32 megabytes available, we could support:

27,000 rooms
128 simultaneous players

No problem.

The entry-level VPN servers I’ve been looking at start at 256, but that’s for OS plus applications.  It’ll be running Linux so I’ll have about 128 megs for OS and 128 for apps.  We could run 300,000 rooms and nearly 800 players before needing to upgrade.

I definitely don’t miss the “bad old days”.  When I first started writing MUD code it was normal to only have 32 MB in an entire system.

200 Listings on FindMUD

Over the past few weeks I’ve steadily been adding more MUD listings to FindMUD.  It has now has over 200 MUD listings.  That’s not super-impressive, but it does have more than MudBytes and Betterbox and is quickly gaining on some of the older sites (many of which are rather neglected these days).

Zone Reset Modes

In  the old days of Basternae 2, there were really only two area reset (repopulation) modes — either an area would repop at a fixed interval, or the area wouldn’t reset until all players had left.

In the process of rewriting the way areas reset themselves for the new game engine, I’ve added a few more reset types that might make for some fun zones:

  • Empty of Mobiles:  The zone won’t reset until every monster in the zone has been killed.
  • Empty of Objects:  The zone won’t reset until every takeable object has been removed from the zone.
  • All Quests Completed:  The zone won’t reset until all quests inside the zone have been completed.

The way things are done it’ll be pretty easy to add new conditions if the theme of the zone requires it.

Real Progress on the Editor

Now that I’ve started trying to use the zone editor I’m finding all sorts of things to fix and/or improve.  I’m not sure how long it’ll be before I can get a small zone put together using it, but it’s getting quite close to usable.  Far from pretty, but usable.

A Help Entry Editor

Editing help file entries has always been a pain, mainly because it’s always been a huge unorganized text file that has to be edited by hand.

I spent about an hour and a half building a simple help file editing application today. It will load/save help files, allow searching and browsing of entries, and of course, editing.

It’s nothing fancy, but it does make the task of editing help entries a little easier. It doesn’t have visualization for colorized help screens, but that would be easy enough to add.

Here’s a looksee:

Help Editor Screenshot

(Click the image for a full view).

Improving The Zone Editor

Over the past couple days I’ve done quite a bit of work on the mob and object editing screens in the editor.  I also found and fixed a few problems with the area converter.

The hard part of building the zone editor is going to be adding the map-based and walkthrough visualization modes.  They aren’t needed for building an area, but they will help quite a bit with visualization and layout.  I haven’t put much thought into how I’m going to go about implementing those features, but it’s something I can worry about a bit later, once I have the zone editor fully functional (which shouldn’t be too much longer).

Smashin’ More Bugs

Now that the communication routines are a lot smoother I’ve been able to test and debug more of the rewritten code.  I fixed a bug in the new command interpreter and one in the string builder today.  I also came up with a better way of handling per-area repop points so it’ll be a lot easier to set up new hometowns with race/class spawn points, especially since I’ve added repop point editing to the zone editor.