Log In  


Ink is an open source, narrative scripting language developed by Inkle Studios. This is my attempt to implement a sub-set of Ink. There's already a Lua implementation of Ink but I'm trying to create something more specifically targeted to PICO-8's limitations.

I'm in no way associated with Ink or Inkle Studios, [marge simpson]I just think it's neat![/marge simpson]

This cart doesn't implement all the features I want to support yet—and not all the ones that are implemented are fully implemented—but I think it's at a stage where it's interesting enough to share, so here it is.

Cart #rajamidiwo-0 | 2025-02-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Here's the actual Ink script which is driving the demo cart for anyone interested:

-> knot_1.stitch_1

== knot_1
= stitch_1
this is a brief demo of the
'ink' narrative scripting
language.

'ink' was developed to create
branching narratives driven by
player choice. to do that we
need choices. use ⬆️⬇️ move
the cursor and ❎/🅾️ to select
an option.

+ option a
  you will only see this text if
  you chose option a.
+ option b
  this text will only be seen if
  you chose option b.

you can have as many options
as you want and each one can
contain nested content that
is only shown when that option
is chosen as seen above.

+ press ❎/🅾️ to continue
  (that was an option)

  -> knot_2.stitch_1
-> END

== knot_2
= stitch_1

you didn't notice but we just
used another feature: diverts.

'ink' lets you divide your text
up into sections called 'knots'
and sub-sections called
'stitches.' a divert, basically
a goto, lets you change the
flow from one part of the text
to another. diverts can even
be put in options like so:

+ re-read this section
  -> knot_2.stitch_1
+ go to next section
  -> knot_2.stitch_2

-> END

= stitch_2

'ink' feeds you lines of text
as you ask for them. it doesn't
care how-or even if-you display
that text. what you do with it
is up to you.

to help with that 'ink' lets
you tag text.

this line has a '\# blue' tag. # blue
this line has a '\# green' tag. # green
this line has a '\# red' tag. # red

+ more on tags

there are no pre-defined tags.
tags can contain arbitrary
text, even spaces, and can
mean whatever you want them to
mean.

# play
for instance, i used a tag to
start playing the music when
this section of the text was
displayed.

+ let the music play

  sure thing!
+ stop the music

  can do! # stop

the full 'ink' language
developed by inkle studios has
many more features and my
pico-8 implementation is only
aiming to implement a tiny
fraction of them. it is very
much a work in progress.

at the moment this is about the
extent of the features
available but i do have more
planned.

-> END

Eventually I want to have this cart function as a tool for narrative development. You'll be able to drag/drop an Ink script onto the cart. The script will be parsed and run in this text mode so it can be quickly and easily tested to make sure it flows the way it's supposed to. And while you could release a pure text, choose-your-path game in this format, that's not really the goal.

Once the narrative is flowing correctly, you'd export it to a compressed binary format which can be loaded into a game from a separate data cart. Otherwise all the code needed for the parser would be prohibitively large and would defeat the whole purpose. You'd only need the decompression code and a handful of functions for manipulating the story text keeping the bulk of your code space available for actual game play. But I haven't implemented any of that yet.

2


Hey, that IS neat!



[Please log in to post a comment]