Difference between revisions of "Terrain Format"

From Staredit Network Wiki
Jump to: navigation, search
(Created page with '*Nibble = 4 bits *Byte = 8 bits *Word = 2 bytes (Short) All values are unsigned. Data in the format is read left to right, top to bottom (bitmap pixel locations, minitile locat…')
 
(Added File Foramats category)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
*Nibble = 4 bits
+
Data in the format is read left to right, top to bottom (bitmap pixel locations, minitile locations, etc.). All values are unsigned.
*Byte = 8 bits
+
*Word = 2 bytes (Short)
+
 
+
All values are unsigned.
+
 
+
Data in the format is read left to right, top to bottom (bitmap pixel locations, minitile locations, etc.)
+
 
+
The following formats are organized from the topmost level to the bottom-most level (excluding dddata.bin.)
+
  
 
==CV5==
 
==CV5==
Description: This file defines the various tile groups that are referenced by the TILE/MTXM sections of the CHK (3 nibbles for the group, 1 nibble for the tile.)
+
This file defines the various tile groups that are referenced by the TILE/MTXM sections of the CHK (0x7FF0 for the group index, 0x000F for the tile index).
  
 
Struct Size: 52 bytes
 
Struct Size: 52 bytes
 +
ID Range: 0-2047
  
Max ID [referencing this file]: 0-4095
+
For non-doodad tiles:
 +
* '''u16''' Terrain Type - 0 for unused/unplaceable, 1 for doodads, 2+ for basic terrain and edges
 +
* '''u16''' Flags - Properties for this group of tiles. These values get copied directly into the activeTileArray flags, except where noted.
 +
** '''0x0001''' - Walkable ''(gets overwritten by SC based on VF4 flags)''
 +
** '''0x0002''' - Unknown/Unused
 +
** '''0x0004''' - Unwalkable ''(gets overwritten by SC based on VF4 flags)''
 +
** '''0x0008''' - Unknown/Unused
 +
** '''0x0010''' - Has doodad cover
 +
** '''0x0020''' - Unknown/Unused
 +
** '''0x0040''' - Creep (Zerg can build here when this flag is combined with the Temporary creep flag)
 +
** '''0x0080''' - Unbuildable
 +
** '''0x0100''' - Blocks view ''(gets overwritten by SC based on VF4 flags)''
 +
** '''0x0200''' - Mid Ground ''(gets overwritten by SC based on VF4 flags)''
 +
** '''0x0400''' - High Ground ''(gets overwritten by SC based on VF4 flags)''
 +
** '''0x0800''' - Occupied (unbuildable until a building on this tile gets removed)
 +
** '''0x1000''' - Receding creep
 +
** '''0x2000''' - Cliff edge ''(gets overwritten by SC based on VF4 flags)''
 +
** '''0x4000''' - Temporary creep (Zerg can build here when this flag is combined with the Creep flag)
 +
** '''0x8000''' - Allow Beacons/Start Locations to be placeable
 +
* '''Rect16''' Edge Types - Determines what tile types can be adjacent to tiles in this group. Unsure if StarEdit actually uses these, or if they are just reference/outdated values.
 +
** '''u16''' Left
 +
** '''u16''' Up
 +
** '''u16''' Right
 +
** '''u16''' Down
 +
* '''Rect16''' Terrain Piece Type - Determines multi-tile blocks of terrain (e.g. 2x3 cliff pieces). A value of 0 can match any appropriate tile, otherwise the edge only pairs with a matching Terrain Piece Type value and tile index. Unsure if StarEdit actually uses these, or if they are just reference/outdated values.
 +
** '''u16''' Left - Unknown/unused (always 0)
 +
** '''u16''' Up
 +
** '''u16''' Right - Unknown/unused (always 0)
 +
** '''u16''' Down
 +
* '''u16[16]''' Tiles - VX4/VF4 MegaTile ID
  
For tile and edge pieces (IDs 0-1023):
 
*Word - Index?
 
*Nibble - Unknown
 
*Nibble - Buildable
 
**0 = Buildable
 
**4 = Creep?
 
**8 = Unbuildable
 
*Nibble - Ground Height - Deprecated? Some values are incorrect.
 
*Nibble - Unknown/Unused?
 
*Word - Left Edge? (not fully understood.)
 
*Word - Top Edge? (not fully understood.)
 
