TRK

From SC4D Encyclopaedia
Revision as of 16:31, 4 August 2012 by sc4e>Whatevermind (organization)
Jump to navigation Jump to search


TRK files (Track Definitions) have been known so far simply as sound settings files. They are also referred to as TKD files. These are the files that other things in the game such as UIs, effects, and exemplars link to. They contain direct properties for either a single sound or a Hitlist playlist, and can link sounds together with a respective logic object. Most of their properties are unknown, however.

The following is a partial specification:

DWORD  Identifier
DWORD  SoF
Data Block (Comma Separated)

The identifier of a TRK file is always 2DKT. This is always the first 4 bytes in any TRK file so its easy to identify them by. TRK files are never compressed.

SoF is the size of the file in bytes after this point. It is a DWORD so it is easy to calculate.

Some TRK files are missing the identifier and SoF fields, and begin with the data block. This is often seen in Rush Hour files.

Data Block

The data block always begins with a Start Signature, which is always TKDT in plain text.

The data block is the main settings area of the TRK file. It consists of 30 commas which which separate 31 areas that can hold various types of data. It is unknown exactly what each area represents however.

Start Signature,(Number 2),,XA Instance ID,TLO Instance ID,(1 byte val),(2 byte val),,(1 byte val),,(val),(9 to 10 byte val),,(1 byte val),(val),HLS Instance ID,,,,(1 byte val),(val),(val),,,(5 byte val),(val),,,(1 byte val),(1 byte val),EoF

Val means just any value. Items simply called "val" above are between 1 and 4 bytes long. The 9-10 and 1 byte bits mean that's all that has been seen as its value. This is by no means supposed to be a complete list. Commas with nothing between them means nothing has been seen between them yet.

EoF is the end of file signature which is always ETKD immediately after the last comma of the data block.


A Full TKD file might look like this:

2DKTJ...TKDT,2,,0xaa726b1d,0xe9233083,0,32,,1,,50,174302531,,0,1024,0xe9dc0f3e,,,,0,111,1000,,,11111,779,,,0,1,ETKD

While a Typical TKD looks like:

2DKTJ...TKDT,2,,,0xe9233083,,,,,,50,,,,1024,0xe9dc0f3e,,,,0,,1000,,,,779,,,0,,ETKD