Category Archives: Basternae and ModernMUD

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

An Update To The Editor

I admit it.  The last release of the zone editor (0.40) was pretty much unusable.  This one (0.41) should be quite a bit better.

Things fixed/improved in this version:

— Will now rebuild item select drop down list on create new items for all types.
— Resets, shops, and quests now save current item on navigate forward/backward.
— Current edit window contents were not saved when clicking “new” for all types.  They are now.
— Rooms and objects would not autonumber.  They do now.
— Update status bar on add new items for all types.
— Fixed crash on clicking greyed out ‘edit special’ buttons.

Ignore the little brown boxes that show up on the map window.  I started working on map generation from the room list, but it’s nowhere near done yet and will look completely wrong for now.

You can get it here. Feel free to report any bugs/glitches/inconveniences. One known issue is that the “delete” buttons aren’t functional yet (if you create a room, shop, or obj you’re stuck with it for now :P)

Test Port Turned Off Now

The experiment is over for now. I more-or-less have the data I was looking for — what the most major issues are, where the crashes happen, what’s super-broken, and what needs a lot of work.  If you have any other results from your experimentation, feel free to send them to xangis at the yahoo email service.  Thank you for what you’ve sent in so far.

The main crashy issues have to do with object deletion and some odd who list thing.  I’ll have to get those sorted out before the next test, whenever that is, but it shouldn’t be too tough.

After this batch of issues is worked out I’ll have to think about finding someone to be zone chief, and/or someone to be the highfalutin’ potentate of overlorditude.

Removing Hard-Coded Rooms, Objects, and Mobs

The old codebase had plenty of references to hard-coded room numbers. For instance, “Limbo” and the “default start room” for races without hometowns were set to room number 200.

Well, having those etched permanently into code is a bad idea, since it ties you inextricably to certain specific area files, and more importantly, it forces “zone gods” to dig into code if they want to change some things with how rooms are used. Bad idea.

The interim solution I’ve come up with isn’t great, but it does at least take the specific numbers out of code. I’ve created some XML files that load at boot time: StaticRooms.xml, StaticObjects.xml, and StaticMobs.xml. They contains a list of room, object, or mob names and their numbers, storing them in a Dictionary type. This makes it easy to refer to “ROOM_NUMBER_START” or “ROOM_NUMBER_LIMBO” in code and not worry too much about where it actually points. Of course, those names are still hard-coded, but at least they can be administered by non-programmers now.

I’d like to have them load dynamically as part of the zones, but there’s a bit of a problem there — some bits are just far too tightly integrated, especially things that revolve around locations, such as shifting to the astral or prime material plane. Those problems are better tackled in a future design change. This incremental improvement is good enough for now.

A Batch of Fixes

Between tester reports and the logs I’ve managed to track down and fix a handful of issues, some of which were so nasty as to make things untestable.  Here’s the list:

1 – Fix for removing an object from a room when that object points to a room but the room does not have the object in its content list.
2 – MUD now automatically creates player directories on boot if they don’t exist.  There was a problem with saving players when that dir didn’t exist yet that caused at least one crash.
3 – Changed “_name” to “name” at the login prompt.
4 – Fixed a crash bug that caused the world to explode when some spellcasting classes (i.e. Psionicist) entered the game for the first time.  It was a problem with setting initial spell proficiency values.
5 – Fixed a problem with the way age and total playing time was calculated.
6 – Fixed a problem where the petition command would make the MUD explode by calling itself.
7 – Fixed a problem with “get all”.
8 – Fixed a problem with clearing a mob’s hate list when it is killed.
9 – Fixed a glitch that would occasionally come up when taking an object out of another object.

Please try again and keep the observations coming.

InnoSetup Is Most Excellent

For a couple months back in 2003 I had a full-time job doing nothing but building InstallShield installers.  It was a pretty arduous process even for simple applications.

I wanted to build an installer for the Basternae Editor, which is a very simple program in that it doesn’t need any registry entries, license keys, services, or database objects.  It’s just data files and an executable.

This means that I really didn’t want to fire up my ancient (2003) copy of InstallShield to build an installer.  Instead I decided to give InnoSetup another chance.  I had tried it back when it was “brand spankin’ new” and didn’t really care for it, but that was a very very long time ago (before 2003).

