forked from UnknownShadow200/RCTTechDepot-Archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PRF.html
119 lines (117 loc) · 5.81 KB
/
PRF.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<HTML>
<HEAD><TITLE>PRF file format</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" BACKGROUND="bkground.jpg">
<H1 ALIGN="Center">PRF File Format</H1>
<P ALIGN="CENTER">
<FONT COLOR="#FF0000" SIZE="+2"><B>Last updated Feb 23, 2005</B></FONT>
<H5><BR><A HREF="index.html">Back to RCT home</A></H5>
<P>
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!</p>
<div align="left">
<table border="1" width="25%" bgcolor="white">
<tr><td width="660">Structures Header</td></tr>
<tr><td width="660">Prelim Info</td></tr>
<tr><td width="660">ManagedPlayerProfile</td></tr>
</table>
</div>
<h3>
Structures Header</h3>
<P>
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:</p>
<P>
05 00 48 65 6C 6C 6F</p>
<P>
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: "<b>array</b>", "<b>list</b>" or "<b>struct</b>", 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.</p>
<P>
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.)</p>
<P>
For an example of the structures header extracted from a file, go to <a href="TRKheaderDefs.html">TRKheaderDefs.html</a></p>
<h3>
Prelim Info</h3>
<P>
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.</p>
<h3>ManagedPlayerProfile</h3>
<P>
This structure is described within the structures header. The description is repeated here in a readable format:</p>
<P>
</p>
<table border="1">
<tr>
<td width="512" colspan="3">
<p>ManagedPlayerProfile</p>
</td>
<td width="660">3</td>
</tr>
<tr>
<td width="660" colspan="2">
<p>CurrentScenario</p>
</td>
<td width="660">int32</td>
<td width="660">4</td>
</tr>
<tr>
<td width="660" colspan="2">
<p>PlayerName</p>
</td>
<td width="660">string</td>
<td width="660"> </td>
</tr>
<tr>
<td width="660" colspan="2">
<p>ScenarioData</p>
</td>
<td width="660">array</td>
<td width="660">2</td>
</tr>
<tr>
<td width="131">
<p> </p>
</td>
<td width="131">
<p>LastSaveName</p>
</td>
<td width="660">string</td>
<td width="660"> </td>
</tr>
<tr>
<td width="157">
<p> </p>
</td>
<td width="157">
<p>Status</p>
</td>
<td width="660">int32</td>
<td width="660">4</td>
</tr>
</table>
<P>You can read this structure as follows:</p>
<P>1) read a 32bit value which is the "CurrentScenario"</p>
<P>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.</p>
<P>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.</p>
<P>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. <br>Known values for "Status" are:</p>
<div align="left">
<table border="1" width="40%">
<tr>
<td>0</td>
<td width="445">Locked</td>
</tr>
<tr>
<td width="445">1</td>
<td width="445">Unlocked - no goals met</td>
</tr>
<tr>
<td width="445">3</td>
<td width="445">Apprentice goal met</td>
</tr>
<tr>
<td width="445">4</td>
<td width="445">Entrepeneur goal met</td>
</tr>
<tr>
<td width="445">5</td>
<td width="445">Tycoon goal met</td>
</tr>
</table>
</div>
</BODY></HTML>