portdata.dat Format

portdata.dat lists the portraits: the videos shown in the status panel for the selected unit, and in mission briefings (see Appendix: Portraits list). A unit type picks its portrait with the Portrait field of units.dat. Each portrait has fidget videos, played while the portrait is idle, and talking videos, played while the unit speaks.

The file is arr\portdata.dat in the game's MPQ archives. It has 110 entries, one for each portrait, and is 1320 bytes long. It is stored field by field, not entry by entry: first the Fidget Video Name of all 110 portraits, then the Talking Video Name of all 110, and so on, with nothing in between. The offsets below count from the start of the file.

The layout is the same in every version from 1.04 to 1.17, in both StarCraft and Brood War. StarCraft 1.00 to 1.03 used an older layout with 90 portraits (1080 bytes). That older file is still in StarDat.mpq in later versions, but it is never loaded, because the game finds the copy in BrooDat.mpq (or patch_rt.mpq) first.

The game loads the file each time a game or a mission briefing starts. StarEdit does not use it. If the file is longer than the layout, the game stops with a file error. A shorter file loads without an error if it ends exactly where a field ends; the missing fields then keep whatever they held before. Out-of-range values are not rejected: the game then reads whatever follows the table that the value points into.

The video files are found through a name in arr\portdata.tbl. The game plays portrait<name>.smk, where n is the number of the video: 0 to 3 for fidget videos and 0 to 2 for talking videos. For example, the Marine's fidget name tmarine\TMaFid0 gives portrait\tmarine\TMaFid00.smk to TMaFid03.smk. If a video is missing, the game tries the next lower number. If the portrait setting is below full animation, only video 0 is played.

Fidget Video Name

Offset
0x0000
Length
440 bytes (4 bytes / Portrait)
Description
A string number in arr\portdata.tbl, counting from 1: 1 is the first string. The game turns it into the string itself when it loads the file. Only the lowest 16 bits are used; 0 means no string, and a number beyond the last string gives an empty string. The string is a folder and the start of a file name, to which the game adds the video number and .smk (see the description above).
Values
Integer value between 0 and the number of strings in arr\portdata.tbl.

Talking Video Name

Offset
0x01B8
Length
440 bytes (4 bytes / Portrait)
Description
A string number in arr\portdata.tbl, counting from 1: 1 is the first string. The game turns it into the string itself when it loads the file. Only the lowest 16 bits are used; 0 means no string, and a number beyond the last string gives an empty string. Used like Fidget Video Name for the talking videos. The game picks talking video 0, 1 or 2 at random, never the same one twice in a row. Some portraits that never talk use their fidget name here.
Values
Integer value between 0 and the number of strings in arr\portdata.tbl.

Fidget 0 Chance

Offset
0x0370
Length
110 bytes (1 byte / Portrait)
Description
How likely fidget video 0 is to be picked, out of 101. The game rolls a number from 0 to 100 and walks through the four chances in order, adding each to a running total, until the total reaches the roll. The four chances should add up to at least 100: the game tests for the end of the list only after reading the next chance, so a roll above the total reads a fifth, nonexistent chance. It reads it through whatever variable follows the four field addresses the game keeps, taken as an address, and that variable differs between versions. In a game, 1.05 and 1.17 have the address of a status panel text there, so a byte in or just after that text is read and video 0 is picked; 1.15.0 and 1.16.1 have a flag that is 0 or 1, which is not a readable address, so the game crashes with an access violation. Mission briefings keep their own copy of the four addresses: after it, 1.05 has such a flag and crashes, and 1.15.0 has the width and height of a briefing frame picture, which as an address may or may not be readable (if it is, video 0 is picked). Every shipped portrait adds up to exactly 100.
Values
Integer value between 0 and 255. Shipped: 85, 5, 5 and 5 for most units; 100, 0, 0 and 0 for beacons, flags, powerups and resources.

Fidget 1 Chance

Offset
0x03DE
Length
110 bytes (1 byte / Portrait)
Description
How likely fidget video 1 is to be picked, out of 101. The game rolls a number from 0 to 100 and walks through the four chances in order, adding each to a running total, until the total reaches the roll. See Fidget 0 Chance.
Values
Integer value between 0 and 255. Shipped: 85, 5, 5 and 5 for most units; 100, 0, 0 and 0 for beacons, flags, powerups and resources.

Fidget 2 Chance

Offset
0x044C
Length
110 bytes (1 byte / Portrait)
Description
How likely fidget video 2 is to be picked, out of 101. The game rolls a number from 0 to 100 and walks through the four chances in order, adding each to a running total, until the total reaches the roll. See Fidget 0 Chance.
Values
Integer value between 0 and 255. Shipped: 85, 5, 5 and 5 for most units; 100, 0, 0 and 0 for beacons, flags, powerups and resources.

Fidget 3 Chance

Offset
0x04BA
Length
110 bytes (1 byte / Portrait)
Description
How likely fidget video 3 is to be picked, out of 101. The game rolls a number from 0 to 100 and walks through the four chances in order, adding each to a running total, until the total reaches the roll. See Fidget 0 Chance.
Values
Integer value between 0 and 255. Shipped: 85, 5, 5 and 5 for most units; 100, 0, 0 and 0 for beacons, flags, powerups and resources.

Appendix: Portraits list

Description
Every portrait, with its fidget and talking names from arr\portdata.tbl and its four fidget chances in the shipped data.
Bits
0x00
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x01
tghost\TGhFid0 / tghost\TGhTlk0 (85/5/5/5)
0x02
tfirebat\TFbFid0 / tfirebat\TFbTlk0 (85/5/5/5)
0x03
tvulture\TVuFid0 / tvulture\TVuTlk0 (85/5/5/5)
0x04
TSpider\TMnFid0 / TSpider\TMnTlk0 (85/5/5/5)
0x05
tgoliath\TGoFid0 / tgoliath\TGoTlk0 (85/5/5/5)
0x06
ttank\TTaFid0 / ttank\TTaTlk0 (85/5/5/5)
0x07
tSCV\TSCFid0 / tSCV\TSCTlk0 (87/5/5/3)
0x08
tphoenix\TPhFid0 / tphoenix\TPhTlk0 (85/5/5/5)
0x09
tvessel\TVeFid0 / tvessel\TVeTlk0 (89/5/5/1)
0x0A
tdropshi\TDrFid0 / tdropshi\TDrTlk0 (90/5/0/5)
0x0B
tbattlec\TBaFid0 / tbattlec\TBaTlk0 (85/5/5/5)
0x0C
UKerr\UKeFid0 / UKerr\UKeTlk0 (85/5/5/5)
0x0D
UJim\URaFid0 / UJim\URaTlk0 (85/5/5/5)
0x0E
UDuke\UDuFid0 / UDuke\UDuTlk0 (85/5/5/5)
0x0F
Ncivilian\NCiFid0 / Ncivilian\NCiFid0 (85/5/5/5)
0x10
Umengsk\UMeFid0 / Umengsk\UMeTlk0 (85/5/5/5)
0x11
TAdvisor\TAdFid0 / TAdvisor\TAdTlk0 (85/5/5/5)
0x12
ZLarva\ZLaFid0 / ZLarva\ZLaTlk0 (85/5/5/5)
0x13
ZEgg\ZEgFid0 / ZEgg\ZEgTlk0 (85/5/5/5)
0x14
ZZergl\ZZeFid0 / ZZergl\ZZeTlk0 (85/5/5/5)
0x15
ZHydra\ZHyFid0 / ZHydra\ZHyTlk0 (85/5/5/5)
0x16
ZUltra\ZUlFid0 / ZUltra\ZUlTlk0 (85/5/5/5)
0x17
ZBrood\ZBrFid0 / ZBrood\ZBrTlk0 (85/5/5/5)
0x18
ZDrone\ZDrFid0 / ZDrone\ZDrTlk0 (85/5/5/5)
0x19
ZOver\ZOvFid0 / ZOver\ZOvTlk0 (85/5/5/5)
0x1A
ZMutalid\ZMuFid0 / ZMutalid\ZMuTlk0 (85/5/5/5)
0x1B
ZGuard\ZGuFid0 / ZGuard\ZGuTlk0 (85/5/5/5)
0x1C
ZQueen\ZQuFid0 / ZQueen\ZQuTlk0 (85/5/5/5)
0x1D
ZDefiler\ZDeFid0 / ZDefiler\ZDeTlk0 (85/5/5/5)
0x1E
ZAvenger\ZAvFid0 / ZAvenger\ZAvTlk0 (85/5/5/5)
0x1F
Zcocoon\ZCoFid0 / Zcocoon\ZCoFid0 (85/5/5/5)
0x20
ZChrysalis\ZChFid0 / ZChrysalis\ZChFid0 (85/5/5/5)
0x21
ZInfestT\ZBGFid0 / ZInfestT\ZBGTlk0 (85/5/5/5)
0x22
UZasz\Fid0 / UZasz\Tlk0 (85/5/5/5)
0x23
UDagg\UDgFid0 / UDagg\UDgTlk0 (85/5/5/5)
0x24
UIKerr\UIKFid0 / UIKerr\UIKTlk0 (85/5/5/5)
0x25
UHunters\UHuFid0 / UHunters\UHuTlk0 (85/5/5/5)
0x26
ZAdvisor\ZAdFid0 / ZAdvisor\ZAdTlk0 (85/5/5/5)
0x27
PProbe\PPrFid0 / PProbe\PPrTlk0 (85/5/5/5)
0x28
PZealot\PZeFid0 / PZealot\PZeTlk0 (85/5/5/5)
0x29
PDragoon\PDrFid0 / PDragoon\PDrTlk0 (85/5/5/5)
0x2A
PTemplar\PTeFid0 / PTemplar\PTeTlk0 (85/5/5/5)
0x2B
parchon\PArFid0 / parchon\PArTlk0 (85/5/5/5)
0x2C
pshuttle\PShFid0 / pshuttle\PShTlk0 (85/5/5/5)
0x2D
PScout\PScFid0 / PScout\PScTlk0 (85/5/5/5)
0x2E
PArbiter\PAbFid0 / PArbiter\PAbTlk0 (85/5/5/5)
0x2F
pcarrier\PCaFid0 / pcarrier\PCaTlk0 (85/5/5/5)
0x30
PInterce\PInFid0 / PInterce\PInTlk0 (85/5/5/5)
0x31
UDTemplar\UDTFid0 / UDTemplar\UDTTlk0 (85/5/5/5)
0x32
UFenZeal\UFeFid0 / UFenZeal\UFeTlk0 (85/5/5/5)
0x33
UFenDrag\UFdFid0 / UFenDrag\UFdTlk0 (85/5/5/5)
0x34
UZeratul\UZeFid0 / UZeratul\UZeTlk0 (85/5/5/5)
0x35
UTassadar\UTaFid0 / UTassadar\UTaTlk0 (85/5/5/5)
0x36
UTassadar\UTaFid0 / UTassadar\UTaTlk0 (85/5/5/5)
0x37
PWitness\PWiFid0 / PWitness\PWiTlk0 (85/5/5/5)
0x38
PTrilo\PTrFid0 / PTrilo\PTrTlk0 (85/5/5/5)
0x39
PTrilo\PTrFid0 / PTrilo\PTrTlk0 (85/5/5/5)
0x3A
Ukhad\NCrFid0 / Ukhad\NCrTlk0 (100/0/0/0)
0x3B
PAdvisor\PAdFid0 / PAdvisor\PAdTlk0 (85/5/5/5)
0x3C
PAdvisor\PAdFid0 / PAdvisor\PAdTlk0 (85/5/5/5)
0x3D
nbiker\NBiFid0 / nbiker\NBiTlk0 (85/5/5/5)
0x3E
NBadCrit\NBCFid0 / NBadCrit\NBCTlk0 (85/5/5/5)
0x3F
NJungCrit\NJCFid0 / NJungCrit\NJCTlk0 (85/5/5/5)
0x40
NLavaCrit\NLCFid0 / NLavaCrit\NLCTlk0 (85/5/5/5)
0x41
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x42
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x43
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x44
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x45
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x46
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x47
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x48
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x49
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x4A
tmarine\TMaFid0 / tmarine\TMaTlk0 (85/5/5/5)
0x4B
NGasTank\NGTFid0 / NGasTank\NGTFid0 (100/0/0/0)
0x4C
NGOrb\NGOFid0 / NGOrb\NGOFid0 (100/0/0/0)
0x4D
NGasSac\NGSFid0 / NGasSac\NGSFid0 (100/0/0/0)
0x4E
NOre\NOCFid0 / NOre\NOCFid0 (100/0/0/0)
0x4F
UDisk\UDdFid0 / Udisk\UDdTlk0 (100/0/0/0)
0x50
Upsi\UPsFid0 / Upsi\UPsTlk0 (100/0/0/0)
0x51
Ushard\UShFid0 / Ushard\UShTlk0 (100/0/0/0)
0x52
UFlag1\UF1Fid0 / UFlag1\UF1Tlk0 (100/0/0/0)
0x53
UFlag2\UF2Fid0 / UFlag2\UF2Tlk0 (100/0/0/0)
0x54
UFlag3\UF3Fid0 / UFlag3\UF3Tlk0 (100/0/0/0)
0x55
UFlag4\UF4Fid0 / UFlag4\UF4Tlk0 (100/0/0/0)
0x56
UFlag5\UF5Fid0 / UFlag5\UF5Tlk0 (100/0/0/0)
0x57
UFlag6\UF6Fid0 / UFlag6\UF6Tlk0 (100/0/0/0)
0x58
UFlag7\UF7Fid0 / UFlag7\UF7Tlk0 (100/0/0/0)
0x59
UFlag8\UF8Fid0 / UFlag8\UF8Tlk0 (100/0/0/0)
0x5A
tmedic\TMeFid0 / tmedic\TMeTlk0 (85/5/5/5)
0x5B
Tbomber\TBmFid0 / TBomber\TBmTlk0 (85/5/5/5)
0x5C
TDugal\UdgFid0 / TDugal\UdgTlk0 (85/5/5/5)
0x5D
Talex\TaxFid0 / Talex\TaxTlk0 (85/5/5/5)
0x5E
TSam\TsmFid0 / TSam\TsmTlk0 (85/5/5/5)
0x5F
PArtanis\PatFid0 / PArtanis\PatTlk0 (85/5/5/5)
0x60
PRaz\PRzFid0 / PRaz\PRzTlk0 (85/5/5/5)
0x61
Zdevour\ZDvfid0 / Zdevour\ZDvtlk0 (85/5/5/5)
0x62
ZLurker\ZLufid0 / ZLurker\ZLutlk0 (85/5/5/5)
0x63
PDarchon\PDaFid0 / PDarchon\PDaTlk0 (85/5/5/5)
0x64
PCorsair\PCsFid0 / PCorsair\PCsTlk0 (85/5/5/5)
0x65
NRedCrit\NRDFid0 / NRedCrit\NRDTlk0 (85/5/5/5)
0x66
NBluCrit\NLCFid0 / NBluCrit\NLCTlk0 (85/5/5/5)
0x67
NIceCrit\NICFid0 / NIceCrit\NICTlk0 (85/5/5/5)
0x68
UUraj\UUjFid0 / UUraj\UUjTlk0 (100/0/0/0)
0x69
UKhalis\UKsFid0 / UKhalis\UKsTlk0 (100/0/0/0)
0x6A
UFlag9\UF9Fid0 / UFlag9\UF9Tlk0 (100/0/0/0)
0x6B
UFlag10\UF10Fid0 / UFlag10\UF10Tlk0 (100/0/0/0)
0x6C
UFlag11\UF11Fid0 / UFlag11\UF11Tlk0 (100/0/0/0)
0x6D
UFlag12\UF12Fid0 / UFlag12\UF12Tlk0 (100/0/0/0)