*Word - Right Edge? (not fully understood.)
 
*Word - Bottom Edge? (not fully understood.)
 
*Word - Unknown/Unused
 
*Word - Unknown - Edge piece has rows above it. (Recently noticed; not fully understood.)
 
**1 = Basic edge piece.
 
**2 = Right edge piece.
 
**3 = Left edge piece.
 
*Word - Unknown/Unused
 
*Word - Unknown - Edge piece has rows below it. (Recently noticed; not fully understood.)
 
**1 = Basic edge piece.
 
**2 = Right edge piece.
 
**3 = Left edge piece.
 
*16 Words - MegaTile References (VF4/VX4)
 
  
For doodads (IDs 1024+):
+
For doodad tiles (1024+ in pre-remaster tilesets, but SC:R puts some doodads before that index on some tilesets):
*Word - Index? (Always 1?)
+
* '''u16''' Terrain Type - 0 for unused/unplaceable, 1 for doodads, 2+ for basic terrain and edges
*Nibble - Unknown
+
* '''u16''' Flags - Properties for this group of tiles and doodad. Same flags as above, except these with additional meaning:
*Nibble - Buildable
+
** '''0x1000''' - Has Sprites.dat overlay ''(is not cleared by SC, so this flag also counts as Receding creep)''
**0 = Buildable
+
** '''0x2000''' - Has Units.dat overlay
**4 = Creep?
+
** '''0x4000''' - Overlay is flipped (unused) ''(is not cleared SC, so this flag also counts as Temporary creep)''
**8 = Unbuildable
+
* '''u16''' Overlay ID - Sprites.dat or Units.dat ID, depending on flags
*Nibble - Ground Height (Deprecated?)
+
* '''u16''' SC:R Doodad - Set to 1 on doodads added by SC:R
*Nibble - Overlay Flags:
+
* '''u16''' Group String - 1-based stat_txt.tbl string index
**0x0 - None
+
* '''u16''' Unknown/unused (always 0)
**0x1 - Sprites.dat Reference
+
* '''u16''' Doodad ID - dddata.bin index
**0x2 - Units.dat Reference (unit sprite)
+
* '''u16''' Width - Width in tiles of the doodad
**0x4 - Overlay is Flipped
+
* '''u16''' Height - Height in tiles of the doodad
*Word - Overlay ID (Sprites.dat or Units.dat reference, depending on Overlay Flags)
+
* '''u16''' Unknown/unused (always 0)
*Word - Unknown/Unused
+
* '''u16[16]''' Tiles - VX4/VF4 MegaTile ID
*Word - Doodad Group String (1-based stat_txt.tbl index)
+
*Word - Unknown/Unused
+
*Word - dddata.bin Index
+
*Word - Doodad Width (in tiles)
+
*Word - Doodad Height (in tiles)
+
*Word - Unknown/Unused
+
*16 Words - MegaTile References (VF4/VX4)
+
  
 
==VF4==
 
==VF4==
Description: MiniTile flags for each Megatile. Referenced by CV5.
+
MiniTile flags for each MegaTile. Referenced by CV5.
  
 
Struct Size: 32 Bytes
 
Struct Size: 32 Bytes
  
Max ID: 0-65535 (1 word)
+
ID Range: 0-65535
  
*16 Words - MiniTile Flags:
+
* '''u16[16]''' - MiniTile Flags:
**0x0001 - Walkable
+
** 0x0001 - Walkable
**0x0002 - Mid
+
** 0x0002 - Mid
**0x0004 - High (Mid and High unchecked = Low)
+
** 0x0004 - High (Mid and High unchecked = Low)
**0x0008 - Blocks View
+
** 0x0008 - Blocks View
**0x0010 - Ramp - Appears on the middle minitiles of most ramps/stairs.
+
** 0x0010 - Ramp - Appears in the middle of most ramps/stairs
**Rest unknown/unused.
+
** Rest unknown/unused
  
 
==VX4==
 
==VX4==
Description: MiniTile graphic references for each MegaTile. Referenced by CV5.
+
MiniTile graphic references for each MegaTile. Referenced by CV5.
  
 
Struct Size: 32 Bytes
 
Struct Size: 32 Bytes
  
Max ID: 0-65535 (1 word)
+
ID Range: 0-65535
 +
 
 +
