Thinking about text adventure games and a new arcade project

I’ve been thinking a fair bit about a new project. In fact I’m a compulsive thinker of new ideas. Even whilst I was trying to bring Hoth Strike to a tidy close I was off in cuckoo land dreaming of a fantasy universe with fancy map and character editors. I still love the idea of having this super rich world with different races living side by side each with their own geo-political issues. I love the idea of different races, communities and individuals having their own particular agenda and I absolutely love the idea of dropping the player right in to the middle of it all. I even started to code a framework to put some flesh on the bones of the idea.

But mid way through something dawned on me. I hadn’t even considered the application for the game. I had no idea how the game would be played and no consideration for the visual appearance / appeal of the game.
I am essentially an arcade gamer. I love the ability to dip in to a game, wreak havoc, obtain a score (high or otherwise) and then just leave it all behind until next time. The games I play are pretty much this sort of game. For some reason I have just harboured this love of computer fantasy role playing and always thought it would be an interesting challenge.

Growing up with a love for Infocom’s Zork probably didn’t help this much. In my youth I wrote all manner of linear adventure games in BASIC. You know the sort, YOU ARE IN A ROOM. DO YOU GO LEFT OR RIGHT. > YOU WENT RIGHT. YOU HAVE FALLEN DOWN A PIT. END. Hmm. Should have gone left.
Those kind of games were littered with GOTO statements and were pretty dreadful to be honest. All the fun was in the creation.

A step beyond all that is the Fighting Fantasy style. These were huge in my youth. I particularly remember Citadel of Chaos for it’s rich definitions and grotesque characters.

mapI got a pen and paper out and sketched out my own idea for a game earlier today. It came out something like the map above. What struck me as fascinating about this was just how easily it translates in to a coding structure. Using JavaScript to create this sort of thing would be a breeze with every location an instance of a Node class of some kind populated individually with specific attributes to prompt the player in to having decisions to make.

So I set about coding a simple structure for this kind of game.

Using JSON I defined the following type of structure:
var locations = [
id : 0,
title : "The Entrance Chamber",
description : "You are standing in a tall but rather narrow chamber. Paintings from a long forgotten time adorn the walls and portray past members of the household. They appear to watch your every move. Quietly you turn to face the open door behind you. It creaks in the wind then SLAMS shut. Darkness falls and you are suddenley met with a shiver.",
prompt : "A staircase leads up away from the chamber. A dusty old chest sits in a dark corner.",
actions : [
text : "Climb the stairs",
nextlocation : 1
text : "Open the chest",
nextlocation : 2

As you can see that array definition could easily go on for several megabytes more. And indeed it will.
Locations 1 and 2 are naturally going to hold information relative to the Staircase and Chest.
I could expand on the location definition to include attributes for light level, HP damage (e.g.poison), gold, inventory items, monsters and so forth. All the game code would be concerned with is picking the details out for that element and presenting the player with a number of choices. As with the map diagram above all roads would ultimately lead you back to the central “spine” of the game until ultimately you reached your goal.

There are two reasons why I particularly like this approach to a game.

Firstly, it’s 100% flexible and easy to replicate. By administering a data source you could rip out a data.js file and bang a new one in there that is a completely different game ! This appeals since I could probably think of countless adventure scenarios.

Secondly, it’s playable on the move. I could simply render text and providing my handset supports JavaScript, CSS and HTML I get a reasonable game experience.

But for the game to really capture my interest it would need a separate combat element. A means of accumulating enough strength, experience, dexterity, intelligence etc to actually do some damage in battle. Further in to the story / game you would then come up against some tough adversaries.

This loosly linear approach to a game also gives me the chance to flex my atrophic literary muscles. I love the idea of being able to go to town describing a location and situation. Better still I could crank up photoshop and sketch out the location with a simple JPG. Where an image exists I simply present it above the text.

There are a great many creative positives to a side project like this. I could have a serious amount of fun just pencilling out the map for the adventure and coming up with a ton of tricky scenarios in which to plant the adventurer.

Check out my extremely roughly coded example here:

Take a look at the data.js file for the structure. You will see that only a couple of locations are coded. But it’s an interesting starting point.

Meanwhile…. I am preparing some graphics for my next graphical arcade game. I’ve already done my own takes on Space Invaders and Defender. Next up I hope to apply a similar spin on Robotron. Somewhere in between Robotron and Gauntlet you will hopefully find my next game, set in a very familiar and extremely popular universe. More soon.

Post a comment or leave a trackback: Trackback URL.


  • Cody  On June 19, 2009 at 10:09 pm

    Awesome, possum.

    I know what you mean being caught up by the ideas themselves, let alone the development of them. I’m the same way. In fact, it’s extremely hard for me to stay focused once I get beyond a few graphics because my mind is always going on new ideas.

    Anyway, I just wanted to make sure you are aware of a couple of sites. Brass Lantern is a great community with many interesting articles for both playing and creating interactive fiction…

    Secondly, there is a fantastic tool that’s made for IF development, Inform 7…

    I realize that you want to build it in JavaScript, but the pages that describe how Inform 7 works may give you a better idea of how to create your own engine… or it may not. ;-)

    I look forward to seeing your next creation.

  • Arcade Flash Games  On June 19, 2009 at 10:25 pm

    Good article will try that.

  • idic  On March 14, 2010 at 2:04 pm

    hi, interesting article. So you have to create a game action plan before you start coding it.
    cheer idic

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: