Hacker News new | past | comments | ask | show | jobs | submit login
Inform: A Language for Interactive Fiction (inform7.com)
121 points by brudgers on Mar 27, 2015 | hide | past | web | favorite | 50 comments



If this piques your interest and you're interested in programming history, you will very likely enjoy reading about the Zork Implementation Language and the Z-machine, on which Inform is based: http://en.wikipedia.org/wiki/Z-machine And the original spec for game authors from Infocom is quite entertaining: http://xlisp.org/zil.pdf

Good stuff. More generally, if you want a short (<1hr) and amusing example of IF, try this: http://pr-if.org/play/violet/


If you enjoy reading about the Zork Implementation Language, you might also enjoy my project, ZILF, which is a working implementation of ZIL: https://sourceforge.net/projects/zilf/

ZIL is basically a domain-specific language on top of MDL, the Lisp-like language that was used to write the original mainframe Zork. The developers went on to start Infocom and split Zork into three parts that were small enough to run on home computers, creating ZIL and the Z-machine in the process.

The source code for mainframe Zork is still available, but the subset of MDL implemented by ZILF isn't complete enough to play it. Matthew T. Russotto has written a MDL interpreter to do just that: http://www.ifarchive.org/indexes/if-archiveXprogrammingXmdlX...


For further reading, I'd like to recommend the book Let's Tell a Story Together: A History of Interactive Fiction by Jimmy Maher. It is available for free from the author (in Kindle format or readable online): http://maher.filfre.net/if-book/index.html

The same author has also written many great blog posts walking through the history of interactive fiction http://www.filfre.net/about-me/sitemap/

His article about Ultima IV got 97 comments the last time it was submitted here: https://news.ycombinator.com/item?id=8020954


I cannot upvote this enough. Violet is wonderful.


Wow, just played Violet and holy smokes that was fantastic. THANK YOU


Has anyone used something like this for non-fictional contexts? I'm really enthusiastic about the future of interactive journalism, particularly in terms of tailoring journalist narratives to each reader.

For example, I think coverage around the announcement of a new tax plan should adjust to the given user (ex. "Under Clinton's plan, your taxes will increase by 5%, to $14,000 annually."). Unfortunately, there just don't seem to be many good tools for allowing non-programmers to encode manipulable facts into their narratives.


I was just thinking about this today because of the Germanwings crash. What if instead of a news article you were presented with a page which somehow led you through a knowledge graph of the topic based on questions or actions by the reader?

When news is just breaking there would obviously be lots of dead ends, but perhaps if people kept inputting the same sort of question it would get flagged and become more important as the story develops. For example in the case of the plane crash, after hearing the initial reports of the pilot being locked out my immediate thoughts were:

    - What is the lock mechanism like? Can the door be opened with force?
    - How is the lock controlled?
    - How is the altitude for autopilot set? Is it easy to set 96 feet instead of 9600 feet?
    - Is there any record of the copilot's vitals before the crash?
    - Why wasn't there another person in the cabin while the pilot stepped out?
...and so on. Some of these were answered, but the only way to really get the information is to read (or listen to) the same kind of reports over and over, hoping for new information and trying not to mistake an over-eager rephrasing as new facts.

What would be great is if I could see a list of topics, select one, and then either highlight sections/tags to follow up on, submit a question, or follow a link to an existing question. The UX here would be a very interesting study I think.

    Inform> Scream expletives at reporter
    That's not a verb I recognize.
---

The simplest way to do this would probably be to get a team of interns to trawl the net looking for what people are talking about after a story breaks (such as top voted Reddit comments), rephrasing them as necessary, and then turning them into tags which people reading the story can then subscribe to. Readers could select existing ones or see them fuzzy completed as they input their own questions. Hmmm.


Yup, I think this is actually one of the more interesting problems on the web today. We have access to more and more information than ever, but it's not organized in good navigation or narrative structures.

Interestingly, I actually think where the innovation is needed is on the input side. It's possible to produce a structured and personalizable story today, but it requires long programming lead times. We need to create systems which make it possible to build such stories at the speed of news.

