A quick glance as Titanic: Adventure Out Of Time resources

Recently somebody asked me how to play MOV files from the game. My answer was that I don’t know and we need to wait until somebody reverse engineers of that engine. Meanwhile I took a second look to see if I missed something apparent (spoiler: no).

It seems that all files for that game are in reality archives consisting of multiple entries of various types. Usually first couple of entries are some engine-specific data (they tend to contain lots of strings, sometimes in swapped 32-bit ints so e.g. “Titanic ” turns into “atiT cin“). Then you have various content and it seems that audio parts are archives of their own with an internal table of part offsets and those parts (usually 32-600 bytes long).

In “movie” files I found something that looks like ~32×32 frames containing raw image but I have no idea how they’re related to the movie. There are some large entries that do not look like audio but I have no idea how they should be decoded.

I’ve managed to locate an interesting image decompression algorithm in the code though. Depending on type the image will be either read raw, copied from the reference picture with some offset or updated (with some offset) using different opcodes. Opcode consists of 5-bit operation length and 3-bit operation code, if operation length is zero then another length byte should be read and 32 should be added to it. Opcodes are:

  • 0—read and output one byte and use dst-1 as the reference for delta decoding (described below);
  • 1—use delta decoding with the default reference;
  • 2—skip pixels without updating them;
  • 3—copy pixels from the reference;
  • 4—repeat dst[-1] pixel;
  • 5—read new data for the output segment from the input;
  • 6—read pixel value and fill output segment with it;
  • 7—read 16-bit offset in the already decoded data and copy data from it.

Delta coding copies pixels from the reference and applies deltas to them. It uses unary codes to signal delta values: 1—no change, 01..00000001—read sign bit and add/subtract 1-7 to/from the original value, 00000000—next 8 bits contain the delta value. I honestly did not expect to see such technique here.

Anyway, as I said in my previous glance on various game formats, I believe those “movie” files are in reality just a special kind of data for the engine instead of something that can be played stand-alone. I have no interest in the game itself and it does not look like something easy to RE so I’m leaving it at this.

Comments are closed.