Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ink – Inkle's narrative scripting language (inklestudios.com)
139 points by Tomte on Dec 21, 2022 | hide | past | favorite | 38 comments


Inkle developed a sample game using both Ink and the Ink Unity plugin, called The Intercept: https://github.com/inkle/the-intercept

And, if I may self-promote a bit: My colleague and I took that game and made it accessible to Windows screen reader users, as a proof-of-concept for integrating our AccessKit project in Unity, and non-Rust environments in general: https://github.com/AccessKit/the-intercept A truly reusable Unity plugin for AccessKit is in development.


I always enjoy looking at these weird little niche languages to see what interesting ideas they have. Ink's got some interesting parallel execution concepts in its 'Tunnels', but I actually think the most interesting thing Ink introduces are itsversion of 'lists', which aren't lists so much as sets, or maybe enumeration types, or maybe they're actually a dictionary with numeric values, or... maybe they're all of those things at once, using a single structure?

Also a bold - but it turns out sensible - choice, for a language oriented towards producing text to not really have extensive support for strings. Because it turns out that strings are a bad idea in most cases! What you actually want are rich templates.


I think the creator of [Dialog](https://linusakesson.net/dialog/index.php) - an IF language that draws inspiration from Prolog - gets the balance between text and code right; most text is ... just text. Code is in parenthesis (looks very familiar to a Clojure developer, funny enough). Indentation and whitespace is meaningless. It can be very expressive and doesn't get in the way.


> concepts in its 'Tunnels'

They have exact semantics of GOSUB, RETURN, and POP from Atari BASIC.

->tunnnel-> is GOSUB tunnel_line_number

->-> is RETURN

->tunnel2-> within a tunnel is basically POP; GOSUB tunnel2_line_number

and

->knot is GOTO knot_line_number

I really like thinking about translating those weird languages into some proper language as directly as possible, but for Ink the host language must have been either Atari BASIC or assembler. Labeled break and continue in modern languages is not powerful enough, even PHP goto is not powerful enough (because it can't goto into a loop or a conditional block).

I mean technically you could do it by simulating goto with break and continue a and faking conditional and loops with this simulated goto, but still there would be limitation that goto target in Ink can be a variable.

Also the whole point of translating language into some proper host language is to able to mix the two as freely as possible.

I wonder how would modern version of goto based programming looked. What tools would we have for tracking errors in such code if we didn't abandon it altogether in favor of nested blocks and functions.

Ink for example tracks dangling ends of the story (not marked with ->END or ->DONE). Maybe goto based coding environment would also have equivalent of something like that. Being split into sections that need to overtly exit to some other section or program end on all the code paths.


You're absolutely right - I meant threads, which are parallel statemachines.


> Ink introduces are its version of 'lists'

I really like how by defining type you also define variable by the same name. I was craving for such feature in many scripting languages in my programming career.


People who write release notes of various softwares, please notice how:

- title contain name

- first sentence describe what it does

- first image shows typical use

This is how you write release notes or landing page.


I've been thinking about using Ink, not for Interactive Fiction, but for Interactive Guides/Documentation.

Wizard/Form Builders are just too constricting, and Static Pages/Doc Generators are too loose. It looks like a good middle ground.

I'm still hesitating between different software. Ink’s Markup format seems good for editing and revision control.



Do it. I've used Ink for tutorials, and it's magic. It works so well. If you add a way to update changes while the app or game is running, it makes an amazing workflow for the tutorial authors or level designers.


I had the same idea a few years ago. We had a chat-bot we used for onboarding, and I considered trying to reimplement it in Ink. Didn't get the chance in the end, but still interested in the idea.


that's a really cool idea! a few years ago I was tasked with building a simple interactive guide to help users with a specific thing (setting up 2FA on their Steam account and connecting it to our website), and it wasn't too bad to throw together a bespoke interactive guide flow thing in html/js, but yeah, you're right, Ink would make something like this very easy. will definitely tuck this idea into the back of my mind for future use, thanks!


this seems like a brilliant idea.


Yeah, you can also definitely do this on "no-code wiki" platforms like notion or coda. I like these two because you can literally build a visual DB of all your references, resources, and entities (with relations, backlinks…)

Ink has its advantages, including the text format and custom logic.


I’ve been using Ink for a personal project for the past 6 months, and it’s amazing in what it enables. But there are just so many small things I wish it supported, actual lists for one. Having to use external functions and recursion is annoying, but it also shows there’s not a lot of commitment to Ink being a “normal” programming language. Also classes, there are so many concepts that are better expressed as classes. Maybe even actual scopes instead of just two levels. Also arguments that don’t take up space in the global naming scope. Just a bunch of things we usually take for granted in programming languages.


Ink was born from the scripting language used for the game 80 Days and the adaptation of the fantasy gamebook series Sorcery!

80 Days is a pretty great game on mobile actually, if you have a few bucks to spare.


Firm agree. 80 Days has great replayability, with a lot of the story options opening up after your first win.

It is essentially a slightly steampunk choose your own adventure. I haven't played in like 7 years, time to redownload :)


80 days is very good, indeed, and with lots of replay value. I never got far with Sorcery!, though, I just keep dying.


I love Ink! You can do so many cool things with it.

Here's a "short" game I made using Ink, and a little bit of CSS:

https://choco-wonka.web.app/


That was pretty good.

Do your various skill levels affect the game in any way?


they open up certain dialogue options as you go, but not as much as I would've liked. When I get to writing the later chapters, the stats are going to figure more heavily into the story.


I highly recommend Ink if you ever get the itch to write any kind of interactive story, even if you plan on implementing the story in something else later. once you get the basics of Ink down it's really easy to get the ideas flowing.

for example, my friend and I were working on making a narrative-focused video game awhile back, and I used Ink to rapidly prototype out the opening scene. for the end product (that never ended up materializing… at least, so far), the gameplay would be completely different, and probably not use Ink at all. but it felt great to bang out the opening scene I had in my mind, to set the mood, get in the groove of writing, and start thinking about how the writing and interactivity could intersect.

to demonstrate how useful and easy to use this is, here's the aforementioned prototypical opening scene, in generated HTML form: https://rezich.com/crimpyr (it's "over" when all you have left to interact with is "[TODO]" scenes) and here's the source: https://rezich.com/crimpyr/source.ink.txt (note that I am not, by any means, a professional writer!!)


I used Ink for a game I worked on (Tender: Creature Comforts). It’s pretty intuitive and very easy to learn, so if you have a kid who wants to give video game development a try, I’d really recommend this one.

The entire game wasn’t coded in Ink, so I’m not sure if it’s possible to do that or not, but you can get all of the dialogue done in it!


This is off-label use for sure, but we support Ink in Abbot. If you want to play around with it in Slack, sign up for a free trial at https://ab.bot then visit https://app.ab.bot/settings/organization/advanced and click "Allow Custom Skills" under "Bot Development Settings". Then you can create Ink skills and call them from chat.

Full disclosure, but we're probably going to deprecate Ink support soon because there are lots of little edge cases and warts that take too much time to support vs. how many of our customers use Ink. Still, fun to play with and you can do some crazy stuff!


It strikes me as a very advanced successor to the PILOT programming language,

https://en.wikipedia.org/wiki/PILOT

Also I want to compare it to Inform7 which similarly offers the ability to make an ‘adventure’ game with a English language interface with a programming language that could be confused for English.


> Inform7

Open-sourced this year: https://ganelson.github.io/inform-website/


It’s almost tempting to try to build something that looks like Inform7 but that lets you express,say, the rules for air traffic control or such.


You mean as a layer on top of a rule engine, OptaPlanner or so? That would be cool.


Inform7 internally works like a very primitive rules engine. The idea we had was to replace that with a RETE engine. Here's a book about writing an adventure game off a 1980's era rules engine

https://www.amazon.com/gp/product/B09ZBN2Y4W/ref=ppx_yo_dt_b...

I tried writing an adventure game in Drools and was able to move between a few rooms but the big problem I ran into was the error messages from Drools didn't make a heck of a lot of sense since Drools mashes up the Java compiler in a complex way with its own syntax.

A really interesting system though would not just have a RETE engine but also a theorem prover. Lately, I have been doing stuff with OWL in which you can define an ontology with not-so-expressive rules and be able to prove its consistency or inconsistency, once you add math to first-order-logic all you can do is say that the prover ran for six hours and didn't find any inconsistencies.

The appeal that Inform 7 adds to this is that it does a very good job of providing a world definition language that looks like English.


I've already mentioned [Dialog](https://linusakesson.net/dialog/index.php) above; you seem primed to check it out; Dialog is a mix of ideas from Inform7 and Prolog. Crazy, and it seems to work.


when my son was 8 (or 9) he coded a few games in ink (all german)

https://kianprov.neocities.org/der-anschlag

https://kianprov.neocities.org/minecraft/

https://kianprov.neocities.org/Der%20Kristall/index.html

and the final one

https://kianprov.neocities.org/schere-stein-tod/index.html (scissor stone death)

i think its a great language to learn coding and making games, no need to deal with annoying assets or designs.


Here's [1] a playable transcription of the original Oregon Trail (1971) source code (BASIC) into Ink. The project really gave me an appreciation for structured programming (e.g. loops, conditionals) which was once controversial [2].

[1] https://unfold.studio/stories/10782/

[2] Dijkstra, E. W. (1968). Letters to the editor: go to statement considered harmful. Communications of the ACM, 11(3), 147-148.


It’d be interesting to see the intersection of AI-generated text+code and Ink. ChatGPT could go beyond writing short stories, and produce larger-scale works of interactive fiction.



Really interesting language with very rich semantics https://github.com/inkle/ink/blob/master/Documentation/Writi...

and flexibility of control flow I haven't seen since Atari BASIC.


Related:

Ink – inkle's narrative scripting language - https://news.ycombinator.com/item?id=16925588 - April 2018 (22 comments)


How does this compare to Z-machine games?


Your interactions are limited to choosing from a list of available options; there's no concept of rooms, or verbs, or inventory - just a "knot", a kind of node in a tree of dialog. However, there can be a lot of state, which can control, or flavor, the available options at any knot.




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

Search: