Sunday 18 June 2017

Inkle's Inky

Although I have written some small AIF games in TADS and Twine, I never enjoyed the process of writing games with those systems. I have often complained that many game engines are designed by people who rarely make games themselves. That's why I was so excited when I recently discovered that Inkle, a well-respected IF developer, has on open source version of some of their game development tools. They have a downloadable game editor called Inky that can generate standalone HTML IF games from code written in a language called Ink.

After reading the documentation about Ink, I am amazed at how much it gets right. The language syntax itself, though, is a hot mess. The language is a confused mess of symbols. There's far too many different symbols, and they mean different things in different places. The { symbol is sometimes a condition, sometimes a sequence, sometimes an if statement, or sometimes a switch statement. Certain actions require different syntax depending on context too. There are three different ways to label a piece of code depending on the type of the code. The language starts out simple, but gets complicated and inconsistent as features are added. Programmers have a joke that the most complicated programming language is one where the GO TO command is replaced by a COME FROM command. The Ink language has a COME FROM command! It's called a "gather".

Despite the language being messy, it has real insights into how to improve the game making process because it was made by real game makers. I am not an experienced game maker myself, but even I can appreciate how the design of the language makes things both subtly and dramatically better for game makers.

For example, one of the hardest parts of programming a game is naming things. Every object and every choice in a game needs a different name. It's hard to think of unique names, and it's easy to get them mixed up. Ink is designed so that many choices in a game do not need to be named. The previously mentioned "gather" command is used so that different choices can all go to the same result without needing to name that result. When you do need to name things, Ink has support for namespaces and scoping. With namespaces, you can name things in a scene in your game without worrying about using the same name in a different scene of your game. The system will automatically work out what you're trying to refer to depending on what scene you're in, but you can still reach into the other scene if you have to. With scoping, you can make temporary variables for scratch calculations. Namespaces and scoping means that you can give things shorter, more meaningful names without worrying about different objects having the same name.

The Ink language has many other great features like

  • Nice ways for structuring code into different files and groupings
  • Code can be written for scenes and for choices too
  • Powerful ways of controlling the flow of a game through the code
  • Easy way to describe conditions for choices
  • Easy way to cycle through different variants of some text
  • Special types for code labels so you don't have to worry about misspelling things in a GOTO and having your code goto nowhere
  • A powerful "list" type that can be used like a set or an enumeration
It's obvious to me that Ink is a well-honed tool designed by master game makers. Ink removes many of the annoyances and difficulties that I've faced with other game making tools. I'm sure a more experienced game maker could find countless more features of Ink's design that make it easier and more enjoyable to make games in the system. Ink may be a bit ugly, but the programmers at Inkle know how to make games, and they've designed a game engine that reflects their years of experience.

I'm really looking forward to trying this tool out. The HTML engine provided with Inky is relatively new, so to customize it with support for game saves and different layouts looks like it might be complicated. But it should still be good for smaller games. I will try using it for the minicomp to see how well it works.

6 comments:

  1. Hi Lost Trout
    Strangely I just downloaded inky today and had a look at it as an alternative to Twine but quickly came to the conclusion that it would take a fair bit of effort to get familiar with it. I also came across another editor called Chronicler which is similar to Twine in that it has a graphical flowcharty sort of interface.

    I've also been playing with inklewriter a simplified online version of ink. This seems ideal for the mini-comp game that I've been flirting with but I'm concerned that as you can only publish and play online (as far as I can see there is no way to download your files) they may not approve of the adult content so the game will be removed, so it might be back to Twine.
    Cheers noweherecity24

    ReplyDelete
    Replies
    1. Many people find Twine easier to start with because having boxes with lines between them makes it easier to visualize what's going on.

      I found that once I had a lot of passages or anything involving programming, Twine quickly became too cumbersome to use. Making passages is a lot of work in Twine too, so it encourages authors to make long passages with few choices. With Inky, choices are so easy that I found I was writing games with more choices and shorter passages.

      Technically, Inky can be used just like Twine's Twee mode. The documentation for Inky isn't well-suited for beginners though.

      Delete
    2. A simple room with choices in Ink would look like this:

      == Room
      You're in a room. What to do?

      + [Go north]
      -> Choice1
      + [Wait]
      -> Room

      + [Leave]
      -> END

      == Choice1
      You go north

      + [Go south]
      -> Room

      That's just like Twine's Twee.

      Delete
    3. I feel your pain about InkleWriter. I've been curious about InkleWriter too, and I've been wanting to use StoryNexus for a long time, but because it's all online, I don't think they want people to use them for adult content.

      Delete
  2. Another neat trick in Ink is that the story engine is designed to be embedded in other games. So if you're making a procedural story based game, *cough, cough* p4p, Splendid Ostrich, Innoxia *cough, cough* then you can use Inky for story creation and embed Ink's separate story engine in the game to run the story logic during the story sections.

    ReplyDelete
  3. Hi Lost Trout,
    Your first reply about choices is spot on, with Twine I tend to write lots of long passages that just overwhelm with text but in Inklewriter because choices are easy my writing is tighter. Also handling variables appears fairly easy in Inklewriter.

    So now I'm actually writing my mini-comp game in Inklewriter and then planning to transfer to Twine once completed.

    I've never used Twee and even though I understand your inky example I still think I would get confused doing the structure.

    This year I'm keen to have a better effort in the mini-comp than my last disaster so I'm going to try and keep is simple.
    Cheers nowherecity24

    ReplyDelete