I downloaded Inno Setup 5 and within minutes I was building an installer for the Basternae Editor.  I just ran through the wizard, added my files and executables, and fired it up.

Well, things were a little off on the first try — I wanted to run my app from the /bin directory and not the root program install directory.  Easy enough, the paths were right in front of me and I changed “{app}” to “{app}\bin” where it needed to be changed.

Next I found that it wasn’t using the executable’s directory as the working directory.  Yet again this was easy — I just added WorkingDir: “{app}\bin” to the icon setting and I’m good to go.  Total time spent building the installer, including Google searches and test install/uninstalls was about half an hour.  Nice.

The true test is whether it’s easy to maintain an install script.  I made a new build of the Basternae Editor today and wanted to update the installer.  The editor had no functional changes, just icons added to the menu so it’s a little clearer what button does what.

So I fire up InnoSetup, change the version at the top of the script from 0.39 to 0.40, hit “compile” and let it do its magic.  Seconds later I have a working install.  The best part is that this install cleanly installs over the top of an existing install, updates the listing in add/remove programs, and is COMPLETELY HASSLE FREE, a concept that was pretty alien to me given my InstallShield and WISE Installer experience.

So, here’s the new build of the Basternae Editor:  http://www.basternae.org/Basternae3EditorSetup_v0.40.exe

Basternae 3 Test Port Currently Running

I have a test port of Basternae 3 running on basternae.org port 4502.  This is only temporary for the purpose of testing.

Here’s a list of things that need to be tested.  Feel free to spend as little as 1 minute testing, or as long as the server is up.  I only plan to have it up for a few days or less.  Please report any results to xangis at the yahoo dot com email service.  One big email is far better than lots of little emails.  Also let me know the name you’d like to be listed in the credits as (up to you whether you want to use your handle/nickname or your real name).  As I receive testing reports I’ll post what sections of this list have been covered so there’s not too much overlap of effort between testers.

1. Tester: Create one character of each race and one of each class to make sure that:

– The help file/info is displayed properly for each race and makes sense.
– The help file/info is displayed properly for each class and makes sense.
– The character creation process is logical, sensible, and user-frieldy enough that someone who has never played a MUD could make sense of it.
– Nothing weird happens.
– Nothing looks too un-customized.
– You actually start in the Kobold Village instead of a room with no exits.
– Text formatting glitches are under control.

Report any ideas/suggestions/observances during the process.

2. Tester: Check help entries for all commands and report any that don’t exist.

The “commands” command will give you a list of the commands available.  “help <command_name>” should display the help for that command.

3. Tester: Check help entries for all skills and report any that don’t exist.

Type “skills” to show the skills available for your character.  “help <skill_name>” should display the help for that skill.

4. Tester: Check help entries for all spells and report any that don’t exist.

Type “spells” to show the spells available for your character.  “help <spell_name>” should display the help for that spell.

5. Tester: Test all spells available to you and report any that don’t work.

Until I have the “auto advance to max level” stuff going there’s not a whole lot you can test with this.  In addition, spellbook/scribe classes will have trouble.  Just do what you can.

6. Tester: Try all commands without arguments and report any that malfunction, fail to give any feedback, give badly-formatted responses, or give responses that look like a stock codebase.

For instance, try “score”, “attributes”, “who”, and any other commands shown when you type “commands”.

7. Tester: Try all socials and report any that malfunction, print output that is garbled or nonsensical, or looks like a stock codebase.

Type “socials” to get a list of the available socials.  Then try these different combinations with each social:
<social_name>
<social_name> me
<social_name> <some_mobile_in_the_room>

8. Tester:  Try combat and see whether you’re able to successfully kill a mobile.  If anything strange happens, report it.  This includes messages that don’t make sense, like getting kicked by a creature with no legs, bitten by a creature without a head, etc.

During the history of Basternae (1 through 3) there have been issues with combat round timing, corpse creation, and deathblows.  I’d like to identify any of those as early as possible.

9. Tester:  Try combat and see whether you’re able to successfully get killed by a mobile.

During the history of Basternae (1 through 3) there have been issues with combat round timing, corpse creation, and deathblows.  I’d like to identify any of those as early as possible.