--- (Shameless plug, but if anyone is interesting in this problem space I'm currently hiring. Email morgante@cafe.com if interested.)


I haven't personally, but I've seen examples of Twine being used for non-fiction branching explorations. Sadly, don't have any to hand.

http://twinery.org/


For your Clinton Plan example, you might want to check out the Tangle JS framework for reactive documents. It allows readers to change a variable in a text and have other numbers change accordingly.

http://worrydream.com/Tangle/


Yes, I'm quite familiar with Tangle and Bret Victor's other work.

While it provides an okay experience on the reader side, it's jut not usable on the writer sideā€”in terms of composition, it's not much better than any other JS framework.

What I really need is a way of letting non-technical writers create interactive stories. Probably the most successful example of this is Excel.


I've been playing with this for a while and, while I don't have any games released, I continue to be in love with this genre. I'm one of those people that has a real mental picture of what I read (frequently better than what movies portray).

There's a huge community of IF fans and producers which really runs more out of love than profit. There's also an archive where you can download a lot of games (or even play them on-line). Check out http://www.ifarchive.org/.


> I'm one of those people that has a real mental picture of what I read

It's always interesting to me when I hear people say this, because I can't understand it at all. If you ask me to close my eyes and visualize a car, I don't actually see anything. I can recall what a car or a specific car looks like, but I don't actually "see" it in any sense. Same with reading - I don't (can't) actually visualize the characters, settings, etc. I'm always momentarily confused when someone complains about a film/TV adaptation with "such and such actor is really good, but that character is supposed to have GREEN eyes!". To me it's an incidental fact, whereas to some people it's central to their conception of the character (as if a real-life person had suddenly changed eye color for no apparent reason).

I've always wondered whether my condition is the norm, or if most people are capable of visual recall.


You'll probably get a chuckle out of the first five-or-so paragraphs of:

http://lesswrong.com/lw/dr/generalizing_from_one_example/

The referenced paper can be found here: http://psychclassics.yorku.ca/Galton/imagery.htm


Wow, the Galton paper is amazing, thank you. To be honest I'm like the scientists that he questioned first... until I read this today, I always thought that the whole "mental imagery" concept was mainly a figure of speech, as when people say they feel butterflies in their stomach, and things like that. I can picture my breakfast table, but it's more of a conceptual sketch than an actual image. I can only focus my thoughts on one thing at a time, and e.g. I know what the colors are but I'm not really "seeing" them in my mind - the fact that people can report a "brightness" value in relation to reality makes me think that my mind really works different from that of those people, for me the brightness question doesn't even make sense.

Now I feel handicapped, although I suppose that maybe if I could conjure up these mental images, I wouldn't be so good at symbolic processing. I guess this is why I have always preferred text to diagrams and such...

