|
===============================================================================
Table of Content
===============================================================================
1.0 Introduction
2.0 [Header]
2.1 [SubHeader] for header version 0
2.2 [SubHeader] for header version 1
2.3 Version information
2.4 WarCraft III The Frozen Throne beta replay information
3.0 [Data block header]
4.0 [Decompressed data]
4.1 [PlayerRecord]
4.2 [GameName]
4.3 [EncodedString]
4.4 [GameSettings]
4.5 [Map&CreatorName]
4.6 [PlayerCount]
4.7 [GameType]
4.8 [LanguageID]
4.9 [PlayerList]
4.10 [GameStartRecord]
4.11 [SlotRecord]
4.12 [RandomSeed]
5.0 [ReplayData]
6.0 General notes
6.1 Notes on official Blizzard Replays
7.0 Credits
8.0 Document revision history
===============================================================================
DISCLAIMER (please read it ...)
===============================================================================
All information in this document was solely obtained by looking at the replay
file and guessing the meaning of each single field. All knowledge about the
games mechanics is based on experience obtained by playing the game.
Neither reverse engineering was used nor any copyrighted files modified.
It is explicitly prohibited to use the information provided in this document
for any illegal activities including hacking, cheating and pirating.
Thank you Blizzard for your great games and a quite straight-forward
WarCraft III replay file format ;-)
The use of the information provided in this document is free of charge as long
as you follow the rules above. Furthermore you may copy it freely as long as
the file is unchanged (please mail us about any error or addition - we like
to keep things centralized).
We would really appreciate it if you credit us in your project or drop us
a line via mail - because we like to know if the work put into this document
was anything worth after all ;-)
===============================================================================
1.0 Introduction
===============================================================================
An important word ahead.
The information in this document is addressed to developers who want to create
programs, tools and websites that help to enrich the gaming experience for the
*whole* WarCraft III community.
We absolutely do not tolerate hacks and cheats. Therefore you MUST NOT use
the information provided in this document for any of these purposes.
This file is meant to contain a description of the replay format itself.
Additional notes and explanations on single fields and/or algorithms will
(eventually) be moved to a seperate file ("w3g_notes.txt") some day.
The whole file is still under construction. The meaning of some fields is still
unknown and "known" fields might be wrong. Please contact us if you figure out
any unknown values or find a replay that simply does not conform with the
description of a "known" field.
Convention:
-----------
Sections directly related to data stored in the replay file are written in
square brackets [].
===============================================================================
2.0 [Header]
===============================================================================
The replay file consist of a header followed by a variable number of compressed
data blocks. The header has the following format:
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 28 chars | zero terminated string "Warcraft III recorded game\0x1A\0"
0x001c | 1 dword | fileoffset of first compressed data block (header size)
| | 0x40 for WarCraft III with patch <= v1.06
| | 0x44 for WarCraft III patch >= 1.07 and TFT replays
0x0020 | 1 dword | overall size of compressed file
0x0024 | 1 dword | replay header version:
| | 0x00 for WarCraft III with patch <= 1.06
| | 0x01 for WarCraft III patch >= 1.07 and TFT replays
0x0028 | 1 dword | overall size of decompressed data (excluding header)
0x002c | 1 dword | number of compressed data blocks in file
0x0030 | n bytes | SubHeader (see section 2.1 and 2.2)
The size of the header excluding the subheader is 0x30 bytes so far.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.1 [SubHeader] for header version 0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This header was used for all replays saved with WarCraft III patch version
v1.06 and below.
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 word | unknown (always zero so far)
0x0002 | 1 word | version number (corresponds to patch 1.xx)
0x0004 | 1 word | build number (see section 2.3)
0x0006 | 1 word | flags
| | 0x0000 for single player games
| | 0x8000 for multiplayer games (LAN or Battle.net)
0x0008 | 1 dword | replay length in msec
0x000C | 1 dword | CRC32 checksum for the header
| | (the checksum is calculated for the complete header
| | including this field which is set to zero)
Overall header size for version 0 is 0x40 bytes.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.2 [SubHeader] for header version 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This header is used for all replays saved with WarCraft III patch version
v1.07 and above.
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 dword | version identifier string reading:
| | 'WAR3' for WarCraft III Classic
| | 'W3XP' for WarCraft III Expansion Set 'The Frozen Throne'
| | (note that this string is saved in little endian format
| | in the replay file)
0x0004 | 1 dword | version number (corresponds to patch 1.xx so far)
0x0008 | 1 word | build number (see section 2.3)
0x000A | 1 word | flags
| | 0x0000 for single player games
| | 0x8000 for multiplayer games (LAN or Battle.net)
0x000C | 1 dword | replay length in msec
0x0010 | 1 dword | CRC32 checksum for the header
| | (the checksum is calculated for the complete header
| | including this field which is set to zero)
Overall header size for version 1 is 0x44 bytes.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.3 Version information
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
game version | version in replay | version of war3.exe | release date
--------------+-------------------+---------------------+----------------
1.00 | 1.00.4448 | 1.0. 0.4448 | 2002-07-03
1.01 | 1.01.4482 | 1.0. 1.4482 | 2002-07-05
1.01b | 1.01.4482 | 1.0. 1.4483 | 2002-07-10
1.01c | 1.01.4482 | ? | 2002-07-28
1.02 | 1.02.4531 | 1.0. 1.4531 | 2002-08-15
1.02a | 1.02.4531 | 1.0. 1.4563 | 2002-09-06
1.03 | 1.03.4572 | 1.0. 3.4653 | 2002-10-09
1.04 | 1.04.4654 | 1.0. 3.4709 | 2002-11-04
1.04b | 1.04.4654 | 1.0. 3.4709 | 2002-11-07
1.04c | 1.04.4654 | 1.0. 4.4905 | 2003-01-30
1.05 | 1.05.4654 | 1.0. 5.4944 | 2003-01-30
1.06 | 1.06.4656 | 1.0. 6.5551 | 2003-06-03
1.07 | 1.07.6031 | 1.0. 7.5535 | 2003-07-01
1.10 | 1.10.6034 | 1.0.10.5610 | 2003-06-30
1.11 | 1.11.6035 | 1.0.11.5616 | 2003-07-15
1.12 | 1.12.6036 | 1.0.12.5636 | 2003-07-31
1.13 | 1.13.6037 | 1.0.13.5816 | 2003-12-16
1.13b | 1.13.6037 | 1.0.13.5818 | 2003-12-19
1.14 | 1.14.6039 | 1.0.14.5840 | 2004-01-07
1.14b | 1.14.6040 | 1.0.14.5846 | 2004-01-10
1.15 | 1.15.6043 | 1.0.15.5917 | 2004-04-14
1.16 | 1.16.6046 | 1.0.16.5926 | 2004-05-10
1.17 | 1.17.6050 | 1.0.17.5988 | 2004-09-20
1.18 | 1.18.6051 | 1.0.18.6030 | 2005-03-01
Notes on specific patches:
o The mpq file for patch 1.02a is named 1.02c.
o Patch 1.04b was only available as standalone patch (not on bnet)
and solely adds a new copy protection to war3.exe.
o The minor version number of the 'war3.exe' is wrong for patches
1.02, 1.02a, 1.04, 1.04b.
o Blizzard released no standalone versions of the patches:
1.01c, 1.04c, 1.10.
o Replays of patch 1.14 and 1.14b are incompatible
General notes:
o There are no differences in replays between minor versions
(except for patch 1.14 and 1.14b).
o Check the file properties of the existing war3.exe to get the current
installed version of Warcraft III (see column 3).
o There are no differences in version and build numbers between RoC and TFT.
o There are no differences between various language versions.
o You can identify the replay version of the installed game by extracting
the 'product version number' from the version resource of the 'war3.exe'.
o You can identify the version of the 'war3.exe' by extracting the
'file version number' from the version resource of the file.
o On early patches build number of replays and 'war3.exe' are equal.
Later on they differ.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.4 WarCraft III The Frozen Throne beta replay information
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.4.1 Beta for Frozen Throne retail (version 1.07)
--------------------------------------------------
Beta replays are similar to RoC / final TFT replays.
Here comes a list of version numbers, header version and build numbers:
version | subheader version | build# | release date
--------+-------------------+--------+--------------
301 | version 0 | 6010 | 2003-03-04
302 | version 0 | 6011 | 2003-03-11
303 | version 0 | 6012 | 2003-03-14
304 | version 0 | 6013 | 2003-03-19
304a | version 0 | 6013 | 2003-03-24
305 | version 1(*) | 6015 | 2003-03-28
305a | version 1(*) | 6016 | 2003-03-30
306 | version 1 | 6018 | 2003-04-08
307 | version 1 | 6019 | 2003-04-11
308 | version 1 | 6021 | 2003-04-16
309 | version 1 | 6022 | 2003-04-17
310 | version 1 | 6023 | 2003-04-24
311 | version 1 | 6027 | 2003-04-30
312 | version 1 | 6030 | 2003-05-13
313 | version 1 | 6031 | 2003-05-19
314 | version 1 | 6034 | 2003-05-30
314a | version 1 | 6034 | 2003-06-02
315 | version 1 | 6034 | 2003-06-10
(*) Patch 305 and 305a still use the old V0 GameVersion scheme (2 words).
Notes:
o 313 replays might be convertable to FT retail 1.07 replays.
o 315 replays might be convertable to FT retail 1.10/1.11 replays.
2.4.1 Beta versions of various patches
--------------------------------------
These patches were only distributed through the 'Westfall' gateway.
game | version | version | date |
version | in replay | of war3.exe | of release | beta for
---------+--------------+-----------------+--------------+----------------
1.15 | 1. 15.6041 | 1.0.15.5900 | 2004-04-16 | patch 1.15
1.401 | 1.401.6042 | 401.0. 0.5911 | 2004-04-22 | patch 1.15
1.402 | | | 2004-04-24 | patch 1.15
1.403 | | | 2004-06-23 | Ladder XP
1.404 | | | 2004-08-14 | patch 1.17
1.405 | | | 2004-08-19 | patch 1.17
1.406 | | | 2004-08-31 | patch 1.17
===============================================================================
3.0 [Data block header]
===============================================================================
Each compressed data block consists of a header followed by compressed data.
The first data block starts at the address denoted in the replay file header.
All following addresses are relative to the start of the data block header.
The decompressed data blocks append to a single continueous data stream
(disregarding the block headers). The content of this stream (see section 4) is
completely independent of the original block boundaries.
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 word | size n of compressed data block (excluding header)
0x0002 | 1 word | size of decompressed data block (currently 8k)
0x0004 | 1 dword | unknown (probably checksum)
0x0008 | n bytes | compressed data (decompress using zlib)
To decompress one block with zlib:
1. call 'inflate_init'
2. call 'inflate' with Z_SYNC_FLUSH for the block
The last block is padded with 0 bytes up to the 8K border. These bytes can
be disregarded.
//TODO: add decompression details and move explanation to seperate file
===============================================================================
4.0 [Decompressed data]
===============================================================================
Decompressed data is a collection of data items that appear back to back in
the stream. The offsets for these items vary depending on the size of every
single item.
This section describes the records that always appear at the beginning of
a replay data stream. They hold information about settings and players right
before the start of the game. Data about the game in progress is described
in section 5.
The order of the start up items is as follows:
# | Size | Name
---+----------+--------------------------
1 | 4 byte | Unknown (0x00000110 - another record id?)
2 | variable | PlayerRecord (see 4.1)
3 | variable | GameName (null terminated string) (see 4.2)
4 | 1 byte | Nullbyte
5 | variable | Encoded String (null terminated) (see 4.3)
| | - GameSettings (see 4.4)
| | - Map&CreatorName (see 4.5)
6 | 4 byte | PlayerCount (see 4.6)
7 | 4 byte | GameType (see 4.7)
8 | 4 byte | LanguageID (see 4.8)
9 | variable | PlayerList (see 4.9)
10 | variable | GameStartRecord (see 4.11)
The following sections describe these items in detail.
After the static items (as described above) there follow variable information
organized in blocks that are described in section 5.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.1 [PlayerRecord]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 byte | RecordID:
| | 0x00 for game host
| | 0x16 for additional players (see 4.9)
0x0001 | 1 byte | PlayerID
0x0002 | n bytes | PlayerName (null terminated string)
n+2 | 1 byte | size of additional data:
| | 0x01 = custom
| | 0x08 = ladder
Depending on the game type one of these records follows:
o For custom games:
offset | size/type | Description
-------+-----------+---------------------------------------------------------
0x0000 | 1 byte | null byte (1 byte)
o For ladder games:
offset | size/type | Description
-------+-----------+---------------------------------------------------------
0x0000 | 4 bytes | runtime of players Warcraft.exe in milliseconds
0x0004 | 4 bytes | player race flags:
| | 0x01=human
| | 0x02=orc
| | 0x04=nightelf
| | 0x08=undead
| | (0x10=daemon)
| | 0x20=random
| | 0x40=race selectable/fixed (see notes in section 4.11)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.2 [GameName]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is a plain null terminated string reading the name of the game.
Only in custom battle.net games you can name your game, otherwise the name
is fixed:
o For ladder games it reads "BNet".
o For custom LAN games it holds a localized string including the game creators
player name.
Examples: a game created by the player 'Blue' results in:
"Blue's game" for the english version of Warcraft III
"Spiel von Blue" for the german version
o For custom single player games it holds a localized fixed string.
"local game" for the english version
"Lokales Spiel" for the german version
o Following is a list for all localized strings (encoded in plain ASCII) used
by WarCraft III patch version 1.06 and earlier
(see war3.mpq\UI\FrameDef\GlobalStrings.fdf: GAMENAME, LOCAL_GAME):
English : "%s's Game" : "local game"
Czech (1029): "Hra %s" : "M韘tn?hra"
German (1031): "Spiel von %s" : "Lokales Spiel"
Spanish (1034): "Partida de %s" : "Partida local"
French (1036): "Partie de %s" : "Partie locale"
Italian (1040): "Partita di %s" : "Partita locale"
Polish (1045): "Gra (%s)" : "Gra lokalna"
%s denotes the game creators player name.
o The following list shows all localized strings (encoded in plain ASCII) used
by WarCraft III patch version 1.07 and later
(see war3.mpq\UI\FrameDef\GlobalStrings.fdf: GAMENAME, LOCAL_GAME):
German (1031): "Lokales Spiel (%s)" : "Lokales Spiel"
%s denotes the game creators player name.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.3 [Encoded String]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are the GameSetting and three null-terminated strings here back-to-back,
all encoded into a single null terminated string.
(But we don't know the reason for this encoding!)
Every even byte-value was incremented by 1. So all encoded bytes are odd.
A control-byte stores the transformations for the next 7 bytes.
Since all NullBytes were transformed to 1, they will never occure inside the
encoded string. But a NullByte marks the end of the encoded string.
The encoded string starts with a control byte.
The control byte holds a bitfield with one bit for each byte of the next 7
bytes block. Bit 1 (not Bit 0) corresponds to the following byte right after
the control-byte, bit 2 to the next, and so on.
Only Bit 1-7 contribute to encoded string. Bit 0 is unused and always set.
Decoding these bytes works as follows:
If the corresponding bit is a '1' then the character is moved over directly.
If the corresponding bit is a '0' then subtract 1 from the character.
After a control-byte and the belonging 7 bytes follows a new control-byte
until you find a NULL character in the stream.
Example decompression code (in 'C'):
char* EncodedString;
char* DecodedString;
char mask;
int pos=0;
int dpos=0;
while (EncodedString[pos] != 0)
{
if (pos%8 == 0) mask=EncodedString[pos];
else
{
if ((mask & (0x1 << (pos%8))) == 0)
DecodedString[dpos++] = EncodedString[pos] - 1;
else
DecodedString[dpos++] = EncodedString[pos];
}
pos++;
}
Alternatively one could interprete the encoding scheme as follow:
Bit 0 of every character was moved to the control byte and set to 1 afterwards.
TODO: Maybe this gives a simpler decoding algorithm.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.4 [GameSettings]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make sure you have decoded the GameSettings (see 4.3).
The game settings (extended options on create game screen) are packed using
various flags distributed over 13 bytes.
For details about the single options read the file
"support/Readme/(PC)UIMainMenus.html"
in your WarCraft III installation directory.
Denoted below are only nonzero flags.
offset | bitnr | Description
-------+-------+---------------------------------------------------------------
0x0000 | 0,1 | Game Speed: 0 = slow, 1 = normal, 2 = fast, 3 = unused
-------+-------+---------------------------------------------------------------
0x0001 | 0 | Visibility: 'hide terrain'
| 1 | Visibility: 'map explored'
| 2 | Visibility: 'always visible' (no fog of war)
| 3 | Visibility: 'default'
| 4,5 | Observer : 0 = off or 'Referees' (see 0x0003 Bit6)
| | 1 = unused
| | 2 = 'Obs on Defeat'
| | 3 = on or 'Referees'
| 6 | Teams Together (team members are placed at neighbored places)
-------+-------+---------------------------------------------------------------
0x0002 | 1,2 | Fixed teams: 0 = off, 1 = unused, 2 = unused, 3 = on
-------+-------+---------------------------------------------------------------
0x0003 | 0 | Full Shared Unit Control
| 1 | Random Hero
| 2 | Random Races
| 6 | Observer: Referees (other observer bits are 0 or 3)
-------+-------+---------------------------------------------------------------
0x0004 | | 0
0x0005 | | unknown (0 in ladder games, but not in custom)
0x0006 | | 0
0x0007 | | unknown (0 in ladder games, but not in custom)
0x0008 | | 0
-------+-------+---------------------------------------------------------------
0x0009 | 4Byte | Map Checksum //TODO: find algorithm
- 0C | |
-------+-------+---------------------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.5 [Map&CreatorName]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make sure you have decoded the three Strings (see 4.3).
First is the map name, second is the game creators name (can be "Battle.Net"
for ladder) and a third is an always empty string.
Here ends the encoded string. There should not be any unprocessed decoded
bytes left.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.6 [PlayerCount]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4 bytes - num players or num slots
in Bnet games is the exact ## of players
in Custom games, is the ## of slots on the join game screen
in Single Player custom games is 12
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.7 [GameType]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 byte | Game Type:
| | (0x00 = unknown, just in a few pre 1.03 custom games)
| | 0x01 = Ladder -> 1on1 or FFA
Custom -> Scenario (not 100% sure about this)
| | 0x09 = Custom game
| | 0x1D = Single player game
| | 0x20 = Ladder Team game (AT or RT, 2on2/3on3/4on4)
0x0001 | 1 byte | PrivateFlag for custom games:
| | 0x00 - if it is a public LAN/Battle.net game
| | 0x08 - if it is a private Battle.net game
0x0002 | 1 word | unknown (always 0x0000 so far)
TODO:
values in patch >=1.07:
01 00 00 00 : ladder 1on1 / custom scenario
20 00 00 00 : ladder team
09 00 00 00 : custom game
09 A8 12 00 : custom game
09 A0 12 00 : custom game
09 A8 42 00 : custom game
09 A8 14 00 : custom game
09 A0 14 00 : custom game
01 40 13 00 : custom game
09 A0 42 00 : custom game
09 A8 44 00 : custon game
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.8 [LanguageID]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4 byte - (independent of realm, map, gametype !)
Might be another checksum or encoded language.
I found the following numbers in my replays:
C4 F0 12 00 - patch 1.10 ger
90 F1 12 00 - patch 1.06 ger
90 F1 12 00 - patch 1.05 ger
A0 F6 6D 00 - patch 1.04 ger
24 F8 12 00 - patch 1.04 eng(?)
A0 F6 6D 00 - patch 1.03 ger
C0 F6 6D 00 - patch 1.02 ger
//TODO: Find out what this field is really about.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.9 [PlayerList]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The player list is an array of PlayerRecords for all additional players
(excluding the game host and any computer players).
If there is only one human player in the game it is not present at all!
Per additional player there is the following structure in the file:
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 4/11 byte | PlayerRecord (see 4.1)
0x000? | 4 byte | unknown
| | (always 0x00000000 for patch version >= 1.07
| | always 0x00000001 for patch version <= 1.06)
This record is repeated as long as the first byte equals the additional
player record ID (0x16).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.10 [GameStartRecord]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 byte | RecordID - always 0x19
0x0001 | 1 word | number of data bytes following
0x0003 | 1 byte | nr of SlotRecords following (== nr of slots on startscreen)
0x0004 | n bytes | nr * SlotRecord (see 4.11)
n+4 | 1 dword | RandomSeed (see 4.12)
n+8 | 1 byte | SelectMode
| | 0x00 - team & race selectable (for standard custom games)
| | 0x01 - team not selectable
| | (map setting: fixed alliances in WorldEditor)
| | 0x03 - team & race not selectable
| | (map setting: fixed player properties in WorldEditor)
| | 0x04 - race fixed to random
| | (extended map options: random races selected)
| | 0xcc - Automated Match Making (ladder)
n+9 | 1 byte | StartSpotCount (nr. of start positions in map)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.11 [SlotRecord]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 1 byte | player id (0x00 for computer players)
0x0001 | 1 byte | map download percent: 0x64 in custom, 0xff in ladder
0x0002 | 1 byte | slotstatus:
| | 0x00 empty slot
| | 0x01 closed slot
| | 0x02 used slot
0x0003 | 1 byte | computer player flag:
| | 0x00 for human player
| | 0x01 for computer player
0x0004 | 1 byte | team number:0 - 11
| | (team 12 == observer or referee)
0x0005 | 1 byte | color (0-11):
| | value+1 matches player colors in world editor:
| | (red, blue, cyan, purple, yellow, orange, green,
| | pink, gray, light blue, dark green, brown)
| | color 12 == observer or referee
0x0006 | 1 byte | player race flags (as selected on map screen):
| | 0x01=human
| | 0x02=orc
| | 0x04=nightelf
| | 0x08=undead
| | 0x20=random
| | 0x40=race selectable/fixed (see notes below)
0x0007 | 1 byte | computer AI strength: (only present in v1.03 or higher)
| | 0x00 for easy
| | 0x01 for normal
| | 0x02 for insane
| | for non-AI players this seems to be always 0x01
0x0008 | 1 byte | player handicap in percent (as displayed on startscreen)
| | valid values: 0x32, 0x3C, 0x46, 0x50, 0x5A, 0x64
| | (field only present in v1.07 or higher)
Notes:
o This record is only 7 bytes in pre 1.03 replays.
The last two fields are missing there.
o For pre v1.07 replays this record is only 8 bytes.
The last field is missing there.
o For open and closed slots team and color fields are undetermined.
o For WarCraft III patch version <= 1.06:
If bit 6 of player race flags is additionally set (0x40 added) then the
race is fixed by the map (see also section 4.10).
o For WarCraft III patch version >= 1.07:
If bit 6 of player race flags is additionally set (0x40 added) then the
race is selectable by the player - otherwise it is a ladder game or the
race is fixed by the map (see also section 4.10).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4.12 [RandomSeed]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This field is the best bet on the random seed the Warcraft III engine is
initialized with. The replay data that follows requires already a set up seed
(since starting positions and race are fixed at this time).
For custom games (no matter if battle.net or LAN) this dword appears to be
the runtime of the Warcraft.exe of the game host in milliseconds.
For ladder games the value variies very much - probably the battle.net server
hands out a 'real' seed (not runtime based) to the clients.
=============================================================================== |
|