Some Background
If you have been part of the interactive fiction community for a long time, you might be aware of a document called The Treaty of Babel. Created and signed in 2006, the Treaty formalized a number of things across different tools used the community and, most importantly to many, created something called the Interactive Fiction ID (IFID) that is used by the Interactive Fiction Archive to organize projects. As the Treaty notes, it acts like an “ISBN” for IF works. If your tool creates something people might classify as an IF work, it should assign it a unique IFID.
The establishment of the Treaty in 2006 pre-dates the introduction of Twine 1 in 2009. It is not, as of this writing, part of the Treaty. However, as any other tool that produces IF works, it follows the rules of creating a IFID.
Enter Twee 3 Specification
I’m a co-author of the Twee 3 Specification as well as the other Twine-Specs documents. As the Twine Committee was developing them almost a year ago, we got into a long discussion around an issue about the use of UUID and how we would address the need of Twee works to be compatible with the UUID specification and Twine 2 at the same time. The Treaty of Babel does not specify any particular algorithm for creating an IFID. However, it does note something important that makes a difference between it and the UUID specification: uppercase letters.
Technically, any use of UUID should use lowercase letters as hexadecimal representation. This contributes to its uniqueness and prevents collisions. However, as Twine 2, in following the rules of Treaty, does not do this, all Twee projects had to follow the same pattern. This led to a section now included in the Twee 3 Specification that mentions this issue. The current wording is the following:
An IFID (Interactive Fiction IDentifier) uniquely identifies compiled projects—see The Treaty of Babel. Twine 2 uses v4 (random) UUIDs, using only capital letters, and Twee 3 compilers must follow suit to ensure maximum compatibility.
COMPILERS subsection of Special Passage section in Twee 3 Specification
As part of this discussion, and noting Twine absence from the Treaty, I asked about including Twine and fixing some other issues. There was some interest in updating the Treaty, but there was not enough of a push to act on the changes at the time.
Enter Alan Update
On September 28, 2020, Thomas Nilefalk asked about having the Alan interactive fiction language officially become a signatory of the Treaty. This was a triggering point for Andrew Plotkin to start work on an update to the Treaty that fixed a number of issues and added markdown and HTML versions for easier reading.
(Side note: last year, as part of the discussion around the Treaty and Twee 3, I took some time to convert the Treaty into markdown. I recently gave my work to Andrew, who incorporated parts of it. As the Treaty now has a markdown version, I have removed my project from GitHub.)
Since I saw an opening to get Twine added as a signatory to the Treaty again, I have had some private conversations with the parties involved to see if this might be possible. However, this raised an issue I had not considered before: how do you identify a Twine 1 work?
IFID, Twine 2, and Twine 1 Passages
If you use Twine 2, it generates an IFID using version 4 of the UUID specification. It then encodes this as an ifid attribute as part of the <tw-storydata> element. This means that an arbitrary HTML file can be determined to be a particular Twine 2 work through a two-step process of looking for a <tw-storydata> element and then finding its ifid attribute. Whatever this value is, it will uniquely identify the work.
This is only true of Twine 2 works. Twine 1 does not use the <tw-storydata> element. In fact, as it is based on earlier versions of TiddlyWiki, it uses the same HTML elements. This makes determining if a work is from TiddlyWiki or Twine 1 more difficult. It also directly led to a search for the earliest Twine 1 works I could find to look for common factors across them to isolate an easy way to identify Twine 1 works.
In my searching, the earliest public work I have found is Afternoon in the House of Secrets dating from July 18, 2009 by Anna Anthropy (2009). (Note: the link on IFDB no longer works, but the Wayback Machine has a link from 2011.) The beginning of its “Start” passage is encoded as the following in HTML.
<div tiddler="Start" tags="" modified="200907181900" created="200907181900" modifier="twee">
Another early work is A Kiss by Dan Waber (2010). Its code looks very similar.
<div tiddler="Start" tags="" modified="200907091642" created="200907091642" modifier="twee">
Even CYBERQUEEN by Porpentine (2012) [IFDB entry, current link], which was the first Twine work I ever encountered, has a similar “Start” passage structure:
<div tiddler="Start" tags="" modified="201212142052" created="201212142052" modifier="twee">
Creating a Twine 1 work with Twine 1.4.2 in 2020 also produces the same general attributes.
<div tiddler="Start" tags="" created="202010141641" modifier="twee" twine-position="10,10">
Now We Wait
Discussions are still ongoing. I write this late on a Saturday night after having a discussion about Twine 1 works and their HTML attributes on a Wednesday night. That’s how recent these conversations are.
However, I have written and shared these notes for two reasons:
- We (the Twine community) do not have a good record of early Twine 1 works. I’ve been a part of the community since December 2012 and am not aware of many Twine 1 works. The IFDB has some links, but there is significant room for research and study of early Twine works. I highly encourage those interested to pursue research into this area and looking at longitudinal trends. There’s a decade of Twine works to study now!
- When Twine is added as a signatory to the Treaty of Babel, which I hope will happen soon, it will formally add its works — and generating IFID for older Twine works! — to the IF Archive and IFDB. When that happens, I encourage people to make sure all Twine works have an IFID on the IFDB and other places. Some work will need to be done to update many of the earlier entries.