ADRIFT Developer Resources

This website is not affiliated with or endorsed by Campbell Wild, the author of ADRIFT.
Introduction | Docs & Example Code | FAQ | Free ADRIFT Software | Contact

Intro

ADRIFT is Adventure Development & Runner Interactive Fiction Toolkit written by Campbell Wild. It has gained a lot of popularity in 2001/2002, mostly because it enables people to write Interactive Fiction without learning a programming language (like TADS or Inform).

A major drawback of the system is (well, _I_ find it a major drawback anyway) that it only works on Windows, thereby denying users of other operating systems to play and create ADRIFT games. (yes, I tried wine but I couldn't get it to work) This web page is meant to facilitate the development of software that deals with ADRIFT games on 'alternative' operating systems. Imagine to be able to take an ADRIFT game with you on your PDA, for example.

The information in this site is not directed towards the average ADRIFT users, but to developers willing to write ADRIFT programs or reverse engineer ADRIFT files. Non technical users of other operating systems may, in the future, check under 'Free Software' to find a list of ADRIFT programs for their OS.

Docs & Example Code

ADRIFT games are encrypted/compressed (also: obfuscated), mainly (like other Interactive Fiction languages) to discourage cheating by the player. I have written a small demonstration program that can decrypt ADRIFT files. It is poetically called salvage.c. Being able to decrypt ADRIFT files is needed in order to write an interpreter (runner) and it will also enable to reverse engineer the format further.

The structure (after deobfuscation) of a .TAF file (versions 3.80, 3.90, 4.00) is detailed in taf.spec. It is a human/machine readable file from which all kinds of useful programs can be generated. The .spec file is in the public domain. As an example I present an old version of version390.h; it is generated from taf.spec and under the GNU GPL.

All my code for dealing with .TAF files is currently in a subversion repository. The code is in pre-alpha state; it can be used for almost nothing. The repository can be browsed using the viewvc script on my server. Also, there public read-only access to the repository. If you have installed subversion, the source can be checked out by typing svn checkout http://penta.snel.it/svn/libadrift/trunk libadrift. This command will create a directory libadrift/ in the current directory and populate it with files. The library and examples can be built by cd libadrift; ./autogen.sh && make. Some examples are provided in the examples/ subdirectory of libadrift/. There is NO SUPPORT and you are free to do with this code what you want, as long as you abide by the terms of the GNU General Public License v2.

For the build to succeed, you need automake-1.6 (or 1.7) and flex-2.5.31 (or possibly, any later version). For the people without these development tools (or svn), I have a recent snapshot (revision 477) of libadrift here, build it with ./configure && make, then look at the examples in the directories examples/ and guitest/. This is only a development pre-alpha release, I am not interested in patches (unless they adhere to my coding style and are trivial or very good) and bugreports. I present a futile attempt at documentation, see the README of libadrift.

FAQ

Q: I don't know what to do with salvage.c (can't compile, doesn't work, whatever..).
A: Please learn C and learn to use a compiler. Software that is meant for use by the general public should appear in the Free Software section of this page.

Q: How did you reverse engineer the encryption.
A: Knowledge of basic encryption methods, a modest amount of foresight, knowledge of machine language/assembler and the inclusion of zlibtool.ocx was a big hint about the compression algorithm used in ADRIFT 4.00.

Q: Isn't reverse engineering illegal?
A: No. Please see Article 5 section 3 of the European Union Directive 'Software Copyright Protection' of the 14th of May 1991. It basically says: 'You don't need permission of the copyright holder of a progam to look under the hood and discover its algorithms.' Even laws like the DMCA allow reverse engineering to gain interoperability. Note that the copyright holder in Europe cannot own the algorithms in his/her code, that would require sofware patent laws.

Q: I am an ADRIFT author and I dislike you giving information to people accessing the text in MY game.
A: You released the game for people to play and enjoy it, right? Disclosing this information enables people to write runners and converters for ADRIFT games on other operating systems that Windows alone. This means that you will get a larger audience for your game. Note that other major text adventure languages (TADS, Inform) also have decompilers and multiple interpreters (runners) and that users of that languages also are not immune cheating players and viewing the game text.

Q: I want to be able to release a game so that people only can play it. It should be impossible for people to look at my game from a developer's point of view. I would be disastrous if other authors would be able to learn from my games and make their future games better.
A: Well, it is possible, in principle: 'Protecting' a game in a way you would like involves running the game on a trusted central server and letting the players connect to that server through some web interface.

Q: m33 1337 h4X0r, J00 7311 P4ZZ 70 m33? (How can I get the password from a .TAF file?)
A: Discovering the way the password is stored in .TAF files is not rocket science, but I find it inappropriate and unneeded to release that information. If you really need it for your ADRIFT application then you should figure it out for yourself. If you do find out how the password is stored, use that information at your own discretion, but bear in mind that some authors of ADRIFT games probably assumed that the password was unbreakable and they will probably not very happy about you creating password erasers/displayers.

Free Software

There are currently two Free Software projects that deal with ADRIFT files:

jAsea, an ADRIFT runner in Java,

SCARE, like the other one, but written in C.

If you write free other software, you may submit a link to me and I will put it here.

Contact

You can reach me at rik@snel.it.

Last significantly updated: July 19, 2004.