38 comments

[ 2.6 ms ] story [ 92.7 ms ] thread
I use Inform 7 as the very first case study language for a class I teach in programming language design theory for a uni CS program.

* It's very well documented. The entire compiler design and language grammar is detailed to near text-book standards.

* It's a language that none of my students have ever heard of before

* The syntax of the language is an English-like syntax which weirdly trips up most CS students the first time they see it

* It's a great example of a language used for specialty purposes. No kitchen-sink language here.

Students at first hate it...but many have told me later that they really like coding an IF game using Inform 7 once they get the hang of it.

Thanks for the unique perspective!

What’s an IF game? Very difficult to search that; Google prioritizes matches containing the English word ‘if’.

Interactive Fiction
Note well that people who enjoy Interactive Fiction (what we used to call "text adventures") ought to be the most likely people to forgive the fact that a pseudo-natural language interface is, in fact, much pickier with regard to accepted input than actual natural language. (what we used to call tolerance for "guess the verb")
(comment deleted)
(comment deleted)
> What’s an IF game? Very difficult to search that; Google prioritizes matches containing the English word ‘if’.

Replace "IF" with "text adventure" and you'll get better results. Their heyday was pre-Windows and the classic names to look for are Infocom (US), Scott Adams (US), and Level 9 (UK).

Edit: To add, just download Inform and try it, alongside https://ganelson.github.io/inform-website/book/WI_1_1.html which takes you step by step through stuff.

An example of the syntax, from a version of Dijkstra's algorithm[0]:

    The current node is a node that varies.
    A node can be found, examined, or unreached.
    A node has a number called the total distance.  
    Definition: a node is near if its total distance is 10 or less.
    Following relates various nodes to one node (called the precedent).
    The verb to follow (he follows, they follow, he followed, it is followed, he is following) implies the following relation.
[0] https://literateprograms.org/dijkstra_s_algorithm__inform_7_...
It looks like classic mathematical demonstrations in old books, before they learned to use algebra for everything :-)
> Students at first hate it...but many have told me later that they really like coding an IF game using Inform 7 once they get the hang of it.

A sign you're pushing them out of their comfort zones. Probably one of the bigger gifts a teacher can give their students

> but many have told me later that they really like coding an IF game using Inform 7 once

TIL a programming language purpose built for text adventure games, Is there any example of a famous game written using it with source? I wonder whether inform is specifically useful where there's meta programming within the game.

Also, You seem to take extra care and effort in teaching your students and I appreciate it.

Edit: It seems like there are several inform 7 games at itch.io - https://itch.io/games/tag-inform-7 .

Bonus: While searching about how the games are published on web, I found the following snippet -

   Release along with an interpreter.
Apparently that creates a web page and encodes the game as a Parchment (Javascript) file!
> Is there any example of a famous game written using it with source?

Here's a page of links to Inform source for a number of games including Zork. Obviously it's a rewrite of Zork using Inform as Infocom predate Inform by many years.

https://ifarchive.org/indexes/if-archive/games/source/inform...

Excellent, Thank you. Considering there's no use in protecting the source of web games, I guess most would be inclined to release it anyways.
Inform 7 is a work of art, and a true inspiration for all programming language designers and writers.
I'm a little surprised that while using language models for generating text is suggested, there's no suggestion at using other ways to parse input. It feels like there is some much more advanced technology here that could be put to use.

There's a certain danger to letting the AI "find" the answer, that is you are trying to find an overlap between what the user entered and the options that are available in a situation, and since the program can enumerate the options it might find solutions that the user didn't _really_ identify. But if you are comfortable with a game that might err on the side of being easy... at least I would prefer that, as I tend to find IF too frustrating to play because it's like I'm trying to get in the author's head and figure out what they want me to type.

It would be interesting to think about how GPT-3/etc can be used to generate stable non-hallucinatory descriptions. It could solve some of the combinatorial problems of state and generating descriptions, and perhaps even raise interesting and unplanned events. But to do that you'd almost have to parse the results and then incorporate them into the world (or reject the results and regenerate). That's... actually how a lot of Inform works, so maybe it's a real option? It seems particularly interesting for NPCs, where perhaps you could use a language model for responding but _also_ allow for the model to suggestion NPC actions. By parsing them similar to how you parse player input you can keep the NPCs from being able to do impossible things (a big problem in AI Dungeon) but allow them to attempt actions. Then inform becomes the stable model of the world in which both players and bots are doing things. (This idea actually has me kind of excited...)

In the IF genre, how popular is Inform? Is it used to write most games? Some? Just curious as I enjoy the occasional IF game.
It's used for the majority of parser-based games (in the traditional text adventure style). But there are many more games these days that are choice-based (like a choose your own adventure book), Inform can potentially be used for such a game, but few of them are made with it. The most popular tool for those games is Twine.
It dominated the scene for quite a while. Looking at the Xyzzy award winners will confirm that. Even the first Best Game winner ("So Far" by Andrew Plotkin) was an Inform 6 game.

