Category Archives: XML

Kinda like JSON, but not as good.

Preserving Newlines in XML Serialization

With .NET’s XML serialization, it kills newlines when you serialize XML to disk. More specifically, it converts a CR+LF into just an LF (\r\n becomes just \n). This was causing annoyances with the spell editor, since you can edit source code for spells with it, but the code would appear all on one line after […]

Zone Format XML Schema

I used the Microsoft XSD.exe tool to generate an XML schema file from the zone classes. That probably means nothing to most readers of this blog, but here’s the .XSD for the Basternae 3 zone format: Basternae 3 Zone Format XSD No reason really, just in case someone might be an XML tinkerer and wants […]

Fun With XSL

One of the good things about having data stored in XML files is that you can use XSL stylesheets (templates) to format the data into HTML. I created two basic templates, one for races and one for classes, and linked them to the data files used by the MUD. They don’t have any fancy formatting, […]

Artificial Intelligence Markup Language (AIML)

One of the things I plan to have the MUD engine support is AIML. That’s an XML-based file format that defines conversational data for a “chatterbot”. I’m sure most everyone has heard of the Eliza, Julia, or A.L.I.C.E chat bots. The idea is that you can create personalities that respond to certain phrases, much like […]

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 […]

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 […]

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 […]

Continuing Spell Migration

When we last saw our hero, he was working on migrating spells from being hard-coded in 15 different places to being individual XML data files that are loaded at boot time. While this makes it easy to modify, enable, disable, rename, or adjust spells without a recompile, the main reason I’m doing so is because […]

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 […]

Fraglist, Crime, and Corpse Files Converted

The fraglist, crime, and corpse data files have been converted.  The crime file conversion required no effort whatsoever since justice doesn’t do anything with it. Right now I’m working on a scheme to replace the old typo, idea, and bug file concepts, which were pretty useless.  The idea was that anytime a player typed “bug […]

Help File Converted

The help entries have been converted to XML.  Instead of being embedded in the area files and potentially spread across any number of area files, they are all in a file that contains only help entries.  In practice, Basternae 2 only had two area files that contained help entries, but it’s pretty silly not to […]

Socials Converted

The socials file, a text file containing 127 KB of text for the social actions in the MUD, has been converted to the new XML format. The help entry file is next.

Classes Converted

Class files have been converted to XML.  It was a lot less work than the race files.

Converting Races by Hand

I spent quite a lot of time manually converting the race files to XML.  The file format didn’t lend itself well to automatic conversion, nor was much of it an easy search-and-replace setup.  Some of the values were strings of flags, some integers, some full sentences, without much consistency. It wasn’t fast and it wasn’t […]

XML Objects!

It’s done – objects save and load as XML data rather than some ad-hoc text format.  I’m sure there will be a few extra details to work out, but the saving and loading of basic objects works now.  The change cleared up a bug or two that would come up once in a while due […]