PRF File Format

Last updated Feb 23, 2005


Back to RCT home

The PRF (profile) file stores RCT3 campaign 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 profile files, but they provide some insight to the remainder of the game!

Structures Header
Prelim Info
ManagedPlayerProfile

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 four - four byte (32 bit) values. The meaning of this entire structure is yet to be determined.

ManagedPlayerProfile

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

 

ManagedPlayerProfile

3

CurrentScenario

int32 4

PlayerName

string  

ScenarioData

array 2

 

LastSaveName

string  

 

Status

int32 4

You can read this structure as follows:

1) read a 32bit value which is the "CurrentScenario"

2) read the "PlayerName" which is a WideString. WideString's begin with a 32 bit value which specifies how many bytes comprise the string (after the 32 bit value). Next is a 32 bit value corresponding to a (nonstandard) Byte Order Mark which has the value "EFEFEFEF" and can be skipped. This is followed by 16 bit wide characters. The first byte is the ASCII character and the second byte is just zero.

3) The next (and final) element is an array. An RCT3 array has a prefix of two 32 bit values. The first value specifies the size of the entire array structure in bytes. The second value is the index size of the array. For PRF files, the size is eighteen. You will need to loop through the array.

4) Each array entry consists of two items. The first item is the "LastSaveName" which is a WideString. The second item is the "Staus" for that scenario.
Known values for "Status" are:

0 Locked
1 Unlocked - no goals met
3 Apprentice goal met
4 Entrepeneur goal met
5 Tycoon goal met