Sunday 8 May 2016

Writing Salon Week 2: Choose an Engine

This post is for the May 8-14 writing event of the 2016 AIF Writing Salon. It's not too late to join in. If you have an idea for a game, feel free to discuss it.

If you want to program interactive sex, you need a story engine to run in. Discuss your choices or come get advice about your options. Choose one, install it, and start it up.

For beginner authors, I highly recommend that you choose Twine. Specifically, I recommend Twine 2 with the SugarCube story format. When choosing a story engine, the most important thing is to choose one that has been used in other games. The more people who use a story engine, the better it becomes. There are also more people available who can help you. Twine is the most heavily used story engine available now. To be honest, Twine isn't very well-designed. It's very simple though, and over the years, the community has improved it to the point that it has become very usable. Unfortunately, the main designers of Twine created a new version called Twine 2 that discarded all the improvements made by the community. Twine 2 is easier to use but is missing many of the features from Twine 1 that are needed to make interesting games. The SugarCube story format brings many of these Twine 1 features to Twine 2, and it's mostly compatible with tutorials for Twine 1.

If you have something you want to share, just post it as a comment to the blog post. Be careful to use a separate account for posting and not an account you use IRL. Anonymous comments are welcome, but it would be useful to tag your comments somehow so we know which comments are from whom. AIF Central sometimes has difficulties dealing with longer comments. You can break up your posts into multiple comments, or sign-up to become a blogger on AIF Central and make a new blog post with your content.

