Posts in Code
Yarn Spinner

Complicated stories don't have to be complicated to build. We've already seen how Twine has made it easier than ever to create interactive fiction. Another tool, Yarn, has taken inspiration from Twine, and made it awesomely simple to craft interactive fiction.

This is where we come in. We also love telling stories, so we're absolutely delighted to introduce Yarn Spinner, an open source implementation of the Yarn language that's designed to make dialogue in your games a snap.

We built a tiny little demo game, which is set in space and available for you to play right now! It requires a keyboard to play it, and is compatible with most modern browsers.

What's Yarn?

Yarn is a very simple text based format, designed to let you write interactive, branching conversations with the greatest of ease. Here's a snippet:

    // Check to see if we've spoken to Sally already
    <<if $spoken_to_sally is 0>>
        // We haven't spoken to her - run the initial conversation
        Player: Hey, Sally.
        Sally: Oh! Hey.
        Sally: You kind of snuck up on me.
        Sally: Don't do that.
        // Remember that we've spoken to her
        <<set $spoken_to_sally to 1>>
        // Run a different conversation
        Player: Hey.
        Sally: Hi.
    // Now present some options to let the player choose how they'll respond.
    [[Anything exciting happen on your watch?|Sally.Watch]]
    [[See you later.|Sally.Exit]]

Yarn's used in a number of cool games, including Night In The Woods and Knights and Bikes.

What's Yarn Spinner?

Yarn Spinner is a parser and runner for Yarn. It's written in C#, and is designed to be super simple to integrate into Unity games. You just drag and drop a few objects, drag in your Yarn file (which you've written using the excellent Yarn editor), and you've got dialogue running!

I'm already using Yarn's original parser. What does Yarn Spinner do differently?

Yarn Spinner adds a number of useful features:

  • Functions are now part of the language, and you can write your own in C#, where they'll be available to your scripts.
  • The expression parser is quite a bit more powerful, and can handle most things you throw at it.
  • Yarn Spinner is available as a separate .DLL file, which means that it's more separated from your Unity code.
  • Yarn Spinner adds more types of values to the language. Where you previously only had numbers, you now also get strings, booleans and null! Woo, programmer toys!

Is it Open Source?

Yes! The whole source code is available under the MIT license, which means that you can use it in commercial games if you want! The only requirement is attribution.

Where can I learn more?

Check out the Yarn Spinner page, here on our site, or the GitHub page to learn more.

iOS Developer Training Workshop

If you're interested in attending our intensive 2-day iOS Developer Training Workshop in Melbourne, to be run in the Melbourne CBD on May 9 and May 10 this year, please let us know. When we open registrations, we'll get back to you with a discount code and further information. 

Our intensive 2-day workshop is designed for programmers who are proficient with any modern, object-oriented language, such as Java, C++, C#, Python, Ruby, or similar. No knowledge of Swift, Objective-C, or the Apple frameworks is required. This iOS Developer Training Workshop will teach the latest, best practices for iOS development using Swift.  

Our team has written more than ten highly regarded, popular books on iOS and Apple development, and has been teaching software development for Apple platforms for more than 15 years. You're not committing to anything by submitting this form.

Live Online Swift Training

This event has now passed, but we'll be doing it again in the future! Stay tuned. In the mean time, if you want to learn Swift, we recommend out brand new book, Learning Swift!

We're super excited to announce that, next week, we'll be running live online Swift programming training through O'Reilly Media. You can learn more and sign up over on the O'Reilly Media site.

The gist of it is: you'll join us live online for a day of Swift programming, where we'll teach you the language, how to use it for iOS (or OS X) programming, and where to learn more. Everyone will get a video of the training afterwards, as well as an ebook copy of our brand new Learning Swift book.

We're seriously looking forward to this! Please don't hesitate to contact us if you have any questions.

OSCON 2015

We've spent the last week at O'Reilly Media's fantastic OSCON conference, in Portland, Oregon. We presented a whole bunch of talks, ranging from Swift programming to Kerbal Space Program. Friends of ours, and other interesting people, also presented great stuff. Our talks were:

And great talks by our friends, and other interesting people, included:

We also did a book signing (or two), which was as strange-but-awesome experience as ever. We're looking forward to OSCON in Amsterdam! Our photos from OSCON 2015 in Portland are on Flickr.

What we're up to in 2015 (so far!)
Swift Development with Cocoa, new from Secret Lab.

Swift Development with Cocoa, new from Secret Lab.

Swift Development with Cocoa

The new year started off with the official launch of our latest book (co-authored with Tim Nugent): Swift Development with Cocoa.

It covers everything an existing programmer needs to know to build OS X and iOS apps with Apple's new programming language, Swift. You can buy it at O'Reilly, Amazon, as well as many other reputable book sellers.

Ultimate Swift Programming 

We also released, through O'Reilly and again working with Tim Nugent, a 12-hour video tutorial on Swift and Cocoa programming for OS X and iOS: Ultimate Swift Programming: Language, Frameworks, Tools. It's an excellent learning resource on its own, but it also serves as a great accompaniment for the book. It's available at O'Reilly.


Video production command centre, during webcasts.

On top of making pre-recorded videos (Hobart has been a hive of video production and post-production!), we also did two live webcasts for O'Reilly: one on Five Swift Essentials, and one on Building a game in under an hour with UnityThese were recorded and broadcast on Tuesday, 11 February 2015/Wednesday, 12 February 2015 (depending on your timezone), and by all accounts were a great success. Both webcasts were recorded, and the videos are available in their original format via the links above. We'll also post the code and notes right here when it's ready (in a day or two).

New Books

We're working on five more books at the moment (yes, we're possibly insane), and we'll be announcing them very soon. Stay tuned for news! 

New Games

There are three games we're currently working on: Button Squid, Rocket Box, and Gnome's Well That Ends Well. Our local newspaper featured us recently as well, talking to us about our games.

Button Squid, our squid-themed puzzle game is in development, and you can follow it on the Button Squid Tumblr and on Twitter @ButtonSquid. There's also a teaser site at

Rocket Box, a working title, is our economic space empire building game, and you can follow it on the Rocket Box Tumblr, and on Twitter @RocketBoxGame.

And finally, Gnome's Well That Ends Well, a puzzle game featuring gnome dismemberment, which you can follow on Twitter @GnomesWell, and the Secret Lab Tumblr.