Vampire the Masquerade: Bloodlines => Bloodlines Modding => Topic started by: Kiyoshi555 on September 11, 2012, 01:28:50 AM

Title: TTZ File Format Question?
Post by: Kiyoshi555 on September 11, 2012, 01:28:50 AM
Hey there, does anyone know if there's a description of the TTZ file format kicking about? I've poked around a bit and haven't had much luck...

(I'm aware that there are some existing tools that will allow me to unpack the data)

For some background, I'm in the process of making an FBX exporter for MDL files - it's mostly working for geometry at the moment and eventually I'll be playing around to see if I can expand it out a bit more for anim data.

Ideally, I'd like my little tool to be able to extract texture information as well (ideally at the same time) to be able to embed it in the export file. I can depend on the textures having been pre-unpacked by VPKTool (or something similar), but that's less ideal... and I'm kind of lazy, so I'd prefer to not have to run two operations when I can just do one. :)
Title: Re: TTZ File Format Question?
Post by: Kiyoshi555 on September 11, 2012, 02:50:28 AM
Ah... nevermind... I think I figured it out.

The texture data is split across the two files - the .TTH file appears to be the header information for a source engine VTF file (plus a bit extra)... I'm guessing Troika just split the header info off of the main body of the texture data as an optimisation. Should be enough for me to muddle along.  :smile:
Title: Re: TTZ File Format Question?
Post by: Kiyoshi555 on September 12, 2012, 11:28:13 PM
... and just in case anyone is ever trying to figure this out...  :smile:

The TTH file is split into two elements... the TTH header (which looks to be about 108 bytes), and the VTF header (for which there is ample documentation in the Source SDK). VTMB uses version 7.1 and the alignment is important for that version.

Edit: The size of the VTF portion of the TTH file is in the TTH header section. There's a four byte tag (T,T,H,\0), another four bytes, and then a size field (long). You can use that to figure out the start offset for the VTF header in the file... since my previous assumption of 108 bytes was just... wrong. It looks like the TTH header portion is actually variable... whee!

The TTZ file is just compressed data. If you run a decompression library (like zlib), you can decompress the entire file. If you then combine the VTF data out of the TTH file and the decompressed TTZ data, you should have a normal VTF file which you can extract data from (as documented in the Source SDK).

Most files tested seem to work fine, so I'm pretty sure the above is correct.  :smile:
Title: Re: TTZ File Format Question?
Post by: Kiyoshi555 on September 15, 2012, 10:25:22 PM
Did some more testing, all the tested character models work. Here are some example images of the exported meshes and textures in maya.

The shaders aren't really good quality yet, they're mostly just defaults... I haven't really spent any time looking at the VMT files. In theory, it should be possible to construct analogs to the Source engine shaders in a 3d app (like Maya).

( (
( (