Difference between revisions of ".rpl"
Opofefemucu (talk | contribs) |
Wiki.xmoto (talk | contribs) m (Reverted edits by Opofefemucu (Talk) to last revision by Nadenislamarre) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Ca:.rpl|Català]] - [[Es:.rpl|Español]] | [[Ca:.rpl|Català]] - [[Es:.rpl|Español]] | ||
Line 15: | Line 7: | ||
===Header=== | ===Header=== | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 76: | Line 68: | ||
.rpl version 1 includes event data : | .rpl version 1 includes event data : | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 99: | Line 91: | ||
If events' data are compressed : | If events' data are compressed : | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 122: | Line 114: | ||
else if events' data aren't compressed : | else if events' data aren't compressed : | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 139: | Line 131: | ||
===Chunks=== | ===Chunks=== | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 156: | Line 148: | ||
For each chunk : | For each chunk : | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 179: | Line 171: | ||
If states' data are compressed : | If states' data are compressed : | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 202: | Line 194: | ||
else if states' data aren't compressed : | else if states' data aren't compressed : | ||
− | {| border= | + | {| border="1" cellspacing="0" cellpadding="5" align="center" |
!n Bytes | !n Bytes | ||
!Type | !Type | ||
Line 224: | Line 216: | ||
To confirm : according to the code, the size is not limited to 256 chars, but 256^4 | To confirm : according to the code, the size is not limited to 256 chars, but 256^4 | ||
− | BUFFERs are like STRINGs without the first byte | + | BUFFERs are like STRINGs without the first byte "how long the string is". |
Notice that there's ''maybe'' no tailing \0 to mark the end of the buffer ! | Notice that there's ''maybe'' no tailing \0 to mark the end of the buffer ! | ||
Line 237: | Line 229: | ||
TODO | TODO | ||
− | + | "States" follow "Serialized bike state". (in MotoGame.h line ~200) | |
==See Also== | ==See Also== | ||
*[[File formats]] | *[[File formats]] |
Latest revision as of 11:25, 26 November 2010
It's a binary file, and below is a description of it's format.
Contents
Format
Header
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
1 | Byte | Version | 0x01 | Version of the replay |
4 | Little-endian integer | N/A | 0x12345678 | Little/big endian safety check |
? | STRING | LevelID | Level ID | |
? | STRING | PlayerName | Player name | |
4 | Little-endian float | FrameRate | 25 | Replay frame rate |
4 | Little-endian integer | StateSize | State size | |
1 | Boolean | Finished | 0x00 or 0x01 | Level finished ? (0x01 = true) |
4 | Little-endian float | FinishTime | Finish time (in seconds) |
Events
.rpl version 1 includes event data :
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
4 | Little-endian integer | InputEventsDataSize | Uncompressed events' size | |
1 | Boolean | N/A | 0x00 or 0x01 | Are events' data compressed ? (0x01 = true) |
If events' data are compressed :
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
4 | Little-endian integer | CompressedEventsSize | Compressed events' size | |
CompressedEventsSize | BUFFER | CompressedEvents | Compressed events |
else if events' data aren't compressed :
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
InputEventsDataSize | BUFFER | InputEventsData | Not compressed events |
Chunks
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
4 | Little-endian integer | NumChunks | Number of chunks |
For each chunk :
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
4 | Little-endian integer | NumStates | Number of states in the chunk | |
1 | Boolean | N/A | 0x00 or 0x01 | Are states' data compressed ? (0x01 = true) |
If states' data are compressed :
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
4 | Little-endian integer | CompressedSize | Compressed states' size | |
CompressedSize | BUFFER | Compressed | Compressed states |
else if states' data aren't compressed :
n Bytes | Type | Name | Default Value | Comment |
---|---|---|---|---|
NumStates * StateSize | BUFFER | ChunkData | Not compressed states |
Some Explanations
STRINGs are stored in a Pascal-like way, where the first byte tells how long the string is, followed by the actual string. Notice that there's no tailing \0 to mark the end of the string. And yes, this means strings can't be longer than 255 characters.
To confirm : according to the code, the size is not limited to 256 chars, but 256^4
BUFFERs are like STRINGs without the first byte "how long the string is". Notice that there's maybe no tailing \0 to mark the end of the buffer !
Compressed data are in GZip format.
States
TODO
Chunks
TODO
"States" follow "Serialized bike state". (in MotoGame.h line ~200)