However over the past decade or so the scene diversified a lot more, particularly as choice-driven rather than parser-driven games became a lot more popular. Twine is a tool for making browser IF games that really broke through there, although in recent times Ink has gained popularity both for making IF and as a tool for making dialogue systems in other non-IF games. Most new parser-IF games I encounter though still tend to be Inform.

A small tangent: for readers interested in IF and curious about trying to write one, Inkjam is 3-day event where you make a short game with Ink, and this year's event is in early September. I participated last year and it's good fun and a good challenge!

Anchorhead, Slouch Over Bedlam, Curses!...

The list for good Inform6 and if7 games it's huge.

FWIW, I recently found a succinct description of the strengths of parser-based and choice-based IF tucked away as an aside in an article by Jimmy Maher on a different subject [1]:

> a hypertext narrative built out of discrete hard branches is much more limiting in some ways than a parser-driven text adventure with its multitudinous options available at every turn — but, importantly, the opposite is also true. A parser-driven game that’s forever fussing over what room the player is standing in and what she’s carrying with her at any given instant is ill-suited to convey large sweeps of time and plot. Each approach, in other words, is best suited for a different kind of experience. A hypertext narrative can become a wide-angle exploration of life-changing choices and their consequences, while the zoomed-in perspective of the text adventure is better suited to puzzle-solving and geographical exploration — that is, to the exploration of a physical space rather than a story space.

[1]: https://www.filfre.net/2017/10/a-full-motion-video-consultin...

Jimmy Maher's blog on the history of computer gaming, which emphasizes interactive fiction, has been going for years and is a comprehensive (and highly readable) source information of how companies like Infocom and other "adventure game" designers in the 70s and 80s led to computer gaming as we know it today.
For a couple of years I've been compiling an (admittedly worse) fuzzy-parsed version of this with GPT-3 (and friends) to generate and play out executable Javascript lore in an RPG engine.

So, I am very surprised I'm only hearing about Inform now -- clearly not hanging out in the right circles.

Does anyone have any recommendations for keeping abreast of projects like this so we can leverage the best of open source and not reinvent the wheel?

I just found out about NarraScope and I hope to attend the next one. Is there other things I should check out? Twitter firehose doesn't work too well...

Wikipedia perhaps.

Twitter etc are great for learning about new things. I don't think they are good for learning about specialized topics that have a long history.

https://intfiction.org/ is the main community hub these days for parser based game development, maybe some of the topics there might tickle your fancy
Wow, if you've been working on interactive narrative and you don't know about Inform and (I assume) interactive fiction (IF)...you are in for a treat.

Probably a reasonable overview of the community is the IF forum, intfiction.org. But there are many others.

A good overview of games written is ifdb.org and ifcomp.org. For example, https://ifdb.org/viewlist?id=k7rrytlz3wihmx2o

Things to search (include "interactive fiction" in each):

Tools: Inform, TADS, Dialog, Twine, Choicescript, Ink

People: Emily Short, Andrew Plotkin, Jon Ingold, Christine Love, Aaron Reed, Chris Crawford, Porpentine...there's so many.

Have fun!

Also, do yourself a favor and read the Inform Designer’s Manual, Edition 4. It’s dated (I think it came out in 1998) and pertains to Inform version 6, but it is still very relevant (modern Inform uses I6 under the hood), and it’s a lovely piece of technical writing.
Great to see that Inform has been open-sourced, it's a fascinating project.
It is not at all the point of this talk, but as a side-note:

> …the functional programming language Haskell [compiles] via C, for example…

This is not correct. GHC, the de facto Haskell compiler, targets an intermediate language called C--, which resembles but is not identical to C and was explicitly designed as a compiler target. The point that some languages do compile to other high-level languages is true—Nim and Haxe being some good examples—but it is not true of Haskell.

Given how many people fundamentally refuse to distinguish between C and C++, this may be a lost cause.
Historically speaking, GHC has had C backend option to facilitate porting.

https://downloads.haskell.org/~ghc/9.4.2/docs/users_guide/co...

> -fvia-C

> Use the C code generator. Only supposed in unregisterised GHC builds.

> This is the oldest code generator in GHC and is generally not included any more having been deprecated around GHC 7.0. Select it with the -fvia-C flag.

> The C code generator is only supported when GHC is built in unregisterised mode, a mode where GHC produces “portable” C code as output to facilitate porting GHC itself to a new platform. This mode produces much slower code though so it’s unlikely your version of GHC was built this way. If it has then the native code generator probably won’t be available. You can check this information by calling ghc --info (see --info).