Rooms 1.7

| 0 Comments
In 1989 I taught myself C to write an adventure game, the code's fairly bad, but 10 year's later, the game's still quite cool!

A very simple adventure game...
Over 10 years ago I taught myself to program in C. I wanted to write a program to help me customise the multi-user adventure game I was playing at the time. In MUD II when you reached the exalted rank of Wizard you could create your own rooms and objects. To do this you had to execute lots and lots of commands within the game to create the objects etc. To make this repeatable it was common to script the creation of these objects. What I wanted to write was a room and object editor that allowed me to create these scripts offline and in a more user-friendly way.

Well, that's how the "Rooms" project started. It never did generate any scripts and after a while I decided that it might be fun to write my own multi-user game and "Rooms" became ELGAR - Endless Lands Games And Realities, my multi-user adventure game language project.

Rooms17.gif

The code presented here is the last version of the Rooms source code. This was version 1.7 and by this point most of the pretence of just writing a room editor for MUD II had been dropped and I was already experimenting with adventure game ideas.

The code is rather horrible, but, I was young, and it was my first C program, albeit version 1.7 of it...

The data for the "game" are stored in the various MN.* files, you can alter these with a text editor though there is a limit to the number of rooms, objects and messages that you can have. I did know the format for these files at one time, but can't for the life of me remember that now... I'm too scared to look into the code to find out.

Things I'm still quite proud of...
Objects and "features" are "wrapped" into the room descriptions. This was pretty much unheard of at the time. Small objects often appear early on in the room description and don't show in up at all if you do a "quick look" (ql) but you can still pick them up. Also, most things mentioned in the room descriptions can be touched etc e.g. the ladder, stairs, racks, forge etc. You can open/close and put things in the forge even though it looks like it's part of the room description. This was all very unusual for this kind of game back in 1989.

Try Examining things, the scabbard and Longsword (ls) are nice, take the ls from the scabbard and examine it whilst holding it, then drop it and examine it. Find the chest and examine it when shut, when held, and when open... Then try the safe... Things like drop 1 gold coin, and put fifteen ingots in the oak chest work, as I remember, but the parser can be easily fooled, try playing with the war axe, I think you can call it all kinds of things "bladed large handled axe" etc most of which aren't supposed to work...

There's a where spell, oh, the trap-door in the eastern end of the cellar is nice. Check the description when closed and again when open, go outside and close it and it's "hidden". You're supposed to be unable to open it from that side, but I never got around to that.

Things like the ingots, coins etc have different descriptions for single and multiple instances of them, try g iron ingot, dr 1 ingot, ql,dr 1 ingot,ql

Commands can be strung together n,n,n,n etc you can't repeat a command with a single period though (n....), then again, MUD II didn't do that at the time of my writing Rooms...

As you can see from the commands and the SCore it was slowly turning into the dry run for a multi-player thing. Try out the various types of personae, I never did get around to setting an "opening size" for the doors, so the giant can go anywhere and carry everything - except features - and the fairy can carry very little - a tarot card only, I think...

Anyway, download, unzip, run the batch file to run the game and don't be too harsh on the lack of quality of the C code...

Download
The source for Rooms v1.7 was for DOS and built with Borland C++ v3.1. The code is presented "as is" in all its "my first C program" glory. The compiled executable is included just in case...

Rooms17.zip

Leave a comment