25 comments:

  1. A few tips for those using Twine for the first time.

    It is important to note that Twine 2 comes with three options for the Story Format: Harlowe, Sugarcube and Snowman. Each has features in its syntax not shared by the other two. I prefer Sugarcube.

    The latest version of Sugarcube can be downloaded from http://www.motoslave.net/sugarcube/2/ if you wish to use it.


    You can upload other people's games into Twine using the "import from file" to learn how they were coded.

    You can do this with Stacked Justice, first "save as" the link to the game from my web page to download the html file.

    I'm happy to answer any questions about how/why I used particular code.


    In Twine, it is quite easy to accidentally delete great slabs of text or entire passages. As Twine 2 saves automatically every time you make a change, once you delete something it is gone forever.

    In the version I used for Stacked Justice there was a bug that would delete an entire passage if the "search" feature was used in the wrong way. I can see no evidence that this bug has been fixed.

    Also, the "undo" command cannot be relied upon, so make sure you create backups of your work often with the "Archive" feature.

    ReplyDelete
  2. The only advantage I've seen to Twine 2 over 1 is autosave. Twine 1 lets you break the story up into separate files which, to me, is huge. The links showing up from setter links is also nice to see.

    Are there more advantages to Twine 2 that I am unaware of?

    ReplyDelete
    Replies
    1. According to its documentation, SugarCube 2.x for both Twine 1.4x and 2 includes an Autosave API.

      I haven't compared all the APIs much but I agree there doesn't seem to be much advantage beyond the fancier user interface. Sugarcube works with both and appears more feature-complete than the other story formats.

      I suppose it comes down to which user interface allows you to be most productive?

      Delete
    2. Twine 2 runs in your browser, so you don't have to install anything. It can even run on a tablet or possibly a phone. It also looks a little nicer. That's the main reason beginners might prefer Twine 2 over Twine 1.

      Delete
  3. I'm either going to use TADS 2 or 3; neither Twine 1 or 2 is accessible with my screen reader, and I have experience with these two languages.

    ReplyDelete
    Replies
    1. Twine has a variant called Twee where all the code is stored in a separate text file that you can edit with a normal text editor. If you're interested in trying it out, I can research how to set it up.

      But if you have experience with TADS, then definitely use that.

      Delete
    2. I've made my decision; I'm using TADS 2. I'm just not as experienced with T3, and familiarity with a programming language is important (especially when you're a first-time author). Also, there are more sex-related libraries for T2 than T3.

      Delete
  4. Well, I'm using ADRIFT 5 as I usually do. One day I might try experimenting with a new platform, but if I do then it will have to be one that can do things radically different from what ADRIFT can do (so not TADS or even Twine).

    ADRIFT is a really good beginner's platform too, but I'd recommend new players try ADRIFT 4 first because it's built to be super accessible to new users. Once you have a hang of the basic basics from version 4 then you can switch to version 5 for the sake of the newer features (like exporting to a stand-alone executable, and more powerful design options).

    ReplyDelete
  5. Adrift 5 too. I'd prefer using TADS or Inform maybe but I've had to stretch my meager programming skills enough just to figure out ADRIFT. I also like having a graphical visualization of my game, a list of rooms, characters, etc

    ReplyDelete
  6. In a different post, I made a comment about setting up SugarCube in Twine 2 and on the differences between Twine 2 and Twine 1. I am reposting that comment here:

    Sugarcube is available in the web version as well. When you're in your story, just click in the lower-left to change your story settings, and you can change to the Sugarcube story format from there. With Sugarcube, you can use most of the tutorials for Twine 1 from the Twine wiki http://twinery.org/wiki/

    Twine 2 lacks a lot of basic functionality needed for larger, more complex stories. Once you have a lot of passages, it's very difficult to manage everything. Twine 1 lets you spread your stories out across multiple files. You can also save everything in an all-text format, and then write your code in your own editor. In Twine 2, everything must be in one file and everything must be developed from within Twine. Twine 2 also leaves out things like proper support for images and sound. For minicomp games, Twine 2 is fine. If you are writing a long game, Twine 2 is inadequate. All the little problems with Twine 2 add up and become too big a barrier to getting things done.

    The main story format in Twine 2 is called Harlowe. It is an ambitious design that turned out to be too complicated. In Sugarcube and Twine 1, there are two ways to tag things: links and code. In Twine 2's Harlowe, there are four ways to tag things: links, code, hooks, and named hooks. It's just too many things to keep track of.

    Twine 2's Snowman is unusable. Even basic details of the language have not been worked out.

    The programmer for Sugarcube seems to be a very experienced and conscientious programmer. Sugarcube is very well-architected and very consistent internally. All the pieces fit together very well. The building blocks that come with Sugarcube simply make a lot of sense, they fit together well, and provide a lot of power.

    ReplyDelete
    Replies
    1. I believe T2 Snowman is intended as a bare framework for people who want to roll their own code and intend to use a lot of scripting.

      Delete
    2. No, T2 Snowman is incomplete. I don't think the creator has actually tried to make a game in it. The last time tried to use it, there were some pretty fundamental operations that are needed for a game that the creator did not think of including. I'm not sure if creator actually makes a lot of games, so I don't know if he fully understands what's needed in a proper game engine.

      Delete
  7. I will be using Adrift 5 as I have found it quite easy to use and understand without any prior programming experience.

    ReplyDelete
  8. Doing a CYOA, so Twine's the logical choice for me rather than the default of TADS 3. Probably sticking with 1.4.2 since that's version I learned with last year. Since I won't need to use much fancy scripting other than css so I'll spend a few days messing about with each story format.

    Does anybody know the benefits of Sugarcube over Sugarcane?

    ReplyDelete
    Replies
    1. It's basically a rewrite of Sugarcane that uses the features of newer browsers, so I find it more internally consistent. I believe Sugarcane stores the variables of every single turn you make in the URL so that you can bookmark your progress. On longer games, this scheme likely breaks down. Sugarcube stores the variables of every single turn you make internally to avoid this problem. Instead of bookmarks, you must save your progress as a file or in a cookie/local-storage.

      Sugarcube 2 is mostly the same as Sugarcube, but it also works well on cellphones and tablets, so you have an upgrade path for getting your game to work on cellphones too.

      The basic macros are similar for the two story formats (Sugarcane and Sugarcube borrow stuff from each other), but Sugarcube has a few extra ones that are sometimes nice like letting you run macros when a link is clicked. If I recall, Sugarcube also displays better error messages if there's a problem in your code while Sugarcane often displays nothing at all.

      Delete
    2. Thanks, that's helpful. I'd like to use a checkpoint autosave system rather than allow bookmarks or manual saves anyway.

      I think I'll provisionally go with Sugarcube 2 in Twine 1 and fiddle about with it, knowing I can fall back on Sugarcane or Responsive if needs be.

      Delete
    3. Sugarcube has a very devoted fanbase and the developer (The Mad Exile) has been present and very responsive to questions over at the main forums at http://twinery.org/

      I don't believe they are specifically opposed to AIF, (I think I've seen questions asked about it) but might be a good idea if posting sample code to avoid anything explicit and maybe change up your variable names to keep it generalized.

      Delete
  9. I'm using TADS 3. No libraries. I've tried a few libraries and found them too restrictive.

    I've played almost all of the AIF that's out there and as a rule I'd say TADS games are a lot cleaner than ADRIFT. That may be more to do with the authors than the platform, I don't know.

    There are some fantastic ADRIFT games out there, but they seem to be the exceptions to the rule. ADRIFT seems to work better for mostly linear, puzzle-lite games.

    I don't like CYOA games, so Twine wasn't an option for me.

    ReplyDelete
    Replies
    1. I would say there is nothing in ADRIFT that makes it less friendly to non-linear or puzzle heavy games; if your impression is accurate then it's probably due to game developers embracing the platform with the philosophy of being authors first. That is, writing a story first and foremost, with game programming being a lower priority for them. Either that or it's just a question of ADRIFT having a lower skill level required for entry, but I think those two points are connected.

      Delete
    2. If you are using TADS 3, consider using adv3lite from Eric Eve http://ericeve.livejournal.com/ . I think the default adv3 library was designed as the ultimate text-based world model. I think there's enough stuff there to fully model a multiplayer world with everyone interacting with everyone else and everything. If you're actually making a text game, the adv3 library is very much overkill. I often felt like I was wasting my time trying to figure out how the smell sense propagated based on smell sensitivity or of the proper representation of couches as containers that that you could sit on or under and which you could still reach the parent container from. If you just want some text to show when a certain something is typed in, wrestling with adv3 can be painful.

      adv3lite leaves out a lot of the unnecessary stuff. It's still not great because TADS3 still has it's quirks, but it's better.

      Delete
    3. In adv3, there's a world with things in it. Things can perform actions on other things. And the player is just a thing in the world that can observe these actions. In fact, other people in the room might observe the actions too. Everything is nice and abstract. If you type a command, it should trigger your player Thing to do an action, this can be observed by people within sensing range of the action, and you should create a generic description of the action that can be displayed to all the people within that sensing range, that includes the player since the player is doing the action. This generic description will be customized based on the listener with he/you used as appropriate.

      What you actually want is when the player types "kiss girl", certain text should show on the screen and a variable should change. All the adv3 world modelling ends up making things more complicated than they need to be.

      Delete
  10. I'd rather not start writing a game using a subset of the possible functions, only to realize later that I needed something from adv3.

    Anyway, I've written hundreds of pages of T3 code using the default library and I finally feel like I'm getting the hang of it.

    Sunk time fallacy? Maybe, but I've found myself using SenseConnectors, Booths and Postures before, which don't look like they're in adv3lite.

    ReplyDelete
    Replies
    1. If you're familiar with adv3, it's definitely a good idea to continue using it. adv3lite aims for a different trade-off between explicit modelling and custom game code. For things like postures in adv3lite, you're expected to write a lot of if-statements yourself to handle it. Is that better than adv3's explicit modelling of a posture system? That's more of a philosophical debate about what's easier or not.

      Delete
  11. Little Bastard is going to be a choice style game so I'm leaning towards Twine. I plan on writing in a text editor and building using Twee2 with it's baked in version of SugarCube. I've got it all setup right now, so I'm ready to go engine wise.

    ReplyDelete
  12. So I've written up a few rooms and an openable window in TADS 3, Twine 2 and ADRIFT 5 in my limited free time this week and I think I've settled on ADRIFT as my Engine of choice. Twine seems simple but too simple (perfect for CYOA) whilst TADS infuriated me when I was trying to implement the window. ADRIFT on the other hand made all of that incredibly easy - I'm now waiting for ADRIFT to screw me over in some way I'm not expecting.

    ReplyDelete