Hacker News new | past | comments | ask | show | jobs | submit login
Ink – inkle's narrative scripting language (inklestudios.com)
103 points by Tomte on Apr 25, 2018 | hide | past | web | favorite | 22 comments

Also great for scripting chat bots! Used to as part of Air New Zealand's chatbot Oscar. 390 topics, multiple regions, 60K words of content so it helps keep us sane :)

I'd be interested to hear more about this. Is there a writeup somewhere?

No technical write up but you can see how it all hangs together because we have open-sourced the core of what makes Oscar tick: https://github.com/rabidgremlin/Mutters

Also worth checking out Kni, an authoring language inspired by Ink but written in JavaScript, ideal for bringing this kind of content to the web: https://github.com/kriskowal/kni

Now I have this weird urge to build a JS DSL with equivalent functionality using objects, lambdas, and template strings.

You should check out OMetaJS http://www.tinlizzie.org/ometa/ It's an object oriented parser-compiler for building languages (DSLs?) inside a host language. JS is a supported host language.

Ah, but I'm thinking real Javascript, J-expression[1] style. Something like this:

      `I stared at Monsieur Fogg.`,
        if: `know_about_wager`,
        then: [`<> "But surely you are not serious?" I demanded.`],
        else: [`<> "But there must be a reason for this trip," I observed.`]
      `He said nothing in reply, merely considering his newspaper with as much
      thoroughness as entomologist considering his latest pinned addition.`
Or, more complicated:

      `I looked at Monsieur Fogg `,
      {choose: [
        `... and I could contain myself no longer.`,
        `What is the purpose of our journey, Monsieur?`,
        `'A wager,' he replied.`,
        {choose: [
          `'A wager!'[] I returned.`,
          `He nodded.`,
          {choose: `'But surely that is foolishness!'`},
          {choose: [`'A most serious matter then!'`, `He nodded again.`]},
          {choose: [
            `'But can we win?'`,
            `'That is what we will endeavour to find out,' he answered.`
          {choose: [
            `'A modest wager, I trust?'`,
            `'Twenty thousand pounds,' he replied, quite flatly.`
          {choose: `I asked nothing further of him then[.], and after a final, polite cough, he offered nothing more to me. <>`}
        {choose: `'Ah[.'],' I replied, uncertain what I thought.`},
        `After that, <>`
      {choose: `... but I said nothing[] and <>`},
      `we passed the day in silence.`,
      {goto: 'END'}
[1]: http://sriku.org/blog/2012/04/15/j-expressions/

Maybe as a first step... but seems like a "real" DSL would have a lot of benefits... maybe it even compiles to something like your example? Anyway, just thinking out loud... not a critique.

I recommend Ohm instead (made by the same people who made OMeta), which I see as OMeta's successor: github.com/harc/ohm

Ah! I didn't know it existed... I will read about it. Thanks.

I got the same itch and ran with it for a game jam a while back. It's fun! http://steveasleep.com/jumbogrove/

I wish they published Ink scripts for their games (especially Sorcery series), I've beaten them numerous times but the games are so complex that it's basically impossible to go through all branches. Even if I tried I couldn't replicate some of dialogue and that's in a game that always allows you to undo everything!

This is fascinating. If you had such a script, would you simply read it, or would you use it as a guide to play the game so as to produce results you previously hadn't seen?

It looks really cool, much more usable (IMO) than Inform7, which probably is the grandfather of all CYOA languages.

Botsquad's Bubblescript language does something similar, although more imperative: http://www.botsquad.com/2018/04/14/beyond-the-dsl/

tl,dr; A domain specific language for a Dungeon text-like game, see an overview of the language at https://github.com/inkle/ink/blob/master/Documentation/Writi...

If you’ve played any inkle games they’re very far from dungeon.

I’m trying to understand exactly what this is. Is it like Twine?

It's like Twine. AFAIK Twine is mostly for publishing directly to the web.

Ink is more suited for embedding in a game which adds additional presentation or gameplay stuff on top of the text, using some other language/engine (like Unity). It will handle the text stuff, and provide hooks/bindings for the rest of the game to use.

I think the presentation is different. In Twine you have multiple pages of text, linking and branching using hyperlinks. You can publish your game as a html file.

Whereas, in Ink, IIRC the flow is like scrolling text. New passages appear below the older ones, depending on choices made. I don't know a lot about Ink to be honest.

It is similar to twine. The Inkle games so far have either been adaptations of Choose Your Own Adventure-style books or very much like that. You read some text and then you have a few choices. They also have some very basic combat in the Sorcery! adaptations.

How does this compare to Superscriptjs? https://github.com/superscriptjs/superscript

Applications are open for YC Winter 2020

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