Changes between Version 15 and Version 16 of SC2ReplayFormat


Ignore:
Timestamp:
Aug 9, 2010, 6:09:21 PM (7 years ago)
Author:
mseifert
Comment:

Added information on the replay.details file

Legend:

Unmodified
Added
Removed
Modified
  • SC2ReplayFormat

    v15 v16  
    33The following is a documentation of SC2Replay files.
    44
    5 '''WARNING: The file structure of SC2Replay files as state below is neither complete, nor completely correct!'''
    6 Refer to [http://code.google.com/p/starcraft2replay/] for a better documentation. This page is currently being updated.
     5'''WARNING: The file structure of SC2Replay files as state below is neither complete, nor completely correct!
     6Refer to [http://code.google.com/p/starcraft2replay/] for a better documentation. This page is currently being updated.'''
    77
    88== Data types ==
     
    143143{{{#!div class="version2"
    144144==== replay.details ====
     145noko1111 states the following in his [#vlfDocumentation documentation of the replay.details file]:
     146  It consists of one data type marker followed by data itself. Data type marker is a single byte and can have following values:
     147 
     148  02: Binary data. 02 is followed by size of binary data in VLF after that comes data itself; in most cases it's text in utf8. 02 12 41 55 54 4F 4D 41 54 49 43 is a string AUTOMATIC.
     149
     150  04: An array. 04 is alway followed by 01 00, after that there is number of elements in array in VLF, and elements follow. Each element is a data type marker followed by data, all in same format.
     151
     152  05: An array. Followed by number in VLF which indicates how many pairs will follow -- a pair consists of array element index in VLF and element itself (data type marker followed by data).
     153
     154  06: A number. Its value follows in one byte.
     155
     156  07: A number. Its value follows in four bytes.
     157
     158  09: A number. Its value follows in VLF.
     159
     160  Here are examples:
     161  {{{
     162    binary data (right align)    equivalent in JSON
     163    =========================    ==================
     164             02 04 68 69 => "hi"
     165    05 02 00 02 04 68 69 => ["hi"]
     166    05 04 00 02 04 68 69 02
     167             02 04 68 69 => ["hi","hi"]
     168    05 06 00 09 02 02 09 04
     169                08 09 06 => [1,2,null,3] [''sic''. Correct result: "[1,2,null,null,3]"]
     170    05 04 00 05 02 09 02 02
     171             05 02 09 04 => [[1],[2]]
     172    05 04 00 06 01 02 07 02
     173                00 00 00 => [1,2]
     174  }}}
     175In terms of memory efficiency, it might considered to use a dictionary/map for the 0x05 array type.
    145176}}}
    146177
     
    321352
    322353=== References ===
    323 1. [=#vlfDocumentation] [http://www.teamliquid.net/forum/viewmessage.php?topic_id=117260&currentpage=3#45 Documentation of the variable length format (VLF) by noko1111]
     3541. [=#vlfDocumentation] [http://www.teamliquid.net/forum/viewmessage.php?topic_id=117260&currentpage=3#45 Documentation of the variable length format (VLF) and the replay.details file by noko1111]
    3243552. [=#starcraft2replay] [http://code.google.com/p/starcraft2replay/ Abandoned project of an SC2Replay parser in c++]