PageRenderTime 64ms CodeModel.GetById 47ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/ghost/w3g_format.txt

http://ghostcb.googlecode.com/
Plain Text | 1336 lines | 1070 code | 266 blank | 0 comment | 0 complexity | ee6b1d9dd3cf36a4517483db8286cbdc MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1*******************************************************************************
   2* WarCraft III Replay file format description                                 *
   3*                                                                             *
   4* document version: 1.15                                                      *
   5* document date   : 2004-04-30                                                *
   6* document authors: blue, nagger                                              *
   7*                                                                             *
   8* For more informtion about w3g file format, please visit:                    *
   9*   http://w3g.deepnode.de                                                    *
  10* and                                                                         *
  11*   http://warcraft.kliegman.com                                              *
  12*                                                                             *
  13* Check out the developer forum on:                                           *
  14*   http://shadowflare.gameproc.com                                           *
  15* or contact us via mail                                                      *
  16*   mailto:w3g_format@deepnode.de                                             *
  17*                                                                             *
  18*******************************************************************************
  19
  20===============================================================================
  21Table of Content
  22===============================================================================
  23 1.0 Introduction
  24 2.0 [Header]
  25     2.1  [SubHeader] for header version 0
  26     2.2  [SubHeader] for header version 1
  27     2.3  Version information
  28     2.4  WarCraft III The Frozen Throne beta replay information
  29 3.0 [Data block header]
  30 4.0 [Decompressed data]
  31     4.1  [PlayerRecord]
  32     4.2  [GameName]
  33     4.3  [EncodedString]
  34     4.4  [GameSettings]
  35     4.5  [Map&CreatorName]
  36     4.6  [PlayerCount]
  37     4.7  [GameType]
  38     4.8  [LanguageID]
  39     4.9  [PlayerList]
  40     4.10 [GameStartRecord]
  41     4.11 [SlotRecord]
  42     4.12 [RandomSeed]
  43 5.0 [ReplayData]
  44 6.0 General notes
  45     6.1  Notes on official Blizzard Replays
  46 7.0 Credits
  47 8.0 Document revision history
  48
  49
  50===============================================================================
  51DISCLAIMER (please read it ...)
  52===============================================================================
  53
  54All information in this document was solely obtained by looking at the replay
  55file and guessing the meaning of each single field. All knowledge about the
  56games mechanics is based on experience obtained by playing the game.
  57Neither reverse engineering was used nor any copyrighted files modified.
  58It is explicitly prohibited to use the information provided in this document
  59for any illegal activities including hacking, cheating and pirating.
  60Thank you Blizzard for your great games and a quite straight-forward
  61WarCraft III replay file format ;-)
  62
  63The use of the information provided in this document is free of charge as long
  64as you follow the rules above. Furthermore you may copy it freely as long as
  65the file is unchanged (please mail us about any error or addition - we like
  66to keep things centralized).
  67We would really appreciate it if you credit us in your project or drop us
  68a line via mail - because we like to know if the work put into this document
  69was anything worth after all ;-)
  70
  71
  72===============================================================================
  731.0 Introduction
  74===============================================================================
  75
  76An important word ahead.
  77The information in this document is addressed to developers who want to create
  78programs, tools and websites that help to enrich the gaming experience for the
  79*whole* WarCraft III community.
  80We absolutely do not tolerate hacks and cheats. Therefore you MUST NOT use
  81the information provided in this document for any of these purposes.
  82
  83This file is meant to contain a description of the replay format itself.
  84Additional notes and explanations on single fields and/or algorithms will
  85(eventually) be moved to a seperate file ("w3g_notes.txt") some day.
  86
  87The whole file is still under construction. The meaning of some fields is still
  88unknown and "known" fields might be wrong. Please contact us if you figure out
  89any unknown values or find a replay that simply does not conform with the
  90description of a "known" field.
  91
  92Convention:
  93-----------
  94Sections directly related to data stored in the replay file are written in
  95square brackets [].
  96
  97
  98===============================================================================
  992.0 [Header]
 100===============================================================================
 101
 102The replay file consist of a header followed by a variable number of compressed
 103data blocks. The header has the following format:
 104
 105offset | size/type | Description
 106-------+-----------+-----------------------------------------------------------
 1070x0000 | 28 chars  | zero terminated string "Warcraft III recorded game\0x1A\0"
 1080x001c |  1 dword  | fileoffset of first compressed data block (header size)
 109       |           |  0x40 for WarCraft III with patch <= v1.06
 110       |           |  0x44 for WarCraft III patch >= 1.07 and TFT replays
 1110x0020 |  1 dword  | overall size of compressed file
 1120x0024 |  1 dword  | replay header version:
 113       |           |  0x00 for WarCraft III with patch <= 1.06
 114       |           |  0x01 for WarCraft III patch >= 1.07 and TFT replays
 1150x0028 |  1 dword  | overall size of decompressed data (excluding header)
 1160x002c |  1 dword  | number of compressed data blocks in file
 1170x0030 |  n bytes  | SubHeader (see section 2.1 and 2.2)
 118
 119The size of the header excluding the subheader is 0x30 bytes so far.
 120
 121
 122- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1232.1 [SubHeader] for header version 0
 124- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 125
 126This header was used for all replays saved with WarCraft III patch version
 127v1.06 and below.
 128
 129offset | size/type | Description
 130-------+-----------+-----------------------------------------------------------
 1310x0000 |  1  word  | unknown (always zero so far)
 1320x0002 |  1  word  | version number (corresponds to patch 1.xx)
 1330x0004 |  1  word  | build number (see section 2.3)
 1340x0006 |  1  word  | flags
 135       |           |   0x0000 for single player games
 136       |           |   0x8000 for multiplayer games (LAN or Battle.net)
 1370x0008 |  1 dword  | replay length in msec
 1380x000C |  1 dword  | CRC32 checksum for the header
 139       |           | (the checksum is calculated for the complete header
 140       |           |  including this field which is set to zero)
 141
 142Overall header size for version 0 is 0x40 bytes.
 143
 144
 145- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1462.2 [SubHeader] for header version 1
 147- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 148
 149This header is used for all replays saved with WarCraft III patch version
 150v1.07 and above.
 151
 152offset | size/type | Description
 153-------+-----------+-----------------------------------------------------------
 1540x0000 |  1 dword  | version identifier string reading:
 155       |           |  'WAR3' for WarCraft III Classic
 156       |           |  'W3XP' for WarCraft III Expansion Set 'The Frozen Throne'
 157       |           | (note that this string is saved in little endian format
 158       |           |  in the replay file)
 1590x0004 |  1 dword  | version number (corresponds to patch 1.xx so far)
 1600x0008 |  1  word  | build number (see section 2.3)
 1610x000A |  1  word  | flags
 162       |           |   0x0000 for single player games
 163       |           |   0x8000 for multiplayer games (LAN or Battle.net)
 1640x000C |  1 dword  | replay length in msec
 1650x0010 |  1 dword  | CRC32 checksum for the header
 166       |           | (the checksum is calculated for the complete header
 167       |           |  including this field which is set to zero)
 168
 169Overall header size for version 1 is 0x44 bytes.
 170
 171
 172- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1732.3 Version information
 174- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 175
 176 game version | version in replay | version of war3.exe |  release date
 177--------------+-------------------+---------------------+----------------
 178    1.00      |     1.00.4448     |      1.0. 0.4448    |   2002-07-03
 179    1.01      |     1.01.4482     |      1.0. 1.4482    |   2002-07-05
 180    1.01b     |     1.01.4482     |      1.0. 1.4483    |   2002-07-10
 181    1.01c     |     1.01.4482     |                ?    |   2002-07-28
 182    1.02      |     1.02.4531     |      1.0. 1.4531    |   2002-08-15
 183    1.02a     |     1.02.4531     |      1.0. 1.4563    |   2002-09-06
 184    1.03      |     1.03.4572     |      1.0. 3.4653    |   2002-10-09
 185    1.04      |     1.04.4654     |      1.0. 3.4709    |   2002-11-04
 186    1.04b     |     1.04.4654     |      1.0. 3.4709    |   2002-11-07
 187    1.04c     |     1.04.4654     |      1.0. 4.4905    |   2003-01-30
 188    1.05      |     1.05.4654     |      1.0. 5.4944    |   2003-01-30
 189    1.06      |     1.06.4656     |      1.0. 6.5551    |   2003-06-03
 190    1.07      |     1.07.6031     |      1.0. 7.5535    |   2003-07-01
 191    1.10      |     1.10.6034     |      1.0.10.5610    |   2003-06-30
 192    1.11      |     1.11.6035     |      1.0.11.5616    |   2003-07-15
 193    1.12      |     1.12.6036     |      1.0.12.5636    |   2003-07-31
 194    1.13      |     1.13.6037     |      1.0.13.5816    |   2003-12-16
 195    1.13b     |     1.13.6037     |      1.0.13.5818    |   2003-12-19
 196    1.14      |     1.14.6039     |      1.0.14.5840    |   2004-01-07
 197    1.14b     |     1.14.6040     |      1.0.14.5846    |   2004-01-10
 198    1.15      |     1.15.6043     |      1.0.15.5917    |   2004-04-14
 199    1.16      |     1.16.6046     |      1.0.16.5926    |   2004-05-10
 200    1.17      |     1.17.6050     |      1.0.17.5988    |   2004-09-20
 201    1.18      |     1.18.6051     |      1.0.18.6030    |   2005-03-01
 202
 203
 204 Notes on specific patches:
 205  o The mpq file for patch 1.02a is named 1.02c.
 206  o Patch 1.04b was only available as standalone patch (not on bnet)
 207    and solely adds a new copy protection to war3.exe.
 208  o The minor version number of the 'war3.exe' is wrong for patches
 209    1.02, 1.02a, 1.04, 1.04b.
 210  o Blizzard released no standalone versions of the patches:
 211    1.01c, 1.04c, 1.10.
 212  o Replays of patch 1.14 and 1.14b are incompatible
 213
 214 General notes:
 215  o There are no differences in replays between minor versions
 216    (except for patch 1.14 and 1.14b).
 217  o Check the file properties of the existing war3.exe to get the current
 218    installed version of Warcraft III (see column 3).
 219  o There are no differences in version and build numbers between RoC and TFT.
 220  o There are no differences between various language versions.
 221  o You can identify the replay version of the installed game by extracting
 222    the 'product version number' from the version resource of the 'war3.exe'.
 223  o You can identify the version of the 'war3.exe' by extracting the
 224    'file version number' from the version resource of the file.
 225  o On early patches build number of replays and 'war3.exe' are equal.
 226    Later on they differ.
 227
 228
 229- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 2302.4 WarCraft III The Frozen Throne beta replay information
 231- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 232
 2332.4.1 Beta for Frozen Throne retail (version 1.07)
 234--------------------------------------------------
 235
 236Beta replays are similar to RoC / final TFT replays.
 237Here comes a list of version numbers, header version and build numbers:
 238
 239version | subheader version | build# | release date
 240--------+-------------------+--------+--------------
 241 301    | version 0         |  6010  |  2003-03-04
 242 302    | version 0         |  6011  |  2003-03-11
 243 303    | version 0         |  6012  |  2003-03-14
 244 304    | version 0         |  6013  |  2003-03-19
 245 304a   | version 0         |  6013  |  2003-03-24
 246 305    | version 1(*)      |  6015  |  2003-03-28
 247 305a   | version 1(*)      |  6016  |  2003-03-30
 248 306    | version 1         |  6018  |  2003-04-08
 249 307    | version 1         |  6019  |  2003-04-11
 250 308    | version 1         |  6021  |  2003-04-16
 251 309    | version 1         |  6022  |  2003-04-17
 252 310    | version 1         |  6023  |  2003-04-24
 253 311    | version 1         |  6027  |  2003-04-30
 254 312    | version 1         |  6030  |  2003-05-13
 255 313    | version 1         |  6031  |  2003-05-19
 256 314    | version 1         |  6034  |  2003-05-30
 257 314a   | version 1         |  6034  |  2003-06-02
 258 315    | version 1         |  6034  |  2003-06-10
 259
 260 (*) Patch 305 and 305a still use the old V0 GameVersion scheme (2 words).
 261
 262  Notes:
 263  o 313 replays might be convertable to FT retail 1.07 replays.
 264  o 315 replays might be convertable to FT retail 1.10/1.11 replays.
 265
 2662.4.1 Beta versions of various patches
 267--------------------------------------
 268
 269These patches were only distributed through the 'Westfall' gateway.
 270
 271 game    | version      | version         | date         |
 272 version | in replay    | of war3.exe     | of release   | beta for
 273---------+--------------+-----------------+--------------+----------------
 274  1.15   |  1. 15.6041  |    1.0.15.5900  |  2004-04-16  |  patch 1.15
 275  1.401  |  1.401.6042  |  401.0. 0.5911  |  2004-04-22  |  patch 1.15
 276  1.402  |              |                 |  2004-04-24  |  patch 1.15
 277  1.403  |              |                 |  2004-06-23  |  Ladder XP
 278  1.404  |              |                 |  2004-08-14  |  patch 1.17
 279  1.405  |              |                 |  2004-08-19  |  patch 1.17
 280  1.406  |              |                 |  2004-08-31  |  patch 1.17
 281
 282
 283===============================================================================
 2843.0 [Data block header]
 285===============================================================================
 286
 287Each compressed data block consists of a header followed by compressed data.
 288The first data block starts at the address denoted in the replay file header.
 289All following addresses are relative to the start of the data block header.
 290The decompressed data blocks append to a single continueous data stream
 291(disregarding the block headers). The content of this stream (see section 4) is
 292completely independent of the original block boundaries.
 293
 294offset | size/type | Description
 295-------+-----------+-----------------------------------------------------------
 2960x0000 |  1  word  | size n of compressed data block (excluding header)
 2970x0002 |  1  word  | size of decompressed data block (currently 8k)
 2980x0004 |  1 dword  | unknown (probably checksum)
 2990x0008 |  n bytes  | compressed data (decompress using zlib)
 300
 301To decompress one block with zlib:
 302 1. call 'inflate_init'
 303 2. call 'inflate' with Z_SYNC_FLUSH for the block
 304
 305The last block is padded with 0 bytes up to the 8K border. These bytes can
 306be disregarded.
 307
 308//TODO: add decompression details and move explanation to seperate file
 309
 310
 311===============================================================================
 3124.0 [Decompressed data]
 313===============================================================================
 314
 315Decompressed data is a collection of data items that appear back to back in
 316the stream. The offsets for these items vary depending on the size of every
 317single item.
 318
 319This section describes the records that always appear at the beginning of
 320a replay data stream. They hold information about settings and players right
 321before the start of the game. Data about the game in progress is described
 322in section 5.
 323
 324The order of the start up items is as follows:
 325
 326 # |   Size   | Name
 327---+----------+--------------------------
 328 1 |   4 byte | Unknown (0x00000110 - another record id?)
 329 2 | variable | PlayerRecord (see 4.1)
 330 3 | variable | GameName (null terminated string) (see 4.2)
 331 4 |   1 byte | Nullbyte
 332 5 | variable | Encoded String (null terminated) (see 4.3)
 333   |          |  - GameSettings (see 4.4)
 334   |          |  - Map&CreatorName (see 4.5)
 335 6 |   4 byte | PlayerCount (see 4.6)
 336 7 |   4 byte | GameType (see 4.7)
 337 8 |   4 byte | LanguageID (see 4.8)
 338 9 | variable | PlayerList (see 4.9)
 33910 | variable | GameStartRecord (see 4.11)
 340
 341The following sections describe these items in detail.
 342After the static items (as described above) there follow variable information
 343organized in blocks that are described in section 5.
 344
 345
 346- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 3474.1 [PlayerRecord]
 348- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 349
 350offset | size/type | Description
 351-------+-----------+-----------------------------------------------------------
 3520x0000 |  1 byte   | RecordID:
 353       |           |  0x00 for game host
 354       |           |  0x16 for additional players (see 4.9)
 3550x0001 |  1 byte   | PlayerID
 3560x0002 |  n bytes  | PlayerName (null terminated string)
 357   n+2 |  1 byte   | size of additional data:
 358       |           |  0x01 = custom
 359       |           |  0x08 = ladder
 360
 361Depending on the game type one of these records follows:
 362
 363o For custom games:
 364
 365  offset | size/type | Description
 366  -------+-----------+---------------------------------------------------------
 367  0x0000 | 1 byte    | null byte (1 byte)
 368
 369o For ladder games:
 370
 371  offset | size/type | Description
 372  -------+-----------+---------------------------------------------------------
 373  0x0000 | 4 bytes   | runtime of players Warcraft.exe in milliseconds
 374  0x0004 | 4 bytes   | player race flags:
 375         |           |   0x01=human
 376         |           |   0x02=orc
 377         |           |   0x04=nightelf
 378         |           |   0x08=undead
 379         |           |  (0x10=daemon)
 380         |           |   0x20=random
 381         |           |   0x40=race selectable/fixed (see notes in section 4.11)
 382
 383
 384- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 3854.2 [GameName]
 386- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 387
 388This is a plain null terminated string reading the name of the game.
 389
 390Only in custom battle.net games you can name your game, otherwise the name
 391is fixed:
 392
 393o For ladder games it reads "BNet".
 394
 395o For custom LAN games it holds a localized string including the game creators
 396  player name.
 397  Examples: a game created by the player 'Blue' results in:
 398           "Blue's game" for the english version of Warcraft III
 399           "Spiel von Blue" for the german version
 400
 401o For custom single player games it holds a localized fixed string.
 402           "local game" for the english version
 403           "Lokales Spiel" for the german version
 404
 405o Following is a list for all localized strings (encoded in plain ASCII) used
 406  by WarCraft III patch version 1.06 and earlier
 407  (see war3.mpq\UI\FrameDef\GlobalStrings.fdf: GAMENAME, LOCAL_GAME):
 408
 409  English        : "%s's Game"         : "local game"
 410  Czech    (1029): "Hra %s"            : "Místní hra"
 411  German   (1031): "Spiel von %s"      : "Lokales Spiel"
 412  Spanish  (1034): "Partida de %s"     : "Partida local"
 413  French   (1036): "Partie de %s"      : "Partie locale"
 414  Italian  (1040): "Partita di %s"     : "Partita locale"
 415  Polish   (1045): "Gra (%s)"          : "Gra lokalna"
 416
 417  %s denotes the game creators player name.
 418
 419o The following list shows all localized strings (encoded in plain ASCII) used
 420  by WarCraft III patch version 1.07 and later
 421  (see war3.mpq\UI\FrameDef\GlobalStrings.fdf: GAMENAME, LOCAL_GAME):
 422
 423  German   (1031): "Lokales Spiel (%s)"  : "Lokales Spiel"
 424
 425  %s denotes the game creators player name.
 426
 427
 428- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 4294.3 [Encoded String]
 430- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 431
 432There are the GameSetting and three null-terminated strings here back-to-back,
 433all encoded into a single null terminated string.
 434(But we don't know the reason for this encoding!)
 435
 436Every even byte-value was incremented by 1. So all encoded bytes are odd.
 437A control-byte stores the transformations for the next 7 bytes.
 438
 439Since all NullBytes were transformed to 1, they will never occure inside the
 440encoded string. But a NullByte marks the end of the encoded string.
 441
 442The encoded string starts with a control byte.
 443The control byte holds a bitfield with one bit for each byte of the next 7
 444bytes block. Bit 1 (not Bit 0) corresponds to the following byte right after
 445the control-byte, bit 2 to the next, and so on.
 446Only Bit 1-7 contribute to encoded string. Bit 0 is unused and always set.
 447
 448Decoding these bytes works as follows:
 449
 450If the corresponding bit is a '1' then the character is moved over directly.
 451If the corresponding bit is a '0' then subtract 1 from the character.
 452
 453After a control-byte and the belonging 7 bytes follows a new control-byte
 454until you find a NULL character in the stream.
 455
 456
 457Example decompression code (in 'C'):
 458
 459char* EncodedString;
 460char* DecodedString;
 461char  mask;
 462int   pos=0;
 463int   dpos=0;
 464
 465while (EncodedString[pos] != 0)
 466{
 467  if (pos%8 == 0) mask=EncodedString[pos];
 468  else
 469  {
 470    if ((mask & (0x1 << (pos%8))) == 0)
 471      DecodedString[dpos++] = EncodedString[pos] - 1;
 472    else
 473      DecodedString[dpos++] = EncodedString[pos];
 474  }
 475  pos++;
 476}
 477
 478
 479Alternatively one could interprete the encoding scheme as follow:
 480Bit 0 of every character was moved to the control byte and set to 1 afterwards.
 481
 482TODO: Maybe this gives a simpler decoding algorithm.
 483
 484
 485- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 4864.4 [GameSettings]
 487- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 488
 489Make sure you have decoded the GameSettings (see 4.3).
 490
 491The game settings (extended options on create game screen) are packed using
 492various flags distributed over 13 bytes.
 493For details about the single options read the file
 494 "support/Readme/(PC)UIMainMenus.html"
 495in your WarCraft III installation directory.
 496
 497Denoted below are only nonzero flags.
 498
 499offset | bitnr | Description
 500-------+-------+---------------------------------------------------------------
 5010x0000 |  0,1  | Game Speed: 0 = slow, 1 = normal, 2 = fast, 3 = unused
 502-------+-------+---------------------------------------------------------------
 5030x0001 |   0   | Visibility: 'hide terrain'
 504       |   1   | Visibility: 'map explored'
 505       |   2   | Visibility: 'always visible' (no fog of war)
 506       |   3   | Visibility: 'default'
 507       |  4,5  | Observer  : 0 = off or 'Referees' (see 0x0003 Bit6)
 508       |       |             1 = unused
 509       |       |             2 = 'Obs on Defeat'
 510       |       |             3 = on or 'Referees'
 511       |   6   | Teams Together (team members are placed at neighbored places)
 512-------+-------+---------------------------------------------------------------
 5130x0002 |  1,2  | Fixed teams: 0 = off, 1 = unused, 2 = unused, 3 = on
 514-------+-------+---------------------------------------------------------------
 5150x0003 |   0   | Full Shared Unit Control
 516       |   1   | Random Hero
 517       |   2   | Random Races
 518       |   6   | Observer: Referees (other observer bits are 0 or 3)
 519-------+-------+---------------------------------------------------------------
 5200x0004 |       | 0
 5210x0005 |       | unknown (0 in ladder games, but not in custom)
 5220x0006 |       | 0
 5230x0007 |       | unknown (0 in ladder games, but not in custom)
 5240x0008 |       | 0
 525-------+-------+---------------------------------------------------------------
 5260x0009 | 4Byte | Map Checksum  //TODO: find algorithm
 527 -  0C |       |
 528-------+-------+---------------------------------------------------------------
 529
 530
 531
 532- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 5334.5 [Map&CreatorName]
 534- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 535
 536Make sure you have decoded the three Strings (see 4.3).
 537
 538First is the map name, second is the game creators name (can be "Battle.Net"
 539for ladder) and a third is an always empty string.
 540
 541Here ends the encoded string. There should not be any unprocessed decoded
 542bytes left.
 543
 544- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 5454.6 [PlayerCount]
 546- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 547
 5484 bytes - num players or num slots
 549  in Bnet games is the exact ## of players
 550  in Custom games, is the ## of slots on the join game screen
 551  in Single Player custom games is 12
 552
 553
 554- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 5554.7 [GameType]
 556- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 557
 558offset | size/type | Description
 559-------+-----------+-----------------------------------------------------------
 5600x0000 |  1 byte   | Game Type:
 561       |           | (0x00 = unknown, just in a few  pre 1.03 custom games)
 562       |           |  0x01 =   Ladder -> 1on1 or FFA
 563                               Custom -> Scenario  (not 100% sure about this)
 564       |           |  0x09 = Custom game
 565       |           |  0x1D = Single player game
 566       |           |  0x20 = Ladder Team game (AT or RT, 2on2/3on3/4on4)
 5670x0001 |  1 byte   | PrivateFlag for custom games:
 568       |           |  0x00 - if it is a public LAN/Battle.net game
 569       |           |  0x08 - if it is a private Battle.net game
 5700x0002 |  1 word   | unknown (always 0x0000 so far)
 571
 572TODO:
 573  values in patch >=1.07:
 574    01 00 00 00 : ladder 1on1 / custom scenario
 575    20 00 00 00 : ladder team
 576    09 00 00 00 : custom game
 577    09 A8 12 00 : custom game
 578    09 A0 12 00 : custom game
 579    09 A8 42 00 : custom game
 580    09 A8 14 00 : custom game
 581    09 A0 14 00 : custom game
 582    01 40 13 00 : custom game
 583    09 A0 42 00 : custom game
 584    09 A8 44 00 : custon game
 585
 586
 587- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 5884.8 [LanguageID]
 589- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 5904 byte - (independent of realm, map, gametype !)
 591Might be another checksum or encoded language.
 592I found the following numbers in my replays:
 593
 594C4 F0 12 00 - patch 1.10 ger
 59590 F1 12 00 - patch 1.06 ger
 59690 F1 12 00 - patch 1.05 ger
 597A0 F6 6D 00 - patch 1.04 ger
 59824 F8 12 00 - patch 1.04 eng(?)
 599A0 F6 6D 00 - patch 1.03 ger
 600C0 F6 6D 00 - patch 1.02 ger
 601
 602//TODO: Find out what this field is really about.
 603
 604
 605- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 6064.9 [PlayerList]
 607- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 608
 609The player list is an array of PlayerRecords for all additional players
 610(excluding the game host and any computer players).
 611If there is only one human player in the game it is not present at all!
 612Per additional player there is the following structure in the file:
 613
 614offset | size/type | Description
 615-------+-----------+-----------------------------------------------------------
 6160x0000 | 4/11 byte | PlayerRecord (see 4.1)
 6170x000? |    4 byte | unknown
 618       |           |  (always 0x00000000 for patch version >= 1.07
 619       |           |   always 0x00000001 for patch version <= 1.06)
 620
 621This record is repeated as long as the first byte equals the additional
 622player record ID (0x16).
 623
 624
 625- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 6264.10 [GameStartRecord]
 627- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 628
 629offset | size/type | Description
 630-------+-----------+-----------------------------------------------------------
 6310x0000 |  1 byte   | RecordID - always 0x19
 6320x0001 |  1 word   | number of data bytes following
 6330x0003 |  1 byte   | nr of SlotRecords following (== nr of slots on startscreen)
 6340x0004 |  n bytes  | nr * SlotRecord (see 4.11)
 635   n+4 |  1 dword  | RandomSeed (see 4.12)
 636   n+8 |  1 byte   | SelectMode
 637       |           |   0x00 - team & race selectable (for standard custom games)
 638       |           |   0x01 - team not selectable
 639       |           |          (map setting: fixed alliances in WorldEditor)
 640       |           |   0x03 - team & race not selectable
 641       |           |          (map setting: fixed player properties in WorldEditor)
 642       |           |   0x04 - race fixed to random
 643       |           |          (extended map options: random races selected)
 644       |           |   0xcc - Automated Match Making (ladder)
 645   n+9 |  1 byte   | StartSpotCount (nr. of start positions in map)
 646
 647
 648- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 6494.11 [SlotRecord]
 650- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 651
 652offset | size/type | Description
 653-------+-----------+-----------------------------------------------------------
 6540x0000 |  1 byte   | player id (0x00 for computer players)
 6550x0001 |  1 byte   | map download percent: 0x64 in custom, 0xff in ladder
 6560x0002 |  1 byte   | slotstatus:
 657       |           |   0x00 empty slot
 658       |           |   0x01 closed slot
 659       |           |   0x02 used slot
 6600x0003 |  1 byte   | computer player flag:
 661       |           |   0x00 for human player
 662       |           |   0x01 for computer player
 6630x0004 |  1 byte   | team number:0 - 11
 664       |           | (team 12 == observer or referee)
 6650x0005 |  1 byte   | color (0-11):
 666       |           |   value+1 matches player colors in world editor:
 667       |           |   (red, blue, cyan, purple, yellow, orange, green,
 668       |           |    pink, gray, light blue, dark green, brown)
 669       |           |   color 12 == observer or referee
 6700x0006 |  1 byte   | player race flags (as selected on map screen):
 671       |           |   0x01=human
 672       |           |   0x02=orc
 673       |           |   0x04=nightelf
 674       |           |   0x08=undead
 675       |           |   0x20=random
 676       |           |   0x40=race selectable/fixed (see notes below)
 6770x0007 |  1 byte   | computer AI strength: (only present in v1.03 or higher)
 678       |           |   0x00 for easy
 679       |           |   0x01 for normal
 680       |           |   0x02 for insane
 681       |           | for non-AI players this seems to be always 0x01
 6820x0008 |  1 byte   | player handicap in percent (as displayed on startscreen)
 683       |           | valid values: 0x32, 0x3C, 0x46, 0x50, 0x5A, 0x64
 684       |           | (field only present in v1.07 or higher)
 685
 686 Notes:
 687  o This record is only 7 bytes in pre 1.03 replays.
 688    The last two fields are missing there.
 689
 690  o For pre v1.07 replays this record is only 8 bytes.
 691    The last field is missing there.
 692
 693  o For open and closed slots team and color fields are undetermined.
 694
 695  o For WarCraft III patch version <= 1.06:
 696    If bit 6 of player race flags is additionally set (0x40 added) then the
 697    race is fixed by the map (see also section 4.10).
 698
 699  o For WarCraft III patch version >= 1.07:
 700    If bit 6 of player race flags is additionally set (0x40 added) then the
 701    race is selectable by the player - otherwise it is a ladder game or the
 702    race is fixed by the map (see also section 4.10).
 703
 704
 705- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 7064.12 [RandomSeed]
 707- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 708This field is the best bet on the random seed the Warcraft III engine is
 709initialized with. The replay data that follows requires already a set up seed
 710(since starting positions and race are fixed at this time).
 711
 712For custom games (no matter if battle.net or LAN) this dword appears to be
 713the runtime of the Warcraft.exe of the game host in milliseconds.
 714
 715For ladder games the value variies very much - probably the battle.net server
 716hands out a 'real' seed (not runtime based) to the clients.
 717
 718
 719===============================================================================
 7205.0 [ReplayData]
 721===============================================================================
 722
 723This section describes the Replay data following directly after the static data
 724described in section 4. It represents information about the game in progress.
 725
 726Replay data is segmented into seperate blocks of either fixed or variable size.
 727The order of these blocks is not fixed and not all known blocktypes have to be
 728present in a replay.
 729
 730Blocks always start with one byte representing the block ID. Using this ID one
 731can identify specific blocks while skipping unwanted (using the block size).
 732Below all known blocks are listed by their block ID followed by a description
 733of the data following the ID. Denoted in square brackets is the overall size
 734of each block (including the one byte block ID).
 735
 736- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 7370x17  - LeaveGame                                                   [ 14 byte ]
 738- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 739  1 dword - reason
 740             0x01 - connection closed by remote game
 741             0x0C - connection closed by local game
 742             0x0E - unknown (rare) (almost like 0x01)
 743  1 byte  - PlayerID
 744  1 dword - result - see table below
 745  1 dword - unknown (number of replays saved this warcraft session?)
 746
 747
 748 Key for Table:
 749  player = player according to PlayerID
 750  saver  = replay saver ( = player of very last leave-action)
 751  INC    = the unknown parameter in the last leave-action was incremented by 1
 752           (compared to the other LeaveGame actions before)
 753  [?]    = entries marked with this symbol are true for common replays but
 754           we encountered at least one nonconform replay.
 755  [O]    = if the replay saver was an observer it regularly happens that
 756           players get a result of 0x01
 757
 758   Reason   | Result | Description
 759 ===========+========+=======================================================
 760    0x01    |  0x01  | player left (disconnected or saver is observer)    [O]
 761  (remote)  |  0x07  | player left
 762            |  0x08  | player lost (was completly erased)
 763            |  0x09  | player won
 764            |  0x0A  | draw (long lasting tournament game)
 765            |  0x0B  | player left (was observer)                         [?]
 766 -----------+--------+-------------------------------------------------------
 767    0x0E    |  0x01  | player left                                        [?]
 768  (remote)  |  0x07  | player left                                        [?]
 769            |  0x0B  | player left (was observer)                         [?]
 770 ===========+========+=======================================================
 771    0x0C    |  0x01  | saver disc. / observer left                        [O]
 772  (not last)|  0x07  | saver lost, no info about the player               [?]
 773            |  0x08  | saver lost (erased), no info about the player
 774            |  0x09  | saver won, no info about the player
 775            |  0x0A  | draw (long lasting tournament game)
 776            |  0x0B  | saver lost (obs or obs on defeat)                  [?]
 777 -----------+--------+-------------------------------------------------------
 778  last 0x0C |  0x01  | saver disconnected
 779 (rep.saver)|  0x07  | with INC => saver won
 780            |        | w/o  INC => saver lost
 781            |  0x08  | saver lost (completly erased)
 782            |  0x09  | saver won
 783            |  0x0B  | with INC => saver won most times, but not always   [?]
 784            |        | w/o  INC => saver left (was obs or obs on defeat)  [?]
 785
 786 Personal note:
 787  o Until now we have not found a robust winner detection algorithm that
 788    works for every replay :(
 789    We checked about 6000 replays. Normal ladder games works well,
 790    but especially FFA games saved by an observer are very &§*#$.
 791    So here is still work to do...
 792
 793 Notes:
 794  o Do NOT use the marked lines ([?],[N]) for winner detection.
 795    If you use these you will probably increase the detection rate but also
 796    get false detections.
 797    The unmarked lines proofed to be fail-safe (at least until now).
 798
 799  o If at least one player gets a draw result the whole game is draw.
 800
 801  o The result*s* of the replay saver - he can get more than one because all
 802    local leave actions (reason=0x0C) belong to this result - do not
 803    contradict (except in draw games). There is never a win and a loss result
 804    at the same time (if you use the none marked lines).
 805
 806  o All result-values in a leave-action are player specific results.
 807    E.g. if one player of a team quits he gets a 'lost' result value - even
 808    if his team mate later wins the game.
 809
 810  o If you get a win result for a player his team is definitely the winner and
 811    all other teams lost.
 812
 813  o If the result for every player of a team is "loss" the whole team lost.
 814
 815  o Even WarCraft cannot see into the future ;). If the saver of a team replay
 816    leaves the game first, you will always detect a 'saver-lost' result.
 817    It is impossible to detect who is the winner in this replay.
 818    Unfortunately this happens quite often. Imagine a 2vs2 game: One team was
 819    nearly beaten, both players say 'gg' and leave. If the replay saver (one of
 820    these losers) quits only 1 second before his team mate, you cannot detect
 821    the winner in this replay.
 822    Our strategy in this situation is to assume that the whole replay saver
 823    team lost. This might not be correct in every situation (but from the
 824    replay we will never know).
 825    An alternative strategy could be: The team with the most remaining players
 826    wins. This can be wrong too e.g. if in a 2on2 one team nearly won when one
 827    of the players of this team disconnects but the second player finishes the
 828    work.
 829    In 2on2 games both strategies lead to same result.
 830
 831
 832- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 8330x1A      - unknown (first startblock)                               [ 5 byte ]
 834- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 835  1 dword - unknown (always 0x01 so far)
 836
 837 Notes:
 838  o This block seems to be always the first block at start of game.
 839    It is never repeated.
 840
 841
 842- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 8430x1B      - unknown (second startblock)                              [ 5 byte ]
 844- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 845  1 dword - unknown (always 0x01 so far)
 846
 847 Notes:
 848  o This block seems to be always the second block at start of game.
 849    It is never repeated.
 850
 851
 852- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 8530x1C      - unknown (third startblock)                               [ 5 byte ]
 854- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 855  1 dword - unknown (always 0x01 so far)
 856
 857 Notes:
 858  o This block seems to be always the third block at start of game.
 859    It is never repeated.
 860  o Rarely there is a chat block (0x20) or a LeaveGame block (0x17) between
 861    2nd startblock (0x1B) and this 3rd startblock (0x1C)
 862
 863
 864- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 8650x1E       - TimeSlot block                                       [ n+3 byte ]
 866- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 867 for details see block 0x1F
 868
 869 Notes:
 870  o For patch version <= 1.02 this block was used instead of block 0x1F.
 871  o This block also rarely appears in version >= 1.07. In this case the usual
 872    RandomSeed block (0x22) does *not* follow though.
 873
 874
 875- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 8760x1F       - TimeSlot block                                       [ n+3 byte ]
 877- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 878  1 word   - n = number of bytes that follow
 879  1 word   - time increment (milliseconds)
 880              about 250 ms in battle.net
 881              about 100 ms in LAN and single player
 882  n-2 byte - CommandData block(s) (not present if n=2)
 883
 884 For every player which has executed an action during this time slot there is
 885 at least one 'Command data block'.
 886
 887 CommandData block:
 888   1 byte  - PlayerID
 889   1 word  - Action block length
 890   n byte  - Action block(s) (see file 'w3g_actions.txt' for details)
 891
 892 Notes:
 893  o The 'time increments' are only correct for replays played at fastest speed.
 894  o Accumulate all 'time increments' to get the time of current action(s).
 895  o This block is always followed by a 'Random Seed' block (0x22)
 896  o For patch version <= 1.02 this block has the ID 0x1E.
 897  o A detailed description of the action block format and all valid actions can
 898    be found in the seperate document 'w3g_actions.txt'.
 899
 900
 901- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 9020x20       - Player chat message (patch version >= 1.07)           [ n+4 byte ]
 903- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 904  1 byte   - PlayerID (message sender)
 905  1 word   - n = number of bytes that follow
 906  1 byte   - flags
 907              0x10   for delayed startup screen messages? (see note)
 908              0x20   for normal messages
 909  1 dword  - chat mode (not present if flag = 0x10):
 910              0x00   for messages to all players
 911              0x01   for messages to allies
 912              0x02   for messages to observers or referees
 913              0x03+N for messages to specific player N (with N = slotnumber)
 914
 915  n bytes  - zero terminated string containing the text message
 916
 917 Notes:
 918  o This block was introduced with patch 1.07.
 919  o Only messages send and received by the player who saved the replay are
 920    present.
 921  o Messages to observers are not saved.
 922  o The slot number corresponds to the record number as per section 4.11
 923    starting with zero (first record = slot 0).
 924  o To get the time of the chat command, accumulate all 'time increments' from
 925    the 'TimeSlot' blocks (see above, block 0x1E and 0x1F).
 926
 927 Notes on chat messages with flag = 0x10:
 928  o Only appears on startup between action block 0x1B and 0x1C.
 929  o The 'chat mode' dword is not present. The message text starts right after
 930    the flag field. The length value reflects this correctly.
 931  o These chat messages do not appear when the replay is watched with WarCraft.
 932  o The messages only appear in custom game replays. Maybe these are chat
 933    messages written in the game startup screen, which were send right before
 934    the game was started and could not be shown there in time because of lag.
 935
 936
 937- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 9380x22      - unknown (Checksum or random number/seed for next frame)  [ 6 byte ]
 939- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 940  1 byte  - number of bytes following (always 0x04 so far)
 941  1 dword - unknown (very random)
 942
 943 Notes:
 944  o For patch version <= 1.02 this block has the ID 0x20.
 945  o This message eventually syncs the random seed used for any calculation
 946    within the previous or next frame between all clients.
 947    It might be a complete gamescene checksum too though.
 948  o This block follows always after a 'TimeSlot' block.
 949
 950
 951- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 9520x23      - unknown                                                 [ 11 byte ]
 953- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 954 Maybe:
 955  1 dword - unknown
 956  1 byte  - unknown (always 4?)
 957  1 dword - unknown (random?)
 958  1 byte  - unknown (always 0?)
 959
 960 Notes:
 961  o Very rare.
 962  o Appears in front of a 'LeaveGame' action.
 963
 964 Examples:
 965  23 4C 0D 00 00 04 0B B0 B1 FC 00  ->  "#L........."    3404 4 4239503371 0
 966  23 64 07 00 00 04 AC 34 28 7E 00  ->  "#d.....4(~."    1892 4 2116564140 0
 967  23 FB 0D 00 00 04 DD B8 B1 87 00  ->  "#.........."    3579 4 2276571357 0
 968  23 D5 15 00 00 04 19 ED 43 72 00  ->  "#.......Cr."    5589 4 1917054233 0
 969  23 1B 03 00 00 04 D8 2E 81 4F 00  ->  "#........O."     795 4 1333866200 0
 970  23 F2 04 00 00 04 91 7F C6 01 00  ->  "#........."    1266 4   29786001 0
 971
 972
 973  all following back-to-back in a single replay:
 974  23 3A 03 00 00 04 B5 1F DC 80 00  ->  "#:........."     826 4 2161909685 0
 975  23 3B 03 00 00 04 DE A7 93 77 00  ->  "#;.......w."     827 4 2006165470 0
 976  23 3C 03 00 00 04 A9 A6 78 3B 00  ->  "#<......x;."     828 4  997762729 0
 977  23 3D 03 00 00 04 25 87 97 9C 00  ->  "#=....%...."     829 4 2627176229 0
 978
 979TODO: more analysis
 980
 981
 982- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 9830x2F      - Forced game end countdown (map is revealed)              [ 9 byte ]
 984- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 985  1 dword - mode:
 986             0x00 countdown is running
 987             0x01 countdown is over (end is forced *now*)
 988  1 dword - countdown time in sec
 989
 990 Notes:
 991  o This block was introduced with patch 1.07.
 992  o Only found in battle.net tournament games which last too long.
 993  o Normally countdown starts with 4:58 and the block is repeated every 30s
 994    (4:58, 4:28, 3:58, ..., 0:58, 0:28, 0:00, now).
 995  o On first occurence of this block the "fog of war" is turned off
 996    (the complete map is revealed to all player).
 997
 998
 999===============================================================================
10006.0 General notes
1001===============================================================================
1002
1003o It seems that the following things are *not* to be found in the replay:
1004    + the Battle.net realm
1005    + the time/date of the game
1006    + the level/exp/record of the players in a ladder game
1007
1008o You may add your own data at the end of the replay file - Warcraft III
1009  ignores them (except for official blizzard replays, see section 6.1).
1010  This might be useful e.g. for an replay database tool when storing a
1011  description of the game right with the replay data.
1012
1013o The saver of the replay is the last player leaving the game. This
1014  'LeaveGame'-Action (see 5.0) is also the very last action of the replay.
1015  This means the player id of the replay saver is the 9th last byte of the
1016  uncompressed replay (so you don't have to parse the action-blocks to get the
1017  name of the replay saver). This method does not work for official Blizzard
1018  replays.
1019
1020o Warcraft starts showing a replay with the game hosts point of view.
1021
1022o The game type is not explicitly recorded in the replay:
1023   - there is no difference between AT (arranged team) and RT (random team)
1024     ladder games replay wise
1025   - one can detect team games by the team number in slot records
1026   - one can detect FFA games by all players having different team numbers
1027     and there are more than 2 in the game
1028
1029o One can start Warcraft with the parameter '-loadfile' to play back a replay
1030  immediately:  War3.exe -loadfile "replayfilename"
1031  Before patch 1.14 there was a side effect: the single-player user-name was
1032  automatically changed to 'WorldEdit'.
1033
1034o There was no patch 1.07, 1.08 and 1.09 for WarCraft III classic.
1035  Patch 1.10 was released after patch 1.06 reflecting the release of
1036  WarCraft III expansion set 'The Frozen Throne'.
1037
1038o WarCraft III Frozen Throne was shipped with patch version 1.07 but was
1039  immediately patched to version 1.10. There was no patch 1.08 or 1.09.
1040
1041
1042- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
10436.1 Notes on official Blizzard Replays
1044- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1045
1046These replays are automatically obtained by Blizzard during or after high level
1047ladder games and tournament final games. They are available for download
1048through the official Battle.net web page and show some differences to normal
1049replays saved by users.
1050
1051Differences:
1052 o The build number (see 2.2) is always zero.
1053
1054 o The filesize is 132 byte larger than denoted in header (see below).
1055
1056 o The map record (see 4.4) always reads '01 01  01 F9 01 01  FF FF FF FF'.
1057
1058 o The values of the unknown PlayerList entry (see 4.9) of all players in the
1059   replay is equal to the LanguageID (see 4.8).
1060
1061 o The number of SlotRecords (Byte 0x0003 of [GameStartRecord] in section 4.10)
1062   is always zero - there are no slot records (see 4.11) present.
1063
1064 o The StartSpotCount (see [GameStartRecord] in section 4.10) is always 0xCC.
1065
1066 o There is a signature block at the end of the replay:
1067    1 dword  : 4E 47 49 53 = 'NGIS' <=> 'SIGN'
1068    128 Byte : signature
1069
1070Notes:
1071 o Since the lack of all slot records, one has to generate these data:
1072   iterate slotNumber from 1 to number of PlayerRecords (see 4.1)
1073     player id    = slotNumber
1074     slotstatus   = 0x02                   (used)
1075     computerflag = 0x00                   (human player)
1076     team number  = (slotNumber -1) mod 2  (team membership alternates in
1077                                                             PlayerRecord)
1078     color        = unknown                (player gets random colors)
1079     race         = as in PlayerRecord
1080     computerAI   = 0x01                   (non computer player)
1081     handicap     = 0x64                   (100%)
1082
1083 o Tournament replays are given a unique name using the following scheme:
1084    'YYYYMMDDhhmmxxxxx-TAG-TYPEp.w3g'
1085   where:
1086     YYYY  - year of the beginning of the game in greenwitch mean time (GMT)
1087     MM    - month ...
1088     DD    - day ...
1089     hh    - hour ...
1090     mm    - minutes ...
1091     xxxxx - numeric ID
1092     TAG   - 'W3XP' for FrozenThrone, 'WAR3' for Classic
1093     TYPE  - standard or race/map limitations,...
1094               without limitations (day of week):
1095                 FRI - friday
1096                 SAT - saturday
1097                 SUN - sunday
1098               race limitation tournament:
1099                 HUM - Human
1100                 ORC - Orc
1101                 NLF - Nightelf
1102                 UND - Undead
1103                 RND - Random
1104               map limitation tournament:
1105                 CLD - Coldheart
1106                 FLD - Floodplains
1107                 GNW - Gnollwood
1108                 LST - Lost Temple
1109                 RCK - Turtle Rock
1110                 WET - Wetlands
1111     p     - number of players per team
1112
1113   File…

Large files files are truncated, but you can click here to view the full file