By the way, what I can do is hear music in my mind - and yes, this comes with pitch, volume, timbre, polyphony and everything. In fact if I'm at a place with a constant background noise - as in a plane, or near an air conditioning machine - I sometimes think I'm actually hearing it in reality (although I have learned that I'm not). I wonder if other people also experience this.


> By the way, what I can do is hear music in my mind [...] I wonder if other people also experience this.

I remember when I was a kid I told my older brother I could play music in my head just like if I had pressed play in a tape deck. He was really puzzled.

I still can do it and it is definitely accurate. I lack perfect pitch recognition but for some reason when I play music in my head it's played in its original pitch. I use this to my advantage to replace perfect pitch: I just play a song with a known pitch in my head and use that imagined pitch as a relative. This works wonders for interval identification too (e.g. the first two notes in The Simpsons are a tritone apart).


That is fascinating, thanks.


Yeah ... I'm not sure whether it's a good trait or not! When I was young, I could entirely live in my mind if I was bored (or being bullied) and if I hadn't got a job that required me to "play the extrovert", I'd probably be writing fiction. At a minimum I'd be the introverted engineer that looked at his own shoes when I talked to you.

I still have a fondness for books that I might not otherwise have. Some movies seem to be plucked right out of my mental images (The Hobbit and LoTR movies) but others are really disappointing (Ender's Game was way better as visualized in my head).


It's interesting to hear from someone else who also doesn't form mental pictures.

To be honest, I'm not entirely sure I understand what other people mean when they say mental pictures. If I close my eyes and try to imagine an elephant, I find myself describing the elephant essentially with words. There's nothing like an "image" in my mind, though I do sometimes have mental ideas without sentences (for example, I could easily imagine a flow chart right now).

Do other people see actual images when they imagine something?


> Do other people see actual images when they imagine something?

Pretty much.

In my case the image is not very clear around the edges, but it's very sharp where my mind eye is directly looking at. The rest is a bit blurry and fluid, but the general spatial structure is still clear. I do see color too.

It doesn't actually feel like literally seeing. It feels more like the post-processing your brain does after the real sight is processed. I can even mind-see with my eyes open and it feels different, which suggests they're separate mechanisms. It feels kind of like a projection in the back of my mind.

I'd compare it more to remembering sight, with the ability to mix those memories and imagining them (e.g. I've never seen a pink elephant but I can mix elephant and pink color).

For more intricate shapes like people's faces everything is fluid and not very sharp though. I get the rough shape of their heads and obvious details like the hair and then I can focus on specific parts of their face but not the whole picture. I've never been very good at remembering faces, but I'm very good at recognizing faces (even strangers which I just happen to cross on the street), which also suggests those are different brain mechanisms too.

Memorable faces like Angelina Jolie's are easier to picture as a whole, but common faces are harder to picture, no matter how much I've seen them (it's easier to picture Jolie than my own mother).


Yes. I used to be very bad at imagination, but then needed to learn it when I was learning how to paint.

I've started with drawing a dot on the piece of white paper, and was closing my eyes for a few seconds, trying to imagine it.

After that - moved onto simple shapes and colors. Then practiced imagining cars or people's faces. Sometimes you can take a car and "rotate" it in your imagination, or change colors and details.

Or walk down the street and mentally replace buildings with a nuclear wasteland or a jungle with dinosaurs =)

Now I can close my eyes and imagine flying around a city, or enact some cool action scenes, car chases, anything.

I strongly suspect that it's not a limit, Tesla wrote in his autobiography that he could imagine things so vividly that they were like hallucinations, and invented/simulated whole mechanisms in his mind.


I don't think it's fair to call this "imagination."

I have a very active imagination and can easily come up with entire stories, cities, and ideas in my mind. They're just encoded textually.


This is fascinating to me; as is the Galton reference ~gwillen points out, which suggests about 3% of people don't form mental images at all. I haven't previously met anyone who disclaims all such mental visualization, so may I ask a few questions?

Can you draw pictures of things without consulting a present example? (If only slightly or very abstractly, have you ever tried improving this skill?)

If I were to ask you what's the color of Santa Claus's outfit, I suspect you could answer. Is that simply because you remember written or verbal communication naming that color? Do any other aspects of Santa's usual depiction come to mind at the same time, simply as a side effect of being asked about the outfit color?


> Can you draw pictures of things without consulting a present example?

On a scale of 1-10, my drawing ability is, generously, a 1.

> If only slightly or very abstractly, have you ever tried improving this skill?

"Improve drawing ability" is sort of on my back burner of things I should do - think, "I should buy a boat" cat meme. Even if I were consulting a present example, though, my ability to draw something would be very poor, so maybe it's just lack of training?

> If I were to ask you what's the color of Santa Claus's outfit, I suspect you could answer. Is that simply because you remember written or verbal communication naming that color?

I know it's red, but it's a purely verbal phenomenon. Thinking about it now it does sound strange - I know red when I see it, but I honestly cannot conjure up an image of "red", or any other color besides black, if I close my eyes.

> Do any other aspects of Santa's usual depiction come to mind at the same time, simply as a side effect of being asked about the outfit color?

Not unbidden, but if I think about it - grandfatherly, big white beard, ruddy cheeks, white-fur fringed red suit, black boots, portly. It's not necessarily from remembering written or spoken descriptions, though - it's more like my visual memories get encoded verbally.

FWIW I've always done exceptionally well on tests of verbal ability (perfect score on SAT and GRE verbal sections, for example) so maybe the part of my brain that should be doing visualizations is doing word stuff instead? Or, maybe since I lack that component I've had to make up for it by becoming better at language? I'm not sure.


Thanks! Definitely agree what may seem a 'gap' from one perspective may fuel advantages in other dimensions. By analogy to software data, it's almost as if you're 'serializing' memories differently.

One last thing I wonder may be correlated: do you have a good sense of direction/navigation?


I'm about average in that regard, I think. I have friends who are definitely worse, and friends who are definitely better.

If someone gives me spoken directions, or I read them ahead of time and then don't reference them, I generally do fine. But if I walk around in an unfamiliar area I tend to get turned around.


Out of curiosity, is it different if you read a book aloud with someone? I don't usually form mental pictures that much when reading, but I found sometimes a few months or a year after reading a book aloud with my wife, I would be sure I was remembering the movie, only to realize I'd never watched it! :-)


