There was a recent thread about embedding an IFID in new or one-off game formats. I said that the Babel spec doesn’t describe this, but it should.
I have written up a small update to fix this. This is my current draft:
2.2.2. The IFID for a game format that embeds an IFID
[This section just summarizes the IFID formats for non-legacy game files…]
Modern Z-code and Glulx game files may be branded with a text such as this:
UUID://1974A053-7DB0-4103-93A1-767C1382C0B7//
(Recall that I7 uses a UUID-generating algorithm to create IFIDs.) This text is written in a character array in byte-accessible memory. Its location cannot be guaranteed, so the whole of byte-accessible memory must be scanned for the pattern UUID://..//
.
Some Hugo story files contain an embedded UUID IFID, however the text is obfuscated by 20 being added to the value of each byte. The IFID can be located by looking for hyphens in the right pattern, though note that the hyphens are themselves obfuscated (and become "A"s).
Adrift 5 story files contain an embedded iFiction record which specify the IFID of the story file. Note that this IFID is not a valid UUID.
2.2.3. The IFID for an HTML story file
[No change to this section.]
2.2.4. The IFID for other file formats
Other formats include executable files, game files from systems not described in this agreement, and other document formats (including plain text).
Such a file may include the text UUID://...//
as a literal byte sequence. If it does not, then the IFID is the file’s MD5 hash code, with hexadecimal characters a to f written in upper case, A to F.
If the file format precludes storing the UUID://...//
sequence, then the IFID is always the MD5 hash code.
2.2.5. IFIDs for legacy projects
A “legacy” story file is one which pre-dates the present standard; that is, it does not incorporate an IFID in one of the ways described above.
A design system may provide an algorithm to determine a IFID for a legacy story file. The method should be reasonably straight-forward and documented here. Moreover, the design system should then provide an implementation of this algorithm in portable C: see §2.3, “The “babel” tool” below.
Legacy story files not covered by such algorithms have IFIDs equal to their MD5 hashes, as described above.
I’ve dropped the later section “IFIDs for projects falling outside this agreement”, since the sections above cover those cases.
I’ve also renamed the section “The IFID for an executable file” to “The IFID for other legacy file formats”, and added the note:
The concept of “executable file” is itself something of a legacy. There are many possible “executable” formats, and this document does not need to distinguish them.
We still have the table of MZ/ELF/MACHO/etc formats. But we can leave that alone for the future and not try to add general-purpose executable formats invented since 2006.