20070322

Why "Barn Cover?"

Why "Barn Cover?" I think it's probably a fair question to ask at this point (or at any point, really). The phrase has special significance to me, which you will discover by the end of this little piece.

This blag is about coding, more specifically mostly about coding a MUD. More specifically, about coding a MUD in Ruby. More specifically, about me coding a MUD in Ruby. More specifically, about me getting punched in the face while coding a MUD in Ruby.

I've had it in mind to code a MUD for a long time, perhaps as early as when I first started playing them, which would have been about 12 years ago. I played them for years, but eventually I came to a point at which I realized that I had a pretty much strictly either-or choice: either play one or code one. You can guess which one I chose, seeing as how I'm writing this now.

If you don't know what a MUD is, probably the most concise description I can give you is that it's a text-based MMORPG. If that doesn't ring any bells, maybe "text-based World of Warcraft" works. If that's not enough, then you have some background reading to do.

So this is about coding a MUD in Ruby, and I might throw in other tidbits along the way. For example, I tend to have good things to say about source control. I might toss out some stuff about Ruby that doesn't really have to do with MUDs, or I may toss out something totally unrelated. It's exciting, but we will all try to keep our cool.

The origin you've all been waiting for

The barn cover really originated when I first put dealies--that is, objects--into my MUD. That was back in--oh what the heck, why don't I check?

$ svn log dealie.rb | tail
------------------------------------------------------------------------
r88 | ksh | 2006-01-15 22:44:58 -0500 (Sun, 15 Jan 2006) | 6 lines      

Split off all kinds of containers into container.rb
Added dealie.rb for dealies, which are actually objects.
added commands for getting and showing inventory
rooms and characters are dealie containers
added some bits to character container too

------------------------------------------------------------------------

There you have it: January of last year is when the barn cover was born. In doing this just now, I just figured out that Subversion doesn't have an easy/programmatic way of discovering the first revision at which a file exists in the repository. The best you have is to look at the entire log of a file's history and see which is the earliest log available. Tsk tsk.

When I first put in objects (dealies, as I will consistently refer to them, since the class Object is already stolen by the Ruby language), I needed several objects to test with. Pretty much the simplest kind of dealie you'd typically find on a MUD is food. It sits there, has some sort of nutritional value but not much more, and has a description and such, like all good dealies should. So I needed these test dealies. What were they? Well, let's take a look!

<type commands for a list> l
Room: The second room   

The spare roof of a barn is here.
<C> This sack is full of crap, and is the bane of all existence.
It's the hargomaster!

a boring looking dude is just standing around.

<type commands for a list>

The barn cover was a test object that Leia noticed and hounded me about forever. Now its legacy lives on. I don't have a name for the MUD yet; unless I can think of a better one, I might end up using it as the name, too.

I'm currently working on a rather substantial change relating to how dealies, nipics (mobs/NPCs), rooms, and the rest of the world are loaded from their respective data files, so I probably won't post until I have that done. At that point I will probably start off by posting about the troubles associated with it, but no promises.

2 comments:

Aparna said...

i think you should write about other stuff too. i never know what youre talking about.

Myoga said...

@Aparna XD, that's hilarious for some reason.

Post a Comment