You're not at all alone, many people describe the same experience.


To me, the language is interesting because it could be used for other things...or to put it a different way interactive fiction seems a useful design abstraction for other real world tasks.

What would it mean to wire inform up to arbitrary hardware as a primary user interface?


Infocom themselves tried such a thing many years ago - IIRC it was a db interface language called Cornerstone. Somewhat obviously, not a great success.


Wouldn't that have been with a different language? Inform 7 is a vastly different language from Inform 1-6 (which were relatively Algol-like), and only came out in 2006.


Cornerstone was a menu-driven database application, it wasn't programmable. It would probably have sold better if it was.


The searchable (and generally nicer) view of the Archive: http://ifdb.tads.org/


I took a very non-traditional English class my freshman year of college, and we had an assignment that required us to use this language. From a traditional programming standpoint, I found this platform very difficult to use, though I was never really got too deep into what it was capable of.


> I found this platform very difficult to use

Indeed. When you read IF coded in Inform it all seems to make sense, but when you have to program it you realize you're just learning a very difficult and idiosyncratic syntax.


It's similar to Applescript in that it's a "read-only" language.


Some Inform code would make excellent poetry, however.


Yup. I don't know about excellent, but here's one I like:

The lady is in the lake,

The lady is holding her breath...

When the lady is sad and the window is plaid

Then end the game in death.

More: http://slesinsky.org/brian/code/i7_poetry.html


if you want to read a nice example of inform7 code, emily short's "computers" is wonderfully readable. also as a self-contained piece of code implementing a single object, it's easier to grasp than a full game would be.

http://inform7.com/extensions/Emily%20Short/Computers/index....


From their site:

Inform is a design system for interactive fiction based on natural language. It is a radical reinvention of the way interactive fiction is designed, guided by contemporary work in semantics and by the practical experience of some of the world's best-known writers of IF.

Inform's source reads like English sentences, making it uniquely accessible to non-programmers. It's very easy to get started. Watch a screencast.

Also of interest:

Inform's first website was a single hand-coded HTML page in the primitive, 10,000-site Web of 1995. Today the Web has a hundred million sites, and we're larger and better too.


http://playfic.com is a good archive of inform IFs.


On this topic I'd like to share gist-txt[0] a tool I created to build text adventures starting from markdown files hosted on GitHub's Gist.

It doesn't need hosting as your files will be hosted by GitHub and you can write your interactive fiction stories directly form the web.

It uses mustache templates and JavaScript to achieve minimal interactive functions.

I wrote a little introduction[1] at Ludum Dare's blog and I will use it to write a text adventure for the AdventureJam[2] starting next week!

Note: I took inspiration form Twine[3] and bl.ocks.org[4] for the initial development of the tool.

[0] https://github.com/potomak/gist-txt

[1] http://ludumdare.com/compo/2015/03/05/a-minimal-tool-to-crea...

[2] http://jams.gamejolt.io/adventurejam

[3] http://twinery.org/

[4] http://bl.ocks.org/


If you find this interesting then go back and look at Inform6 and compare the two. It is a fascinating evolution/ revolution.


Sadly, the links to the manuals from this page http://inform7.com/learn/manuals/ are broken.



Oddly, the manual download links have been broken for a while, but the full manuals are included in the IDE download, which works great.


If you scroll down farther, the links to the downloadable versions (both HTML and plain text) appear to work.


I can imagine this being used for educational purposes. It seems that it could be useful to professions that use case-studies to improve trainee's competency. Not profession in it's right, but a more general technical skill is systems-troubleshooting. Imagine having game-like troubleshooting scenarios for people to practice on, that would be really neat.


This seems like the Best. Language. Ever. Obviously not for everything, but the readability of code is off the chart, and IDE and the integration of the documentation with the IDE is really...neat.

I've been looking at this for a few hours, and I am floored.

Am I missing something in existing IDE's?





Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: