Skip to content

Match statistics file

Formats

Added in 0.2.0

Records the result of a game against other machines in `stats.dmp` for a ladder client to upload.

Format
Kind
Binary format
Extension
.DMP
Role
Persistence

A game against other machines started with WriteStatistics=yes in SPAWN.INI writes stats.dmp when the match is decided. The CnCNet quick-match client uploads the file to the ladder after the game exits. Without that key, and in a skirmish or campaign mission, no file is written.

The game writes the file once per match, at the first of these:

  • the local player wins or is defeated;
  • a player quits, is dropped or is removed, and one team is left;
  • the game goes out of sync, or loses its connection to the other machines;
  • the local player leaves before the match is decided.

The file goes beside the game’s executable, or into the folder -USERDIR= names. It replaces any stats.dmp already there. An observer’s machine writes no file.

The counts and the match time carry over through a saved game, so a match resumed from a save, or loaded during play, reports the whole match.

The file is the Westwood Online results packet. All numbers are big-endian.

OffsetSizeContents
02Total size of the file in bytes, header included
22Packet ID, always 0
4Fields, one after another, to the end of the file

Each field is an 8-byte header followed by its data and then zero bytes up to the next multiple of four:

OffsetSizeContents
04Tag, four ASCII characters
42Type
62Data length in bytes, without the padding
8lengthData
TypeData
1One signed byte
2One unsigned byte, used for yes or no
5A signed 32-bit number
6An unsigned 32-bit number
7Text, ending with a zero byte that the length counts
20A list of unsigned 32-bit counts

The total size is a 16-bit number, so a match whose fields would pass 65,535 bytes writes no file.

TagTypeContents
IDNO6GameID from SPAWN.INI
SCEN7UIMapName from SPAWN.INI, or the scenario’s own name when that key is empty
HASH7MapHash from SPAWN.INI; left out when that key is empty
DURA6How long the match ran, in units of 0.96 seconds
AFPS6Game frames per DURA unit
FINI2Whether the game counted the match as finished when it wrote the file
OOSY2Whether the game went out of sync or lost its connection
PLRS6The number of players in the file
SPID6The local player’s index in the file
CRED6Starting credits
UNIT6Starting unit count
TECH6Tech level
AIPL6Number of computer players
BASE2Bases
CRAT2Crates
TIBR2BridgeDestroy, despite the tag
SHAD2Whether the shroud grows back
FLAG2Whether the match is capture the flag
SPED1Game speed
VERS7The game version, after a V
DATE20The executable’s modification time, each 32-bit half big-endian with the low half first
PROC1A processor class
MEMO5Installed memory in bytes
GSKU, TRNY, TIME, PNGS, PNGR6 or 5Always 0

The file lists each person in the match, defeated or not. Observers, computer players and a player whose base the computer took over are left out. The players are sorted by name, ignoring case, and numbered from 0. Each player field ends with the player’s number as a digit, so NAM0 is the first player’s name.

TagTypeContents
NAM7The player’s Name from SPAWN.INI, even under QuickMatch
CMP6How the match ended for the player; see below
LCN2Whether the player lost their connection without resigning
SID6The player’s country
COL6The player’s color scheme
TID6The player’s number again
BSP5The start position the player began at, or -1
CRD5Credits at the end
IPA6The network address the game holds for the player’s machine; 0 through a tunnel
CID6Always 0
HRV6Always 0

CMP is a set of bits:

ValueWhen
8The game had not counted the match as finished; every player gets this value
2The player lost their connection
528The player quit or resigned (512 and 16)
512The player was defeated
256None of the above: the player won

The first row that applies is used.

The count fields are lists of counts, one for each type in the order the game created its types, and stop after the last count that is not zero. An empty list means none.

TagCounts
INB, UNB, PLB, BLBInfantry, vehicles, aircraft and buildings the player gained, including their starting forces and anything captured
INL, UNL, PLL, BLLInfantry, vehicles, aircraft and buildings the player had at the end; civilian infantry is not counted
INK, UNK, PLK, BLKInfantry, vehicles, aircraft and buildings the player destroyed
BLCBuildings the player captured
CRACrates the player picked up, by crate kind

Source files

Linked at revision cfa7f5bbbc2e.

History

  1. Added0.2.0Release candidate

    Write the match statistics file for ladder clients