Difference between revisions of "Terrain Format"

From Staredit Network Wiki
Jump to: navigation, search
m (changed instances of the word "reference" to "ID")
m (VF4: fixed formatting)
Line 62: Line 62:
 
ID Range: 0-65535
 
ID Range: 0-65535
  
* '''u16[16]``` - MiniTile Flags:
+
* '''u16[16]''' - MiniTile Flags:
 
** 0x0001 - Walkable
 
** 0x0001 - Walkable
 
** 0x0002 - Mid
 
** 0x0002 - Mid

Revision as of 01:42, 9 August 2022

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
  • 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
  • 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


Flag Values (some flags appear to be unused/outdated, while others appear to be used internally by StarCraft. These values have been italicized):

  • 0x0001 - (Generally) buildable and/or passable terrain types?
  • 0x0002 - Unknown/Unused
  • 0x0004 - Impassable terrain types?
  • 0x0008 - Unknown/Unused
  • 0x0010 - Trees?
  • 0x0020 - Unknown/Unused
  • 0x0040 - Creep (unbuildable for non-creep buildings)
  • 0x0080 - Unbuildable
  • 0x0100 - Objects/Rocks/Trees?
  • 0x0200 - Mid Ground (deprecated? some values are incorrect)
  • 0x0400 - High Ground (deprecated? some values are incorrect)
  • 0x0800 - Unknown/Unused
  • 0x1000 - Has Sprites.dat overlay
  • 0x2000 - Has Units.dat overlay
  • 0x4000 - Overlay is flipped (unused)
  • 0x8000 - Allow Beacons/Start Locations to be placeable

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.