Difference between revisions of ".rpl"

From X-Moto
Jump to: navigation, search
m (Reverted edits by Opofefemucu (Talk) to last revision by Nadenislamarre)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://ekipebu.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 
----
 
=[http://ekipebu.co.cc CLICK HERE]=
 
----
 
</div>
 
 
[[Ca:.rpl|Català]] - [[Es:.rpl|Español]]
 
[[Ca:.rpl|Català]] - [[Es:.rpl|Español]]
  
Line 15: Line 7:
 
===Header===
 
===Header===
  
{| border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| border="1" cellspacing="0" cellpadding="5" align="center"
 
!n Bytes
 
!n Bytes
 
!Type
 
!Type
Line 139: Line 131:
 
===Chunks===
 
===Chunks===
  
{| border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;
+
{| 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 &quot;how long the string is&quot;.
+
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
  
&quot;States&quot; follow &quot;Serialized bike state&quot;. (in MotoGame.h line ~200)
+
"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

Català - Español

It's a binary file, and below is a description of it's format.

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)

See Also