Category Archives: Magma Codebase

The Magma Codebase Is Worth Millions!

I love how Ohloh estimates the value of open source projects. For instance, here’s their take on the Magma MUD codebase:

I believe Envy is just over 100k lines of code. At the average developer salary of $91,000/year, about $1 million in “value” was created by the Basternae II rebuild team. Value that, due to the DikuMUD license, could never actually be “claimed” through any means.

Just a curiosity, really, but still fun.

Magma MUD Codebase Now on Github

The Magma MUD codebase, last updated in 2008, is now on Github: https://github.com/Xangis/magma

I’ve cleaned up the build a little bit, but it’s still the same old Magma that was used to start Basternae 2, warts and all.

If you feel like cleaning up any bugs (there are plenty) or adding any improvements, go ahead.  If you want to send a pull request I’m Xangis on Github (as you can probably tell from the URL).

Magma MUD Codebase: Generally Quite Stable

The Magma MUD test site has been running for over a month now without any administrative intervention.  I have it set to automatically reboot the MUD after it’s been up a week.  That has happened 4 times now.  The fifth reboot was due to a segmentation fault (null reference exception) on June 10.  This means that in a month there has only been one unexpected reboot.

Any number more than zero isn’t particularly good, but it seems to be pretty stable under miniscule load (there isn’t really a playerbase, just people wandering in and out infrequently).

Telnet:  basternae.org port 4001.

22 Hours Uptime

Mind you, only about 5 players have logged into the Magma 3.04 demo site, but it’s been up 22 hours so far.

I remember back when Magma was first being developed. An hour of uptime was considered a good thing.

Funny how things progress. I remember my first MUD in 1999, Illustrium Arcana, running on a Cyrix 6×86-PR200 on a 32MB machine co-located on a friend’s ISP (stax.net, apparently shut down around the end of 2006). Having T1 access was so amazing ten years ago. Now I’d be angry if my cable modem slowed down to 1.5 MBPS.

The original Cyrix machine ran at about 200 BogoMIPS, which was screaming fast. Right now I have what is effectively 1/10 of a Xeon 2.5 GHz processor. That gives me 500 BogoMIPS and 320 MB of RAM. That’s more than enough to run a MUD and a few websites.

Magma MUD 3.04 Released!

I’ve made a minor update to the Magma codebase.  Here’s what’s changed:

1. Added support for loading 4 of the 5 remaining Envy 2.2 zones that wouldn’t load.
2. Bundled the MakeZonesFast32 and DikuEdit 3.10 zone editors in the MUD package.
3. Added DOS conversion utilities for assembling DikuEdit zones (makezone.bat).

MagmaMUD 3.04 is available for download at FindMUD.

Magma MUD Codebase 3.03 Released

Over the past month I’ve been playing around with the Magma 3.02 code a bit more. I found a few crash-bugs and fixed them, mostly caused by references to rooms and objects from Basternae 2 that no longer exist.

The big change is that 58 of the 63 original Envy 2.2 zones will load in the engine. This means you can actually run a MUD with the codebase. Nobody wants to play a stock MUD, but at least you can have a functioning game world while all of your new areas are being built.

I’m sure there are still some bugs and/or stability issues, but this release is a big step forward.

Let me reiterate what I said when releasing 3.02: This is _NOT_ the code I’ve been working on for Basternae 3. This is the codebase from early Basternae 2.

It’s posted on FindMUD if you would like to download it. Runs on Linux (tested on Ubuntu) and Windows (tested on XP).

Magma MUD Codebase 3.02 Released

During a trip this Thanksgiving I updated the Magma codebase a little. All I really did was fix a few compile errors that have come up in the past seven years due to changes with the C language and compilers — it’s otherwise the same code.

There’s a solution file that builds in Visual Studio 2005 (express or full version) and it also has a makefile that will compile in Ubuntu Linux 6.06.

This is the C code from the Basternae 2 rebuild era, released in 2000.  This is _NOT_ the code I’ve been working on over the past few months.

Why’d I convert it? Boredom mostly. It’s posted on FindMUD in case anyone is interested.

The Road To C++

I’ve gradually been changing more pieces of code from C to C++. As each piece goes from being a random function dangling somewhere to a piece of a coherent class the code begins to make a little more sense.

So many bits and pieces are going to benefit from being private data members. In a lot of cases there were hoops that had to be jumped through to handle values properly. Race, for instance. If a character was polymorphed into another race, some of the functions in the game would react to the new race and others would react as if nothing had happened, so a troll turned into a lizard might still lumber into the room.

With the ability to make some data members private, we can make it so that nobody can look at player->race, but instead have to call player->GetRace() which will be smart enough to check for polymorph. The same can be said for checking or adjusting ability scores, hitpoints, and all sorts of things that can be modified by spells.

It’s a phenomenally massive undertaking, but with the proper amounts of time and insanity it can be done right.

And It Begins

I’ve been working with the old Magma 3.0 codebase for almost a week now. Things I’ve done so far:

  • Removed all of the old outdated OS-specific code (Sequent, Apollo, Amiga).
  • Removed all instances of sprintf (a very dangerous function prone to buffer overflows). These have been replaced with snprintf, which is safer. Over 1000 functions have been replaced.
  • Converted all major structs to classes (a C to C++ conversion).
  • Broken the single monolithic merc.h header file into many different header files in order to make the code easier to maintain.

I’m also working on removing or replacing most of the old predecessor code and adding support for just about every area format I can find.  When this is all over it will be a full codebase rewrite in C++.

The goal is to build an engine that is easily extended and modified, with OLC, easy-to-add mods and scripts, and plenty of ways to add fun things to the game without it being too unstable. Original Magma was incredibly unstable because it was built in a hurry — the codebase was based on reverse-engineering the format of existing areas for Basternae 1. There was very little testing at first and it took years for the engine to fully develop into a robust form.

It may take a few years for this new engine to develop into a fully robust form, too, but this programmer knows a vast amount more than he did eight years ago when building Basternae 2 was begun.