Time for the next Best of ColdFusion 9 Entry - CFDungeon by Budd Wright. When I saw this entry came in, I decided to be selfish and keep it to myself. I love building games and I knew this entry would be cool. I wasn't prepared for just how cool it is. Ok - so what is it exactly? CFDungeon is an old school text based game. By that I mean everything in the game is textual. To play the game, you enter more commands. So for example, to walk from one place to another you type "north". If you can move north, then the game will tell you about the new location. Text-based games have a long history in computer entertainment, and I played many of them growing up. Some even approached art. (If you ever get a chance to play "A Mind Forever Voyaging" then you will see what I mean.) These games made up for their lack of fancy graphics with prose that was descriptive, engaging, and sometimes downright hilarious. Budd Wright has managed to recreate this in ColdFusion. And wait - this is where it really gets cool. Not only did he build a text-based game in ColdFusion 9 - he built it so you can easily write your own adventures, easily extend the parser, and oh yeah, he did it using freaking Excel files for data. That's stupid.... stupid cool.
When the game begins, you go through a simple character creation process. You have the choice between three different classes: Warrior, Thief, and Accountant. (Yes, Accountant.) After you've created your character you can then choose between two different quests. Both adventures are defines in a separate XLS file. The file defines the rooms, actors, objects, and other quest data. You should be able to build your own quest simply by following the pattern defined in the existing files.
I recommend playing the Old Hat quest. It's simple - can be done in 20 minutes or so - and really has the feel of an old Zork game. Some of the writing is just funny as heck. So for example:
And then...
Or even better...
And this was the absolute best:
So far I've just talked about the game itself (because, frankly, it was so damn fun), but the code itself is pretty darn sweet. It makes use of 100% script based CFCs, which I know not everyone likes, but I'm definitely in the "pro script" camp myself. I saw a few small things I'd probably change. He uses a method called writeLog which matches a built in function in ColdFusion 9. He got it work by scoping it but I'd urge folks to stay away from built in names.
His most critical mistake... and again... this has happened a few times already in this contest (!) is the use of \ in path names. Anyone not on Windows wants to do a search for "xls" to find all the paths and changes \ to /.
Another issue - and we can debate how critical this is - is the use of Application scoped components within his components. So for example, within inputHandler.cfc, you see this:
// Pass the input to the appropriate module handler
Application.components.modules[ Session.module.name ].ReceiveInput( input );
// Clear the last response
Application.components.modules[ Session.module.name ].ClearResponse();
While this works, it creates a dependancy to an Application location that may change in the future. This is exactly where something like ColdSpring can give you a hand.
Outside of that though - it's very good stuff. I'm just blown away. This is incredibly impressive and one of the coolest things I've seen ever. Would I deploy a production application that makes use of Excel sheets for data? Heck no. But you could drop a database in here in probably half an hour. Of course, you then actually lose some of the ease of updating (until you build an administrator).
I really, really, really like this entry. Great job Budd!
Archived Comments
cool, any live demo? :D
Just download it. :)
Do you remember "Oregon Trail" -- good times good times.
Really Excellent Application, Just downloaded and playing the game and yes I have stopped my God of War in PS :-)
Brilliant!
I'm guessing the Thief and the Accountant have pretty much the same storyline? Kidding :) That would be the Banker in the upcoming expansion pack.
Very neat idea though, great entry!
Thanks, everyone! I'm glad you're enjoying CFDungeon -- it was a blast to write. For anyone who can't download it and play it themselves, my company DVS Interactive is also hosting it here: http://cfdungeon.dvsinterac...
There is still a small, but active community that writes interactive fiction. Check out http://www.wurb.com/if/ for a list with ratings and download links. I was a bit skeptical when I first tried these, but some of them are written with a quality of prose and style equaling anything Infocom ever did. Try "Anchorhead" or "City of Secrets", you'll see what I mean.
BTW, you need an interpreter to load of those games, and the site that I referenced is a little fuzzy about that. Check out http://www.ifwiki.org/index... for a list and links. "Gargoyle" is a nice one for Windows, and will load just about any game format.
While not the same thing, this makes me extremely nostalgic for Leisure Suit Larry.... :(
Ben, I agree! Leisure Suit Larry was a fantastic adventure game series, along with the King's Quest series! Too bad the new Leisure Suit Larry games from recent years are all terrible!
Yeah, King's Quest was also a winner. I agree - the older school ones were better, when you could actually move around and type things. The newer ones are all about point-n-click and fancy graphics; to me, it always felt much less interactive.
You can't be called a real adventurer until you have been eaten by a grue or have stuffed a babelfish in your ear!
Let's not forget day of the tentacles, and the old Lucas arts games such as the monkey island and Indiana Jones franchises.
Cool.. so a MUD created using CF?! Nifty!