* '''u16[16]''' - MiniTile graphics
 +
** '''Bit 0''' (0x0001) - Horizontally Flipped
 +
** '''15 Bits''' (0xFFFE) - VR4 ID
 +
 
 +
==VX4EX==
 +
Replaces VX4 in SC:Remaster and tileset expanding plugins to allow for more minitiles. Note that SC:R itself does not use this file, it is used by SCMDraft.
 +
 
 +
Struct Size: 64 Bytes
 +
 
 +
ID Range: 0-4294967295
  
*16 Words - For each:
+
* '''u32[16]''' - MiniTile graphics
**15 Bits - Graphical References (VR4) ((AND 65534)/2 to find)
+
** '''Bit 0''' (0x00000001) - Horizontally Flipped
**1 Bit - Horizontal flipped flag (AND 1 to find)
+
** '''23 Bits''' (0xFFFFFFFE) - VR4 ID
  
 
==VR4==
 
==VR4==
Description: Graphical Data for minitiles. Referenced by VX4.
+
Graphical Data for minitiles. Referenced by VX4 or VX4EX.
  
 
Struct Size: 64 Bytes
 
Struct Size: 64 Bytes
  
Max ID: 32767 (15 bits)
+
Max ID: 32767 (VX4) or 2147483647 (VX4EX)
  
*64 Bytes[/b] - 1 byte WPE reference.
+
* '''u8[8][8]''' - WPE color index
  
 
==WPE==
 
==WPE==
Description: 256-color RGB Palette.
+
256-color RGB Palette.
  
struct Size: 4 Bytes (Entire file is always 1024 bytes.)
+
Struct Size: 4 Bytes (entire file is always 1024 bytes).
  
Max ID: 0-255 (1 byte)
+
ID Range: 0-255
  
*Byte - Red
+
* '''u8''' - Red
*Byte - Green
+
* '''u8''' - Green
*Byte - Blue
+
* '''u8''' - Blue
*Byte - Null (0)
+
* '''u8''' - Unused
  
 
==DDDATA.BIN==
 
==DDDATA.BIN==
Description: Doodad placeability. Referenced by CV5.
+
Doodad placeability. Referenced by CV5.
  
Struct Size: 512 Bytes (Entire file is 256KB.)
+
Struct Size: 512 Bytes (entire file is 256KB).
  
Max ID: 1-511
+
ID Range: 0-511
  
*256 Words - CV5 Group ID references for placeability. Only the first (Doodad Width * Height) words are used for each doodad. 0 is used for tiles that are null and placeable anywhere.
+
* '''u16[256]''' - CV5 Group IDs to determine doodad placeability. Only the first Doodad Width*Height indexes are used for each. A value of 0 is used on null tiles and can be placed anywhere.
  
 
[[Category:StarCraft]]
 
[[Category:StarCraft]]
 
[[Category:Reference]]
 
[[Category:Reference]]
 
[[Category:Modding]]
 
[[Category:Modding]]
 +
[[Category:File Formats]]

Latest revision as of 13:21, 1 June 2023

Data in the format is read left to right, top to bottom (bitmap pixel locations, minitile locations, etc.). All values are unsigned.

CV5

This file defines the various tile groups that are referenced by the TILE/MTXM sections of the CHK (0x7FF0 for the group index, 0x000F for the tile index).

Struct Size: 52 bytes ID Range: 0-2047

