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