Archive for April, 2008

Writing A MUD Engine Is Hard

Wednesday, April 9th, 2008

Seriously.

I don’t mean just writing a basic telnet chat server with a few objects and commands you can interact with.  Any amateur programmer can do that.

No, I mean writing a full-featured MUD engine that supports all of the features MUDders have come to expect from a game like Basternae 3.  It’s really dang hard.

I’ve spent hundreds of hours working on this rewrite and it’s still pretty far from done.  The area format is still changing quickly enough that I don’t have a working zone editor I can pass out, and I still have a whole spawn engine to write (for those of you who know MUD internals, it’s more-or-less the Basternae equivalent of “resets”.)  I also have to write some sort of mob-action-scripting engine.

It’ll be worth it when I’m done because I’ll have an engine that has been completely written by me and nobody will be able to say what I can and can’t do with it, but it sure is arduous — it takes a damn long time to write 100,000+ lines of code (as you can see by noting that the B3 blog posts beginning about a year ago).  And I’m no newbie coder — I’ve been writing code for more than 20 years, MUDs for 6-8 years depending on how you count the gaps, and commercial code for 3 years now.

That’s why Basternae 3 isn’t open yet.  I could easily have taken the old zones and code up and just went with that, but that’s not something that supports my long-term plan.  Maybe I’ll mention more about that plan at some point.

Humpy Dumpty It Ain’t

Monday, April 7th, 2008

A little less than a week ago I mentioned that I had broken the heck out of the codebase.

Well, it’s all back together again.  The MUD engine and the zone converter are as healthy or healthier than they were before, the weather’s nice, and all is well with the world.

MUD Connection Stats on FindMUD

Sunday, April 6th, 2008

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.

Fedora Core 8 Just Doesn’t Work

Sunday, April 6th, 2008

I’ve never had any luck with Fedora Core.  The latest version, 8, wouldn’t even get past the disk partitioning screen for me.  There’s a reason why I’m an Ubuntu devotee — after all, it managed to install itself quickly and easily with no stupid questions and worked flawlessly from the start.

Last time I ran Fedora it was on a set of 4 Dell desktops.  I started with 4 and later tried 5.  There was something wrong with the SATA driver and the hard drives would forget their data after about two weeks on average.  After reinstalling two or three times on each machine I ended up switching to Ubuntu.  No problems at all after that, although I did really want a “Fedora Core killed my family” shirt.  Too bad they don’t exist.

So, it looks like the Linux port of client/server development will still be on Ubuntu.

If you can’t run reliably on Dell hardware it’s time for you to go home.

Mass Refactoring

Wednesday, April 2nd, 2008

In the interest of making sure the MUD can be modified easily well into the future I’ve broken the heck out of the codebase.

Yep.

I’ve been refactoring, rearranging, renaming, and restructuring things so they make a lot more sense. That has inevitably broken a few things, but it will be far easier to add new types, flags, and enumerations in the future — things like adding a new terrain type without breaking existing terrain types or having to recompile the editor and re-convert all of the zones.

Believe me, we had quite a headache with zone file format changes on Basternae 2 and I don’t want to repeat it.

This means that it’ll take a few days before the codebase will build again and I’ll have some work to do on the converter and the editor, but it’ll be worth it.

I’m still looking at putting up a test server in May and so far Slicehost is the most likely candidate. Feel free to offer suggestions. Since it’s out-of-pocket and non-income-producing, my budget isn’t any more than $20 per month (should I be accepting donations for this?)