TranslateProject/sources/tech/20220208 Twine- Open Source Tool for Making Games with Words, aka Interactive Fiction.md
DarkSun d259bfd56c 选题[tech]: 20220208 Twine: Open Source Tool for Making Games with Words, aka Interactive Fiction
sources/tech/20220208 Twine- Open Source Tool for Making Games with Words, aka Interactive Fiction.md
2022-02-08 05:02:32 +08:00

6.3 KiB
Raw Permalink Blame History

Twine: Open Source Tool for Making Games with Words, aka Interactive Fiction

Brief: Twine and free and open source tool for creating interactive fiction or text based games.

Everyone has a game inside them waiting to come out, just like a chestburster. Unfortunately, not everyone has the skills to create a game, especially one complete with graphics. Thankfully, there is a way to create a fun game using only words. Let me share an application that could help you with it.

What is Twine?

Twine story list

As I alluded to above, Twine allows anyone to create a game without needing to know how to write code. Remember those Choose-Your-Own-Adventure books? Thats essentially how Twine works.

You create a series of passages, which can be one sentence or a wall of text. You named each of these passages, so you can keep track of them. After that, you connect these passages and create several paths for the player to follow based on their decisions.

Creating a new passage is as easy as putting double brackets around a sentence, for example, Lets continue!. In this example, “Lets continue!” is the link you click to get to the new passage, and that sentence becomes the name of the new passage.

I prefer to make the name of the new passage different from the linking sentence. You can do that using this format: Lets continue!. In this example, you click the sentence “Lets continue!” to go to the passage titled start-journey.

Twine editor

When youre done, you can publish the game as an HTML file and share it with friends or share it on a site like itch.io.

There are more advanced features available to make more intricate games. These features include:

  • Support for variables
  • Input boxes to get information from the player
  • if…then statements
  • Loops and more

Another thing to keep in mind is that, Twine makes use of multiple Story Formats. A Story format is essentially a game engine that is baked into the HTML file and makes the game work. Twine comes with three Story Formats:

  • Harlowe This format is the default, and it designed to be easy for beginners to learn
  • Snowman This format is for game developers who are more familiar with JavaScript and CSS. Use this format to make a customized playing experience.
  • SugerCube This format is inspired by early versions of Twine and allows the player to save progress and other features.
  • Chapbook This format is designed for newer users and have advanced functions built in.

Twine story structure

Installation

Unfortunately, most repos do not have the latest version of Twine. This may change in the future.

If you are on Arch or have the Homebrew 3rd party package manager installed, you are in luck.

Otherwise, you need to download the latest version and from the site, unzip the folder and run the executable.

If you dont want to install Twine or if you want to try it first, you can check out the online version.

My Experience

Ive created a couple of games with Twine for some game jams. These were the first games Ive ever created, and I had fun. At that time, if you wanted to use the advanced features, you had to do a bit of coding. Now, you can add those features using tools in the editor.

One of the problems with Twine is that you cannot really use it with git. Thats because the Twine editor stores all files in the same place. There is no way to change the destination for one.

Another issue is that it is a pain to proofread a game. There is an option to “View Proofing Copy”, which shows you everything on a single page. If you have a smaller game, then there is no issue, but if you have a larger game, it takes to fix spelling and grammar errors. Thankfully, there is a tool for that.

Tweego is a tool written in Go that allows you to write your Twine game using plain text files. Tweego was inspired by twee, which was Twines official command line tool. twee hasnt been updated in 5 year so cant be used with the newer version of Twine. Tweego allows you to export your game directly to HTML or to the Twine format.

You can easily use git to back up files create with Tweego. The text files are also very easy to put into a spellchecker. Here is the text file for a simple game I wrote using Tweego to give you an idea of how readable it is.

Twine dark mode on Windows

Final Thoughts

Overall, I think that Twine is a very good tool to create games. It is very simple to learn and has tools that allow you to create fairly complicated games without needing to know how to code.

I worry though that most people ignore games that dont have flashy graphics. Text games were the first games on computers and are still fun to play. All you need is a little imagination.


via: https://itsfoss.com/twine/

作者:John Paul 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出