10. Tester: Log in with two characters and see whether you can successfully kill another player in PvP combat.  If anything strange happens or if you’re unable to fight another player, report it.  Try with characters on the same racewar side (i.e. Troll vs. Ogre) and with characters on opposite racewar sides (i.e. Dwarf vs. Orc)

There’s all kinds of extra logic involved in PvP combat and there’s plenty of room for weirdness.

11. Tester: Check help entries for all bard songs and report any that don’t exist.

This assumes you’ll be able to create a Bard and that they actually have songs defined..  I haven’t tried.

12. Tester: Walk through a zone looking at mobiles, objects, and rooms and report anything that is formatted weird or doesn’t display properly.

Although issues of that nature are usually zone file related, it’s entirely possible that with our entirely-new socket and text formatting code that something will look wrong.

13. Tester: Download the Basternae client and try using it with Basternae 3.

It’s available here:  http://www.basternae.org/BasternaeClientPreview_08-04-09.exe

I know it’s only barely functional (none of the extra windows do anything yet), but it’d be nice to get a little feedback, and to know what it would require before you’d consider using it as your main MUD client (if you’d consider using it).  And, of course, if it doesn’t run on your main OS that’d be nice to know too.  It’s probably worth running it side-by-side with another MUD/telnet client to make sure that text comes across OK (it’s entirely likely that the text parser isn’t 100% right).  If anything looks wonky, screenshots might be helpful.

14. Tester: Download and try to use the Basternae zone editor and take note of what parts of it are confusing and/or unclear.

The basternae editor can be downloaded here: http://www.basternae.org/Basternae3EditorSetup_v0.39.exe

There isn’t any documentation for the zone editor yet, so it might help to have some input as to what a new zone writer would want to know how to do and what guidelines should be made clear.  If you’re feeling really brave you could write a basic conceptual overview or intro tutorial.

The editor currently only runs on Windows and requires the .NET framework (you’ll already have it if you have Windows).

15: Tester:  Download the Basternae zone editor and try creating a 2-3 room zone with a mob, a quest, and an object.

Just try it out and see if it works, offer usability suggestions, and/or report anything weird.  Once you’re done, send me the test zone and I’ll see if it actually loads in the MUD engine.  Quality does not count — this is only a test.  You could create an entire zone if you want to, but I don’t recommend it until after these tests are done because there could be some breaking file format changes.

A few things to be aware of:

The code was written and compiled on Windows and is currently running on Linux under Mono.  Since Mono doesn’t have full support for everything in .NET there’s a chance something will go haywire at some point.  While doing some initial testing a few weeks ago I saw CPU usage on the server spike to 100% for no obvious reason.  If this happens, I’ll have to kill the process because I have about 15 or so other sites running on the server and I can’t let them be taken down.

I’m sure some of these tests will not really be able to be run effectively without some code changes/fixes.

THIS IS NOT A FULLY FUNCTIONAL MUD.  THIS IS JUST SO I CAN BUILD MY “TO DO” LIST OF THINGS THAT MUST BE FIXED OR REWRITTEN.

Ready For Some Preliminary Testing Soon

Some time in the next few days I hope to put up the Basternae 3 codebase in its current state temporarily in the hope that a few folks will be willing to help with some testing.

This isn’t a “beta” or anything like that.  It’s more of a “proof of concept” — to find out what’s completely broken and/or needs work next.  After the things in this test are fixed then I’ll be ready to start thinking about getting some help with zones.  For this test there will probably only be one or two zones attached – just enough to try out some combat, etc.

What I’ll be looking for in this test is just for someone (or multiple someones) to try all of the commands, skills, help file entries, socials, etc. and report any that are non-functional, fail to give any feedback, or that just behave weird.  I know that classes and their skills/abilities still need a fair amount of work, but this will also help me with getting everything else in working order.

So, check back later this week.  Next week at the latest.

More Fixes To File Loading

A week ago I wrote about Mono not being happy with XmlElementAttribute.  I had cleaned up loading/saving for players and zone files, but skill and spell data needed some work.  I took care of that today, so all of the xml serialization is happy now.

