Changes between Version 12 and Version 13 of SC2ReplayFormat


Ignore:
Timestamp:
Aug 7, 2010, 2:48:55 PM (7 years ago)
Author:
mseifert
Comment:

Added information on the replay header

Legend:

Unmodified
Added
Removed
Modified
  • SC2ReplayFormat

    v12 v13  
    11= Sc2Replay =
    22[[TOC]]
    3 WARP currently supports the extraction of the following information from .SC2Replay files:
    4  * Player name
    5  * Player race
    6  * Player color
    7  * Game duration
    8  * Game version
    9  * Chat log
    10  * Map preview
    11 
    123The following is a documentation of SC2Replay files.
    134
    14 '''WARNING: The file structure of SC2Replay files as state below is neither complete, nor completely correct! '''
    15 Refer to [http://code.google.com/p/starcraft2replay/] for a better documentation.
    16 This site will be updated soon.
    17 
    18 == File Structure ==
    19 SC2Replay files contain an mpq archive with 8 files. The archive starts at an offset of 1024 bytes.
     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.
     7
    208The types used in this documentation are:
    219||'''Type'''||'''Description'''||
     
    3321}}}
    3422
    35 === replay.info ===
     23== File Structure ==
     24The SC2Replay file format is a binary file format. It basically consists of a header and an MPQ archive.
     25
     26=== SC2Replay header ===
     27{{{
     28#!rst
     29.. class:: wiki
     30
     31  +------------+----------+--------------------------------------------------------------------------+
     32  | **Offset** | **Type** | **Description**                                                          |
     33  +============+==========+==========================================================================+
     34  | 0          | bytes39  | Unknown                                                                  |
     35  +------------+----------+--------------------------------------------------------------------------+
     36  | 39         | int8     | Major version, minor version, revision number and build number of the    |
     37  +------------+----------+ replay (see ticket `#3`:trac:)                                           |
     38  | 40         | int8     |                                                                          |
     39  +------------+----------+                                                                          |
     40  | 41         | int8     |                                                                          |
     41  +------------+----------+                                                                          |
     42  | 42         | int32    |                                                                          |
     43  +------------+----------+--------------------------------------------------------------------------+
     44  | 46         | bytes6   | Unknown                                                                  |
     45  +------------+----------+--------------------------------------------------------------------------+
     46  | 52         | int16    | Duration of the recorded game in half seconds (see ticket `#4`:trac:)    |
     47  +------------+----------+--------------------------------------------------------------------------+
     48  | 54         | bytes970 | Unknown                                                                  |
     49  +------------+----------+--------------------------------------------------------------------------+
     50}}}
     51
     52=== MPQ Archive ===
     53The MPQ archive starts at an offset of 1024 bytes and contains 8 files.
     54
     55==== replay.info ====
    3656This file contains information about the players and the game in general. All offsets are relative to the described block, unless specified otherwise.
    3757
    38 ==== Players ====
     58===== Players =====
    3959The first part of this file simply stores the player names.
    4060
     
    4767||string||bytes5||Function unknown. Always seems to be 0x00.||
    4868
    49 ==== Game settings ====
     69===== Game settings =====
    5070The player block is followed by:
    5171||'''Offset'''||'''Type'''||'''Description'''||
     
    5878||0x05+string+14||string||Some kind of checksum or hash. Usually 76 bytes long (75 without the length indicator of the string).||
    5979
    60 === replay.game.events ===
     80==== replay.game.events ====
    6181This file stores all actions the players have ordered.
    6282
     
    6888||time information + 2||bytesX||Bytes storing information on the respective action. The size seems to depend on the action code.||
    6989
    70 ==== Action codes ====
     90===== Action codes =====
    7191Action codes are unique identifiers that distinguish one action from another. They are 1 byte long.
    7292
     
    89109||0xAC||Selection or deselection.||
    90110
    91 ===== Group actions =====
     111====== Group actions ======
    92112||'''Offset'''||'''Type'''||'''Description'''||
    93113||0x00||byte||If the group is assigned, this byte's value is 0x00. If the group is selected, this byte's value is 0x02.||
    94114||0x01||byte||Function unknown. Always seems to be 0x00.||
    95115
    96 ===== Select action =====
     116====== Select action ======
    97117This action is not reliably documented. The length of the action varies.
    98118||'''Offset'''||'''Type'''||'''Description'''||
     
    115135||0x03||byte||Function unknown. Only present, if the unit is not the last unit of the select action. The exception is that it is present at the last unit entry, if the old selection is dicarded.||
    116136
    117 ==== Ability codes ====
     137===== Ability codes =====
    118138To distinguish abilities or orders, a 3 byte identifier for each order is used. These 3 bytes will be called the "ability code".
    119139
     
    228248||'''Ability code'''||'''Ability'''||
    229249||0xFFFF0F||Right click action||
     250
     251=== References ===
     252[=#starcraft2replay 1.] [http://code.google.com/p/starcraft2replay/]