I’ve seen a lot of folks on my dash saying stuff to the effect of “I wish I could program games”, talking like that’s something that could never happen.
Allow me to introduce you to Inform 7.
Inform is what’s known as a domain-specific programming language; that is, a programming language designed for a single highly specific purpose. In this case, that purpose is creating text adventures.
Don’t know what a text adventure is? As the name suggests, it’s a game where both the user’s commands and the game’s feedback take the form of descriptive text. The player types commands in natural language (plus a few handy abbreviations), and the game tries to make sense of what they mean and provide sensible feedback. Basically, you ever read MS Paint Adventures? It’s like that, except without the pretty pictures.
Now, I know what you’re thinking. How does that help you? It’s still a programming language, and you still don’t know how to program. Well, before you give up, take a look at this:
***
“Easily Escapable Dungeon” by David J Prokopetz
The Dungeon is a room. The description of the Dungeon is “You find yourself in a damp, ill-lit cell. A heavy oaken door stands [if the oaken door is closed]tightly closed[else]slightly ajar[end if] to the north.”
The Hallway is a room. [Don’t bother describing the hallway because the story ends as soon as we enter it.]
The rusty key is in the Dungeon. The description of the rusty key is “A rusty iron key.”
The oaken door is a locked, openable scenery door. It is north of the Dungeon and south of the Hallway. The rusty key unlocks the oaken door.
Carry out going through the oaken door:
Say “You have escaped the dungeon!”;
End the story.***
That up there is the actual source code of a complete, playable – albeit very, very simple – game.
Now, don’t get the wrong idea – Inform isn’t a magic tool that takes any old description and turns it into a game. It’s a programming language that resembles English. You have to be very precise in how you phrase things to make it work properly. Still, if you’re already a perfectionist about your writing – and I know many of you are – then Inform code works enough like natural English that many of the relevant skills are readily transferable.
If you’ve got some time to kill, I totally recommend you give it a spin. It has full-featured development tools for Windows, Mac and Linux, and the dev environment has a complete manual with extensive tutorials and a helpful recipe book for many common programming challenges built right into it. Plus, if anybody following this blog has any questions, I’d be more than happy to answer them. (Within reason, of course.)
Check it out!