Modding Files Overview
There are many file formats used in modding. Understanding what these formats represent as well as when and how to edit them is key to modding effectively.
Contents
BIN
There exists three different *.bin files: dialog data (rez\), AI and animation scripts (scripts\), and doodad data (\tileset\*\dddata.bin).
AIScript.bin Opcodes, iscript.bin Opcodes
- Bin dialog reference
- Bin dialog file format
- Edit bin dialogs with BinEdit
- note: Bin dialogs reside in "rez\"
For script\ files, edit with SCAIEdit (AI scripts), IceCC/Ice. (iscript, no ice link)
CCD
(font\font.ccd) A checksum file used during decrypting the CD key.
CHK
Raw map data. Used for maps and campaigns. Edit like normal maps.
scenario.chk format
CLH
(font\font.clh) This file contains the encrypted CD owner name.
CMD
Patch command script.
* set the product patch name PatchVersion This patch upgrades Brood War from version 1.04 to version 1.12. * make sure that we don't patch version 1.12 or greater ProductVersionLessThan $(InstallPath)\Starcraft.exe 1.1.2.0 0xffff.0xffff.0xffff.0xffff * make sure we only patch brood war (which is numbered ##.##.##.1) * v1.02 uses 1.024, so we can only check low bit for Brood War. ProductVersionEqualTo $(InstallPath)\Starcraft.exe 0.0.0.1 0.0.0.0x01 SetLauncher $(InstallPath)\Starcraft.exe
CND
Blizzard map signing (Candidate Scenarios).
- blizzard_2.cnd
- ladder_2.cnd
- ladder_3.cnd
- ladder_4.cnd
DAT
Contain properties and information, such as unit stats, properties, flags, and basic AI.
Edit with DatEdit.
FNT
StarCraft font files. Encrypted in StarDat.mpq, you can get un-encrypted ones from install.exe.
No editor exists, but a spec sheet exists.
The encrypted font file use the SHA-0 digest algorithm and IDEA encryption but not follow the standard form.
All the data and calculation assume the little-endian byte order and seems a bug exist in Blizzard's SHA-0 algorithm: they did all left rotation with signed integer instead of general unsigned.
By this you cannot use common security library such as the OpenSSL to decrypt them directly anyway...
However, you can modify its source to make them work easily.
GID
(font\font.gid) This file contains the encrypted CDKey.
GOT
Game Templates. Contain different game types and their settings.
Edit with GameTemplate.EXE
GRP
In-game images for sprites (including units, weapons, spells, buildings, etc.).
Compile and decompile with GRPEdit, RetroGRP or SFGrp Conv on Windows, and PyGRP on Mac.
INS
Installer script files, found in INSTALL.EXE
@filename
Include a file, essentially pastes the contents of the file into this one
String variablename = "xyz";
Declares a variable
$(variablename)
Gets the value of a variable
LO*
Overlay files. These files control positions of things like bunker overlay, attacks, and engine glows.
Edit with LoEdit
LOA
Attack overlay. Used by the bunker, this is where the firing animations are placed. Also used by siege mode siege tank.
LOB
Birth overlay. Used to units with the 2 in 1 egg spawning option.
LOD
Down overlays. The offsets in this file determine placement of dust when a building lands.
LOF
Fire overlays. These files are used when a building enters critical HP and starts to display flames or blood.
LOO
Object overlay. Used by workers to place powerups when carried.
LOS
Shield/smoke overlay. Used when placing shield hit graphics. For smoke overlay, they are used for the vespene gas poofs.
LOU
Up overlays. The offsets in this file determine placement of dust when a building lifts off.
LOG, LOL, LOX
Miscellaneous overlays. Some are attack overlay offsets, some are for spells, some are for engine overlays, and then there's some more effects they have. Basically, these are used most by the Iscript, while the above ones (except for .loa) are used by the engine.
LST
templates\templates.lst contains the list of *.got files.
Edit with notepad or another text editor.
MPQ
MPQ is short for Mo'PaQ, which is in turn short for Mike O'Brien Pack, the creator the format. Probably the most important format used in modding, MPQ files are similar in function to ZIP files, that is, they hold (and compress) other files inside of them.
When creating a mod, the mod maker usually starts with an MPQ and begins filling it with edited files. The MPQ is then run through a program called MPQDraft, which applies the MPQ in a similar fashion to patch_rt.mpq (and in fact, in a grafted mod, the modded MPQ replaces patch_rt.mpq): the modded MPQ take precedence over patch_rt.mpq, which takes precedence over BrooDat.mpq, which takes precedence over StarDat.mpq. Thus, a file named FOO.BAR in the modded MPQ will be used even if there is a FOO.BAR in any of the other MPQs.
MPQs usually contain metadata files:
- (listfile): Contains a list of the archive's files, one filename per line. May or may not be exhaustive.
- (signature): Contains the weak cryptographic signature of the archive. This type of signature is deprecated.
- (attributes): Contains extended file metadata. Currently known attributes are file creation date, CRC32 checksum and MD5 checksum.
PCX
PCX files are used for the UI images (such as backgrounds, buttons, the in-game console, etc.) and color tables. They can be converted to other formats by programs like Irfanview, and many image editors can edit them (e.g. Paint.NET and the GIMP). Current versions of MS Paint cannot edit PCX images, however older versions (Window 98 and before) can edit them.
PalEdit2 can be used to edit the color tables (mainly the tileset\*\*.pcx ones) and convert them to normal palette files.
RES
(glubnres.res) Battle.net dialogs. Normal resource file.
SCM/SCX
Map files. SCM is for Vanilla maps and SCX is for Expansion maps.
SMK
Smacker animation files. Used for unit portraits, UI animations (main menu and campaign selection buttons), and cinematics.
Edit with Smacker Tools.
SNP
Multiplayer resource files.
SPK
(parallax\star.spk) Star parallax images.
TBL
TBL files contain strings, which are anything from path names to unit/weapon/armor names, to button captions. Most strings in TBL files work just like strings in maps- you can use overlapping and colors. Some strings, particularly the button captions and unit names, are different. Button captions follow a format like this:
button hotkey (a-z)<1>Button caption (usually with a <3>highlightedletter<1>) <0>
Unit names follow this format:
Unit name<0>parenthesed in Staredit (like Jim Raynor (Vulture)) * means no text in italics<0>Group in Staredit<0>
TBL files are edited using TBLPad.
Tileset Files
Blizzard is nuts and made tileset files into a billion little things.
The files are pretty obviously named, however some of them have '-nc' in their name. This indicates that they don't use the color cycling palette (Normally the first row in the palette will rotate values, giving the appearance of animated water or lava.) The editor uses these.
Edit with TileEdit.
dddata.bin
Doodad data values. Appears to be the same as the vf4 values.
CV5
Tileset group values, main tileset file. This contains all the flags for each row of tiles, and the 16 MegaTiles in the row.
VF4
Mini-tile type. Contains the data for mini-tiles, such as whether or not you can walk on them. Bit 0 will indicates if you can walk on it. In simpler terms, if the number is odd you can walk on the minitile. It also shows elevation. The higher the number, the higher the tile.
VR4
Mini-tile image data. Every 64 bytes is one mini-tile. Each byte is a reference to the palette index (exactly like a paletted bitmap.)
VX4
Mini-tile image pointer. Bit 0 will indicate if the tile is flipped, and the 7 high bits will indicate the image to be used.
WPE
Tileset (in-game) palette files. 1024-byte palette file. (4-byte integer for each color.) Edit with PalEdit2.
TRG
Trigger files for game templates. Similar to the ones saved by StarEdit, except they do not have the 8-byte header and contain no extra data. They cannot use any locations and can only use standard strings. [/wiki]*.trg format[/wiki]
TXT
Normal text files. rez\*.txt contain text screen scripts (credits and the campaign screens.)
Codes:
- </COMMENT [TEXT]> Comment line.
- </FADESPEED [#]> Speed between frames.
- </DISPLAYTIME [#]> Time each frame is shown.
- </BACKGROUND [PATH]> Filepath for background.
- </FONTCOLOR [PATH]> Filepath for tfont.pcx color table.
- </SCREEN[POSTION]> Where on screen to show the text. (LOWERLEFT, LEFT, CENTER, RIGHT. There may exist more, but these are all I could find.)
- </PAGE> End of one screen.
Example:
</COMMENT Example screen> </FADESPEED 100> </DISPLAYTIME 5000> </COMMENT #############################################################> </BACKGROUND glue\title\title.pcx> </FONTCOLOR glue\title\tfont.pcx> </SCREENCENTER> LOLOL PANCAKE! </PAGE>
VIS
Installer dialogs
WAV
Supported sound format for StarCraft.
Basic edits to WAV files can be done with Sound Recorder. More advanced edits can be done with these programs.
Unknown Formats
CNT
(files\staredit.cnt)
FLC
(editor\mask.flc, editor\trigrgn.flc)
FSP
(editor\mask.fsp, editor\trigrgn.fsp)
SCC
Heinermann: I believe one of the formats for mask/trigrgn can be opened with quicktime. FaRTy: All I get is a little green square with mask.flc, and a dark blue square with trgrgn.flc... Also the mask/trgrgn.grp files are a brown square and a blue square, respectively. Can't find anything to open the *.fsp files. Clokr_: The editor rgn files (from region) where supposed to be used to display locations. Doodle77: moving INS out of Unknown, they're installer script files