Difference between revisions of "Save Game Format (.CHR)"
m (12 revisions) |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | The CHR format is required for storing the user's saved game from Tournament mode. It is a XOR encoded file identified by a DWORD having the value 0xafaeadad (0x00000001 after XOR decoding). The format consists of a number of sections. | |
− | + | == Encoding == | |
− | + | The encoding is a simple XOR mask + iteration scheme. An XOR mask is known or computed for the first byte in each block, and is incremented to produce the XOR mask for the next byte, and so on. | |
− | |||
− | |||
− | + | The first 448 bytes are encoded with a XOR mask starting with 0xac. This covers the [[#Player|Player]] and [[#Tournament|Tournament]] sections. The [[#Opponents|Opponents]] section uses a XOR mask starting with the low BYTE of the size of the [[#Opponents|Opponents]] block. This can be determined by multiplying the value stored at offset 246 by 68. | |
− | + | The [[#Player's photo|Player's photo]] is not XOR encoded. | |
− | |||
− | |||
− | |||
− | |||
− | + | == Player == | |
− | + | Starting at offset 4 for the user (with an XOR mask of 0xb0) and offset 448 for the first opponent (with an XOR mask determined by the explanation above): | |
− | |||
− | + | {| border="1" style="text-align:center" | |
− | + | ! colspan="15" width="25%"| Description | |
− | + | ! colspan="15" width="25%"| Size in Bytes | |
− | + | |- | |
+ | | colspan="15"| Pilot name | ||
+ | | colspan="15"| 16 | ||
+ | |- | ||
+ | | colspan="15"| Wins | ||
+ | | colspan="15"| 2 | ||
+ | |- | ||
+ | | colspan="15"| Loses | ||
+ | | colspan="15"| 2 | ||
+ | |- | ||
+ | | colspan="15"| Rank | ||
+ | | colspan="15"| 1 | ||
+ | |- | ||
+ | | colspan="15"| HAR | ||
+ | | colspan="15"| 1 | ||
+ | |- | ||
+ | | colspan="15"| Arm|Blade|Flail Power, Leg Power, Arm|Flame|Blade|Flail Speed | ||
+ | | colspan="15"| 2 (5 bits per attribute) | ||
+ | |- | ||
+ | | colspan="15"| Leg|Flame Speed|Arm Power(Flail), Armour, Stun Resistance | ||
+ | | colspan="15"| 2 (5 bits per attribute) | ||
+ | |- | ||
+ | | colspan="15"| Power & Agility | ||
+ | | colspan="15"| 2 (7 bits per attribute) | ||
+ | |- | ||
+ | | colspan="15"| Endurance | ||
+ | | colspan="15"| 1 (7 bits per attribute) | ||
+ | |- | ||
+ | | colspan="15"| Credits | ||
+ | | colspan="15"| 4 | ||
+ | |- | ||
+ | | colspan="15"| Ternary HAR colour | ||
+ | | colspan="15"| 1 | ||
+ | |- | ||
+ | | colspan="15"| Secondary HAR colour | ||
+ | | colspan="15"| 1 | ||
+ | |- | ||
+ | | colspan="15"| Primary HAR colour | ||
+ | | colspan="15"| 1 | ||
+ | |} | ||
− | + | The HAR is determined from the following table: | |
− | |||
− | |||
− | |||
− | + | {| border="1" style="text-align:center" | |
− | + | ! colspan="15" width="25%"| HAR | |
− | + | ! colspan="15" width="25%"| Value | |
+ | |- | ||
+ | | colspan="15"| Jaguar | ||
+ | | colspan="15"| 0x0 | ||
+ | |- | ||
+ | | colspan="15"| Shadow | ||
+ | | colspan="15"| 0x1 | ||
+ | |- | ||
+ | | colspan="15"| Thorn | ||
+ | | colspan="15"| 0x2 | ||
+ | |- | ||
+ | | colspan="15"| Pyros | ||
+ | | colspan="15"| 0x3 | ||
+ | |- | ||
+ | | colspan="15"| Electra | ||
+ | | colspan="15"| 0x4 | ||
+ | |- | ||
+ | | colspan="15"| Katana | ||
+ | | colspan="15"| 0x5 | ||
+ | |- | ||
+ | | colspan="15"| Shredder | ||
+ | | colspan="15"| 0x6 | ||
+ | |- | ||
+ | | colspan="15"| Flail | ||
+ | | colspan="15"| 0x7 | ||
+ | |- | ||
+ | | colspan="15"| Gargoyle | ||
+ | | colspan="15"| 0x8 | ||
+ | |- | ||
+ | | colspan="15"| Chronos | ||
+ | | colspan="15"| 0x9 | ||
+ | |- | ||
+ | | colspan="15"| Nova | ||
+ | | colspan="15"| 0xa | ||
+ | |} | ||
− | + | == Tournament == | |
− | + | This section stores a limited set of details relating to the tournament that the user is competing in. | |
− | + | Starting at offset 47 (XOR mask will be 0xdb) and consuming 56 bytes of data: | |
− | |||
− | |||
− | |||
− | Offset | + | {| border="1" style="text-align:center" |
− | + | ! Offset (Size in Bytes) | |
− | \ | + | ! colspan="12" width="16%"| 47–59 (12) |
− | + | ! colspan="30" width="50%"| 60-90 (30) | |
− | + | ! colspan="12" width="16%"| 91-103 (12) | |
+ | |- | ||
+ | !Description | ||
+ | | colspan="12" bgcolor="#DDDDFF"| Tournament file name. MS-DOS 8+3 + '\0' | ||
+ | | colspan="30" bgcolor="#DDDDFF"| Tournament Description. 29 + '\0'. | ||
+ | | colspan="12" bgcolor="#DDDDFF"| Tournament image file name. MS-DOS 8+3 + '\0' | ||
+ | |} | ||
− | + | There is an entire section devoted to the Tournament. It has not been completely de-mystified as yet. Some parts of the section store data on the user's wins or losses against un-ranked challengers, and if any HAR enhancement was won. | |
− | |||
− | |||
− | |||
− | Offset | + | {| border="1" style="text-align:center |
− | + | ! colspan="1" width="5%"| Offset | |
− | + | ! colspan="1" width="5%"| Bytes | |
− | + | ! colspan="1" width="25%"| Description | |
− | + | |- | |
+ | | colspan="1" | 155 | ||
+ | | colspan="1" | 1 | ||
+ | | colspan="1" | Difficulty Level | ||
+ | |- | ||
+ | | colspan="1" | 246 | ||
+ | | colspan="1" | 4 | ||
+ | | colspan="1" | Number of opponents, including un-ranked challengers. | ||
+ | |- | ||
+ | | colspan="1" | 248 | ||
+ | | colspan="1" | 4 | ||
+ | | colspan="1" | Number of opponents, excluding un-ranked challengers. | ||
+ | |} | ||
− | + | Values for the difficulty level | |
− | + | {| border="1" style="text-align:center | |
− | + | ! colspan="1" width="5%"| Mode | |
− | + | ! colspan="1" width="5%"| Value | |
+ | |- | ||
+ | | colspan="1" | Aluminium (Easy) | ||
+ | | colspan="1" | 0x0 | ||
+ | |- | ||
+ | | colspan="1" | Iron (Medium) | ||
+ | | colspan="1" | 0x08 | ||
+ | |- | ||
+ | | colspan="1" | Steel (Hard) | ||
+ | | colspan="1" | 0x10 | ||
+ | |- | ||
+ | | colspan="1" | Heavy Metal | ||
+ | | colspan="1" | 0x18 | ||
+ | |} | ||
− | + | == HAR enhancements == | |
− | + | This section occupies 11 consecutive bytes, and for the user is stored from offset 166 to 176. For the [[#Opponents|Opponents]] the section is stored directly following the format of the [[#Player|Player]] section. | |
− | |||
− | |||
− | + | {| border="1" style="text-align:center" | |
− | + | ! colspan="15" width="25%"| HAR | |
− | + | ! colspan="15" width="25%"| Offset | |
+ | |- | ||
+ | | colspan="15"| Jaguar | ||
+ | | colspan="15"| +0 | ||
+ | |- | ||
+ | | colspan="15"| Shadow | ||
+ | | colspan="15"| +1 | ||
+ | |- | ||
+ | | colspan="15"| Thorn | ||
+ | | colspan="15"| +2 | ||
+ | |- | ||
+ | | colspan="15"| Pyros | ||
+ | | colspan="15"| +3 | ||
+ | |- | ||
+ | | colspan="15"| Electra | ||
+ | | colspan="15"| +4 | ||
+ | |- | ||
+ | | colspan="15"| Katana | ||
+ | | colspan="15"| +5 | ||
+ | |- | ||
+ | | colspan="15"| Shredder | ||
+ | | colspan="15"| +6 | ||
+ | |- | ||
+ | | colspan="15"| Flail | ||
+ | | colspan="15"| +7 | ||
+ | |- | ||
+ | | colspan="15"| Gargoyle | ||
+ | | colspan="15"| +8 | ||
+ | |- | ||
+ | | colspan="15"| Chronos | ||
+ | | colspan="15"| +9 | ||
+ | |- | ||
+ | | colspan="15"| Nova | ||
+ | | colspan="15"| +10 | ||
+ | |} | ||
− | + | Enhancements follow a 0x0, 0x1, 0x2 for each upgrade. For example a value of 0x2 for the Jaguar would mean all upgrades enabled. This has not fully been evaluated. | |
− | |||
− | |||
− | + | == Opponents == | |
− | |||
− | |||
− | + | This section occupies 68 bytes per opponent and follows the format of [[#Player|Player]] + [[#HAR enhancements|HAR enhancements]]. The first opponent will be stored at offset 448. Opponents are stored by Rank, highest to lowest (that is, rank 1 followed by rank 2 ...). Following is the un-ranked or hidden challengers. | |
− | |||
− | |||
− | |||
− | + | == Player's photo == | |
− | |||
− | |||
− | + | An image stored in the OMF2097 [[Sprite format#Sprite Data|sprite format]]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Contributors == | |
− | |||
− | |||
− | |||
− | |||
− | + | * Alastair Hogge | |
− | + | * Carl Manzi | |
− | + | * chaosbm (Richard ...) | |
− | + | * Michael Nicolella | |
− | + | * Mighty Wombat | |
− | + | * Ray Kirkland | |
− | + | * Todd Copeland | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ... | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 21:50, 4 January 2013
The CHR format is required for storing the user's saved game from Tournament mode. It is a XOR encoded file identified by a DWORD having the value 0xafaeadad (0x00000001 after XOR decoding). The format consists of a number of sections.
Encoding
The encoding is a simple XOR mask + iteration scheme. An XOR mask is known or computed for the first byte in each block, and is incremented to produce the XOR mask for the next byte, and so on.
The first 448 bytes are encoded with a XOR mask starting with 0xac. This covers the Player and Tournament sections. The Opponents section uses a XOR mask starting with the low BYTE of the size of the Opponents block. This can be determined by multiplying the value stored at offset 246 by 68.
The Player's photo is not XOR encoded.
Player
Starting at offset 4 for the user (with an XOR mask of 0xb0) and offset 448 for the first opponent (with an XOR mask determined by the explanation above):
Description | Size in Bytes | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Pilot name | 16 | ||||||||||||||||||||||||||||
Wins | 2 | ||||||||||||||||||||||||||||
Loses | 2 | ||||||||||||||||||||||||||||
Rank | 1 | ||||||||||||||||||||||||||||
HAR | 1 | ||||||||||||||||||||||||||||
Arm|Blade|Flail Power, Leg Power, Arm|Flame|Blade|Flail Speed | 2 (5 bits per attribute) | ||||||||||||||||||||||||||||
Leg|Flame Speed|Arm Power(Flail), Armour, Stun Resistance | 2 (5 bits per attribute) | ||||||||||||||||||||||||||||
Power & Agility | 2 (7 bits per attribute) | ||||||||||||||||||||||||||||
Endurance | 1 (7 bits per attribute) | ||||||||||||||||||||||||||||
Credits | 4 | ||||||||||||||||||||||||||||
Ternary HAR colour | 1 | ||||||||||||||||||||||||||||
Secondary HAR colour | 1 | ||||||||||||||||||||||||||||
Primary HAR colour | 1 |
The HAR is determined from the following table:
HAR | Value | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Jaguar | 0x0 | ||||||||||||||||||||||||||||
Shadow | 0x1 | ||||||||||||||||||||||||||||
Thorn | 0x2 | ||||||||||||||||||||||||||||
Pyros | 0x3 | ||||||||||||||||||||||||||||
Electra | 0x4 | ||||||||||||||||||||||||||||
Katana | 0x5 | ||||||||||||||||||||||||||||
Shredder | 0x6 | ||||||||||||||||||||||||||||
Flail | 0x7 | ||||||||||||||||||||||||||||
Gargoyle | 0x8 | ||||||||||||||||||||||||||||
Chronos | 0x9 | ||||||||||||||||||||||||||||
Nova | 0xa |
Tournament
This section stores a limited set of details relating to the tournament that the user is competing in. Starting at offset 47 (XOR mask will be 0xdb) and consuming 56 bytes of data:
Offset (Size in Bytes) | 47–59 (12) | 60-90 (30) | 91-103 (12) | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Tournament file name. MS-DOS 8+3 + '\0' | Tournament Description. 29 + '\0'. | Tournament image file name. MS-DOS 8+3 + '\0' |
There is an entire section devoted to the Tournament. It has not been completely de-mystified as yet. Some parts of the section store data on the user's wins or losses against un-ranked challengers, and if any HAR enhancement was won.
Offset | Bytes | Description |
---|---|---|
155 | 1 | Difficulty Level |
246 | 4 | Number of opponents, including un-ranked challengers. |
248 | 4 | Number of opponents, excluding un-ranked challengers. |
Values for the difficulty level
Mode | Value |
---|---|
Aluminium (Easy) | 0x0 |
Iron (Medium) | 0x08 |
Steel (Hard) | 0x10 |
Heavy Metal | 0x18 |
HAR enhancements
This section occupies 11 consecutive bytes, and for the user is stored from offset 166 to 176. For the Opponents the section is stored directly following the format of the Player section.
HAR | Offset | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Jaguar | +0 | ||||||||||||||||||||||||||||
Shadow | +1 | ||||||||||||||||||||||||||||
Thorn | +2 | ||||||||||||||||||||||||||||
Pyros | +3 | ||||||||||||||||||||||||||||
Electra | +4 | ||||||||||||||||||||||||||||
Katana | +5 | ||||||||||||||||||||||||||||
Shredder | +6 | ||||||||||||||||||||||||||||
Flail | +7 | ||||||||||||||||||||||||||||
Gargoyle | +8 | ||||||||||||||||||||||||||||
Chronos | +9 | ||||||||||||||||||||||||||||
Nova | +10 |
Enhancements follow a 0x0, 0x1, 0x2 for each upgrade. For example a value of 0x2 for the Jaguar would mean all upgrades enabled. This has not fully been evaluated.
Opponents
This section occupies 68 bytes per opponent and follows the format of Player + HAR enhancements. The first opponent will be stored at offset 448. Opponents are stored by Rank, highest to lowest (that is, rank 1 followed by rank 2 ...). Following is the un-ranked or hidden challengers.
Player's photo
An image stored in the OMF2097 sprite format.
Contributors
- Alastair Hogge
- Carl Manzi
- chaosbm (Richard ...)
- Michael Nicolella
- Mighty Wombat
- Ray Kirkland
- Todd Copeland