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!














