Mapdev:SMF format: Difference between revisions

From Spring
Jump to navigationJump to search
m Enetheru moved page MapDev:SMF format to Mapdev:SMF format: incorrect naming scheme, stupid capital letters.
m added more info
Line 1: Line 1:
= SMF Reference =
SMF(Spring Map Format)
= File Location =
./maps/mymapname.smf
= Binary Format =
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
|+ align="left" | SMF File
|+ align="left" | SMF File

Revision as of 08:18, 20 December 2012

SMF Reference

SMF(Spring Map Format)

File Location

./maps/mymapname.smf

Binary Format

SMF File
Header
Magic Version MapID Xsize Ysize
(c_str)`spring map file' (int)1 32bit uInt Int int
Square Size texel/square tile size minHeight maxheight ExtraHdrs
(int)8 (int)8 (int)32 float float (int)1
heightPtr typePtr miniPtr tilesPtr metalPtr featurePtr
int int int int int int
Extra Header(s)
Extra Header Size Extra Header Type vegitationPtr
(int)12 (~int)MEH_Vegetation (int)
+HeightMap
Array of [xsize+1]*[ysize+1] unsigned short
+TypeMap
Array of [xsize/2]*[ysize/2] char(0-255)
+MiniMap
1024x1024 raw DXT1 image data (NO metadata)
+TileHeader
MapTileHeader
#Files #Tiles
Int Int
For each external Tile File:
#Tiles in file #Tile Filename
Int c_str
#Internal Tiles New Tile Filename
Int c_str
TileMap
Array of [Ysize/4]*[Xsize/4] int containing tile # used
+MetalMap
Array of [Ysize/2]*[Xsize/2] char (0-255) containing metal density
+VegitationMap
Array of [Ysize/4]*[Xsize/4] char (0-255) used as boolean
+FeatureMap
MapFeatureHeader
# Features # FeatureTypes
int int
For each TreeType a c_str:
'TreeType' + int + null

aka: {TreeType0,TreeType1,TreeTypeX, TreeTypeN}

Geovents
For each additional feature type"
Feature Name
C_str
(ie. from fs.txt)
(c_str)'Geovent'
MapFeatureStruct:(1 for each feature on map)
featureType xPos yPos zPos Rotation relativeSize
Int Float Float Float Float (float)1

Notes:

  • Sometimes I've given the 'effective' format, not what the game actually uses.
  • When I say something like 'c_str' I mean an array of char with terminating null.
  • Never include `'"{}s.
  • Pointers are all offsets (in 8bit char's) from the beginning of the file.
  • MapID is just gibberish that is[or should] only used to identify two almost identical maps as different.

The SMT description will hopefully appear in the future.

Double check this information, no guarantees.

--Mother 23:29, 21 Dec 2005 (W. Europe Standard Time)

Additional Info