I’ve hired the wife as a QA tester to do some preliminary “how broken is it” testing so I know what needs to be fixed before the real work (building) can begin.

Goodbye, Pizdook

One of the things that I do for the FindMUD mud listings is check connections once in a while (approximately monthly) to see if a MUD server is running and then display a log of connection attempts on that MUD’s listing page.

When I was on shared hosting, that was a process that was far more involved than it should have been.

Step 1:  Get a list of currently active mud listings to query.  For that I created a custom hidden view in Drupal that I could copy and paste into my connection test app.

Step 2: Run the connection tests.  I wrote an app specifically to do this by checking telnet connections to each MUD on the list.  If would generate two sets of SQL queries.  The first contained the connection results, while the second contained any changes to IP addresses.  I called the executable file “Pizdook”, which is a scathing insult used in Orson Scott Card’s Homecoming series of novels.  It represented my annoyance at having a multi-step process due to the limitations of using shared hosting.  Here’s a screenshot:

Step 3: Log into PHPMyAdmin and paste the queries generated by Pizdook into the “execute SQL” window to update the database.

Thanks to some new-found knowledge of SQLAlchemy, I’ve rewritten the app as a Python script that I can run with a monthly cron job.  Suddenly it’s hands-off, a single-step automated process that I no longer have to spend any effort on.

Today’s Update

I spent a while working on the code today.  Nothing specific, just reorganizing some things, cleaning up some excessive logging, fixing a bug or three.

I ran FxCop again and it came up with 961,407 checks and 9,557 issues, a ratio of 9.94 issues per 1000 checks.  This is an improvement of 6.49% over last check.  I think I’m going to mothball FxCop for now since following its rules doesn’t actually result in better, more stable code.  All FxCop cares about is how “pretty” the code looks.

Mono 2.01 Doesn’t Like XmlElementAttribute

I have zone files loading on Mono now.

I had a sneaking suspicion that it had something to do with the XmlElementAttribute that I used to keep the XML tags in the zone files compatible with the encapsulated, property-based classes.  I spent a few hours updating the zone converter application so I could remove the XmlElement attributes.  After loading the MUD on Mono, all zone files magically loaded.  “All” being the ~6 that I’m officially authorized to use so far.

Since I’m running Ubuntu 9.04, the native version of Mono is 2.01, a bit behind the current version of 2.4 (which will ship with Ubuntu 9.10).  Installing Mono 2.4 on Ubuntu 9.04 is not as easy as one would hope, and I can’t say for sure that it would take care of the problem.  Mono has made great advances lately, so I’d be surprised if the latest version had the same problem.

FxCop Still Wants To Shoot Me

Last time I ran FxCop two and a half months ago I had 10,850 issues from 778,249 checks for a ratio of 13.94 issues per 1000 checks.  That was just on the core MUD engine without the utilities included (screen editor, zone editor, etc.)

Today I ran FxCop against the entire codebase.  The ratio has improved thanks to the code changes over the past couple months.  It’s still not great, and it still whines too much about the way constant variables and flags are named.  It’s now 10568 issues from 920,226 checks for a ratio of 11.48 issues per 1000 checks.

Not much of an issue decrease in total, but the overall issue “density” has improved by 17.65%.

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.

Almost Working on Mono

There’s apparently a strange quirk to the XmlElementAttribute where you have to specify the data type for any type that isn’t a string (you’d think it would auto-detect an int property!)

So, with this:

///
/// The id number of the race.
///
[XmlElement("_number", typeof(int))]
public int Number
{
get { return _number; }
set { _number = value; }
}

Everything now loads, boots up, and characters can log in. However, when entering the game, there’s a NullReferenceException that happens on Mono (but not on the Windows version):

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at BasternaeMud.CharData.ResetStats () [0x00000]
at BasternaeMud.SocketConnection.ProcessMenuSelection (System.String argument) [0x00000]
at BasternaeMud.SocketConnection.ConnectionStateManager (System.String argument) [0x00000]
at BasternaeMud.SocketConnection.ProcessPlayerActions () [0x00000]
at BasternaeMud.SocketConnection.MainGameLoop (System.Net.Sockets.Socket control) [0x00000]
at BasternaeMud.Program.Main (System.String[] args) [0x00000]

