TRK File Format

Last updated Feb 23, 2005


Back to RCT home

Note: This is just the first part of the file - I will post more as the rest of the file structure is determined. The TRK file stores RCT3 track design information. The file begins with a header which consists of text based descriptions of data structures used in the game. Most of them do not apply to track files, but they provide some insight to the remainder of the game!

Structures Header
Prelim Info
TrackedRideInstanceSaveHeader
eight byte value
TrackedRideInstance

Structures Header

This section describes various data structures used in the game. It begins with a 4 byte value which specifies the number of structure definitions. You will need to loop through the structure definitions. Each structure definition begins with a "Pascal style" string (which is the name of the structure) followed by a four byte value which specifies the number of primary entries in the structure definition. The "Pascal style" strings used in the file begin with a two byte value which specifies the size of the string (not counting those two bytes themselves). For example, the string "Hello" would be represented as:

05 00 48 65 6C 6C 6F

After reading the structure name and number of primary entries, you then need to loop through a (recursive) routine to read the entries. Each entry begins with 2 Pascal style strings. The first string is the name of the enty. The second string is the data type of that entry. These strings are followed by two 4-byte values. In most cases, the first value specifies the size (in bytes) of the named entry. However, if the data type is: "array", "list" or "struct", then the second value specifies how many sub-entries there are for this entry. For these three data types, you will need to run through another level of a loop with the same routine. That is why this routine needs to be designed for recurssion. The entries can be five or more levels deep.

Note: entries with the data type "string" refer to a slightly different style of string structure with wide (two byte) characters. The length of a string entry in a data structure cannot be determined until the actual structure is interpreted at run time. (And the length contained with the structure definition will be zero.)

For an example of the structures header extracted from a file, go to TRKheaderDefs.html

Prelim Info

This is a sixteen byte structure which appears to consist of two four byte values followed by a "managed object pointer" (which is an 8-byte structure. It starts with an index to a list.) The meaning of this entire structure is yet to be determined.

TrackedRideInstanceSaveHeader

This structure is described within the structures header. The description is repeated here in a readable format:

 

TrackedRideInstanceSaveHeader

11

Cols

int32 4

CompletionLevel

int32 4

Cost

int32 4

NeedScenarioComplete

int32 4

RideAssessmentResults

struct 5

 

AssessmentIsValid

bool 1

 

AssessmentRatings

vector3 12

 

AssessmentReliability

float32 4

 

AssessmentUnderCover

float32 4

 

AssessmentValue

float32 4

Rows

int32 4

SavedSelection

managedobjectptr 8

TestResults

struct 13
 

AirTime

float32 4
 

AverageSpeed

float32 4
 

HighestDropHeight

float32 4
 

MaxLateralG

float32 4
 

MaxNegativeVerticalG

float32 4
 

MaxPositiveVerticalG

float32 4
 

MaxSpeed

float32 4
 

NDrops

int32 4
 

NInversions

int32 4
 

NLiftHills

int32 4
 

RideLength

float32 4
 

RideTime

float32 4
 

Valid

int32 4

TrackedRideInstance

managedobjectptr

8

TrackedRidePreview

managedobjectptr

8

TrackedRideSymbolName

string 0

TrainSelection

int32 4

Note: The last entry is present is user saved track files but not in the default track files that come with the game.

After this structure, there are eight bytes whose purpose is unknown.

Next is a TrackedRideInstance. Check out the definition in TRKheaderdefs.

The data after this point is yet to be determined. Fortunately, the data structures contained within the header section will provide valuable clues as to the data organization.