For non-doodad tiles:

  • u16 Terrain Type - 0 for unused/unplaceable, 1 for doodads, 2+ for basic terrain and edges
  • u16 Flags - Properties for this group of tiles. These values get copied directly into the activeTileArray flags, except where noted.
    • 0x0001 - Walkable (gets overwritten by SC based on VF4 flags)
    • 0x0002 - Unknown/Unused
    • 0x0004 - Unwalkable (gets overwritten by SC based on VF4 flags)
    • 0x0008 - Unknown/Unused
    • 0x0010 - Has doodad cover
    • 0x0020 - Unknown/Unused
    • 0x0040 - Creep (Zerg can build here when this flag is combined with the Temporary creep flag)
    • 0x0080 - Unbuildable
    • 0x0100 - Blocks view (gets overwritten by SC based on VF4 flags)
    • 0x0200 - Mid Ground (gets overwritten by SC based on VF4 flags)
    • 0x0400 - High Ground (gets overwritten by SC based on VF4 flags)
    • 0x0800 - Occupied (unbuildable until a building on this tile gets removed)
    • 0x1000 - Receding creep
    • 0x2000 - Cliff edge (gets overwritten by SC based on VF4 flags)
    • 0x4000 - Temporary creep (Zerg can build here when this flag is combined with the Creep flag)
    • 0x8000 - Allow Beacons/Start Locations to be placeable
  • Rect16 Edge Types - Determines what tile types can be adjacent to tiles in this group. Unsure if StarEdit actually uses these, or if they are just reference/outdated values.
    • u16 Left
    • u16 Up
    • u16 Right
    • u16 Down
  • Rect16 Terrain Piece Type - Determines multi-tile blocks of terrain (e.g. 2x3 cliff pieces). A value of 0 can match any appropriate tile, otherwise the edge only pairs with a matching Terrain Piece Type value and tile index. Unsure if StarEdit actually uses these, or if they are just reference/outdated values.
    • u16 Left - Unknown/unused (always 0)
    • u16 Up
    • u16 Right - Unknown/unused (always 0)
    • u16 Down
  • u16[16] Tiles - VX4/VF4 MegaTile ID


For doodad tiles (1024+ in pre-remaster tilesets, but SC:R puts some doodads before that index on some tilesets):

  • u16 Terrain Type - 0 for unused/unplaceable, 1 for doodads, 2+ for basic terrain and edges
  • u16 Flags - Properties for this group of tiles and doodad. Same flags as above, except these with additional meaning:
    • 0x1000 - Has Sprites.dat overlay (is not cleared by SC, so this flag also counts as Receding creep)
    • 0x2000 - Has Units.dat overlay
    • 0x4000 - Overlay is flipped (unused) (is not cleared SC, so this flag also counts as Temporary creep)
  • u16 Overlay ID - Sprites.dat or Units.dat ID, depending on flags
  • u16 SC:R Doodad - Set to 1 on doodads added by SC:R
  • u16 Group String - 1-based stat_txt.tbl string index
  • u16 Unknown/unused (always 0)
  • u16 Doodad ID - dddata.bin index
  • u16 Width - Width in tiles of the doodad
  • u16 Height - Height in tiles of the doodad
  • u16 Unknown/unused (always 0)
  • u16[16] Tiles - VX4/VF4 MegaTile ID

VF4

MiniTile flags for each MegaTile. Referenced by CV5.

Struct Size: 32 Bytes

ID Range: 0-65535

  • u16[16] - MiniTile Flags:
    • 0x0001 - Walkable
    • 0x0002 - Mid
    • 0x0004 - High (Mid and High unchecked = Low)
    • 0x0008 - Blocks View
    • 0x0010 - Ramp - Appears in the middle of most ramps/stairs
    • Rest unknown/unused

VX4

MiniTile graphic references for each MegaTile. Referenced by CV5.

Struct Size: 32 Bytes

ID Range: 0-65535

  • u16[16] - MiniTile graphics
    • Bit 0 (0x0001) - Horizontally Flipped
    • 15 Bits (0xFFFE) - VR4 ID

VX4EX

Replaces VX4 in SC:Remaster and tileset expanding plugins to allow for more minitiles. Note that SC:R itself does not use this file, it is used by SCMDraft.

Struct Size: 64 Bytes

ID Range: 0-4294967295

  • u32[16] - MiniTile graphics
    • Bit 0 (0x00000001) - Horizontally Flipped
    • 23 Bits (0xFFFFFFFE) - VR4 ID

VR4

Graphical Data for minitiles. Referenced by VX4 or VX4EX.

Struct Size: 64 Bytes

Max ID: 32767 (VX4) or 2147483647 (VX4EX)

  • u8[8][8] - WPE color index

WPE

256-color RGB Palette.

Struct Size: 4 Bytes (entire file is always 1024 bytes).

ID Range: 0-255

  • u8 - Red
  • u8 - Green
  • u8 - Blue
  • u8 - Unused

DDDATA.BIN

Doodad placeability. Referenced by CV5.

Struct Size: 512 Bytes (entire file is 256KB).

ID Range: 0-511

  • u16[256] - CV5 Group IDs to determine doodad placeability. Only the first Doodad Width*Height indexes are used for each. A value of 0 is used on null tiles and can be placed anywhere.