So far it seems that this only happens for existing players. Creating a new player doesn’t cause this to happen. Might take quite a bit of effort to track down.

Technorati, Eh?

I finally went and set up a Technorati profile for the first time and claimed the Basternae blog.

I’m still not quite sure what you can really accomplish with Technorati. I guess I’ll find out. In the meantime, you can “favorite” this blog if you use Technorati:

Add to Technorati Favorites

Not Working on Mono

I tried firing up the current Basternae 3 codebase using Mono on my Ubuntu server. It crashed. So, here are the errors I have to sort out before I can get to the next errors:

14:30:34 Trace: Loading spells.
System.InvalidOperationException: Standard output has not been redirected or pro cess has not been started.
at System.Diagnostics.Process.CancelErrorRead () [0x00000]
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:CancelError Read ()
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compile r.CompilerParameters options, System.String[] fileNames) [0x00000]
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom .Compiler.CompilerParameters options, System.String[] fileNames) [0x00000]
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFile (System.CodeDom.Comp iler.CompilerParameters options, System.String fileName) [0x00000]
at System.Xml.Serialization.XmlSerializer.GenerateSerializers (System.Xml.Seri alization.GenerationBatch batch, System.CodeDom.Compiler.CompilerParameters cp) [0x00000]
at System.Xml.Serialization.XmlSerializer.RunSerializerGeneration (System.Obje ct obj) [0x00000]
14:30:36 Trace: Loaded 421 spells.
14:30:36 Trace: Loading skills.
System.InvalidOperationException: Standard output has not been redirected or pro cess has not been started.
at System.Diagnostics.Process.CancelErrorRead () [0x00000]
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:CancelError Read ()
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compile r.CompilerParameters options, System.String[] fileNames) [0x00000]
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom .Compiler.CompilerParameters options, System.String[] fileNames) [0x00000]
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFile (System.CodeDom.Comp iler.CompilerParameters options, System.String fileName) [0x00000]
at System.Xml.Serialization.XmlSerializer.GenerateSerializers (System.Xml.Seri alization.GenerationBatch batch, System.CodeDom.Compiler.CompilerParameters cp) [0x00000]
at System.Xml.Serialization.XmlSerializer.RunSerializerGeneration (System.Obje ct obj) [0x00000]
14:30:36 Trace: Loaded 95 skills.
14:30:36 Trace: Loading races.
Unhandled Exception: System.Exception: Error loading races in Race.LoadRaces(): System.Exception: Error loading race in Race.Load(): ../races/Barbarian.raceSyst em.Exception: Race.Load(): Race number 0 already taken by Human. Can't load Bar barian
at BasternaeMud.Race.Load (System.String filename) [0x00000]
at BasternaeMud.Race.Load (System.String filename) [0x00000]
at BasternaeMud.Race.LoadRaces () [0x00000]
at BasternaeMud.Race.LoadRaces () [0x00000]
at BasternaeMud.Database.LoadDatabase () [0x00000]
at BasternaeMud.Program.Main (System.String[] args) [0x00000]

The first error happens when the engine tries to compile custom code in a spell file.

The last error, “race number 0 already taken” is not correct — the ID for Barbarians is set to 1, so the files are obviously not being read correctly.

Integrating Python?

One of the things I’ve been worrying over is how to write a new scripting and artificial intelligence engine that integrates all the buttery goodness and capabilities of MobProgs and the homebrew probability-based AI system I wrote for Basternae II along with the only-used-once movement scripts I put together. They were all pretty powerful, but the bad things are/were:

1. Too many pieces of code to maintain.
2. Required a programmer’s full attention — far too complex for a zone writer or newbie-level web scripter to use.
3. Always required a recompile if changes were made.
4. Always required a reboot to load new changes. This made it un-tweakable. Want a mob to cast fireball half as often? Change it and reboot the MUD.
5. Extremely zone-dependent. If we unload the plane of fire, we still have all of the plane of fire scripts active, including hard-coded mob names and numbers.

It definitely shouldn’t require a restart of the game just to make a troll kick someone in the head more often. This naturally leads me to Python and/or IronPython, since it’s my current obsession. I have some reading to do, but don’t be surprised if I come up with a scripting engine of pure awesomeness.