Mapdev:SMF format: Difference between revisions
From Spring
Jump to navigationJump to search
started wikifying the gif from the older page got to go to the gym now though so will finish later. |
m completed table |
||
| Line 1: | Line 1: | ||
{| class="wikitable" | {| class="wikitable" width="100%" | ||
|+ align="left" | SMF File | |+ align="left" | SMF File | ||
| | | | ||
{| class="wikitable" | {| class="wikitable" width="100%" | ||
|+ align="left" | Header | |+ align="left" | Header | ||
!Magic !! Version !! MapID !! Xsize !! Ysize | !Magic !! Version !! MapID !! Xsize !! Ysize | ||
| Line 18: | Line 18: | ||
| colspan=7 | | | colspan=7 | | ||
{| class="wikitable" | {| class="wikitable" width="100%" | ||
|+ align="left" | Extra Header(s) | |+ align="left" | Extra Header(s) | ||
! Extra Header Size !! Extra Header Type !! vegitationPtr | ! Extra Header Size !! Extra Header Type !! vegitationPtr | ||
| Line 27: | Line 27: | ||
|} | |} | ||
{| class="wikitable" | {| class="wikitable" width="100%" | ||
|+ align="left" | +HeightMap | |+ align="left" | +HeightMap | ||
| Array of [xsize+1]*[ysize+1] unsigned short | | Array of [xsize+1]*[ysize+1] unsigned short | ||
|} | |} | ||
{| class="wikitable" | {| class="wikitable" width="100%" | ||
|+ align="left" | +TypeMap | |+ align="left" | +TypeMap | ||
| Array of [xsize/2]*[ysize/2] char(0-255) | | Array of [xsize/2]*[ysize/2] char(0-255) | ||
|} | |} | ||
{| class="wikitable" | {| class="wikitable" width="100%" | ||
|+ align="left" | +MiniMap | |+ align="left" | +MiniMap | ||
| 1024x1024 raw DXT1 image data (NO metadata) | | 1024x1024 raw DXT1 image data (NO metadata) | ||
|} | |} | ||
{| class="wikitable" width="100%" | |||
|+ align="left" | +TileHeader | |||
| | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | MapTileHeader | |||
! #Files !! #Tiles | |||
|- | |||
| Int || Int | |||
|} | |} | ||
| | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | For each external Tile File: | |||
! #Tiles in file !! #Tile Filename | |||
|- | |||
| Int || c_str | |||
|} | |||
|- | |||
! #Internal Tiles !! New Tile Filename | |||
|- | |||
| Int || c_str | |||
|- | |||
| colspan=2 | | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | TileMap | |||
| Array of [Ysize/4]*[Xsize/4] int containing tile # used | |||
|} | |||
|} | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | +MetalMap | |||
| Array of [Ysize/2]*[Xsize/2] char (0-255) containing metal density | |||
|} | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | +VegitationMap | |||
| Array of [Ysize/4]*[Xsize/4] char (0-255) used as boolean | |||
|} | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | +FeatureMap | |||
| | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | MapFeatureHeader | |||
! # Features !! # FeatureTypes | |||
|- | |||
| int || int | |||
|} | |||
| | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | For each TreeType a c_str: | |||
| 'TreeType' + int + null | |||
|} | |||
aka: {TreeType0,TreeType1,TreeTypeX, TreeTypeN} | |||
|- | |||
! Geovents | |||
| rowspan=2 | | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | For each additional feature type" | |||
! Feature Name | |||
|- | |||
| C_str | |||
|} (ie. from fs.txt) | |||
|- | |||
|(c_str)'Geovent' | |||
|- | |||
| colspan=2 | | |||
{| class="wikitable" width="100%" | |||
|+ align="left" | 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. | |||
--[[User:Mother|Mother]] 23:29, 21 Dec 2005 (W. Europe Standard Time) | |||
== Additional Info == | |||
* [https://github.com/spring/spring/blob/2e5bc43dc464ec27d6b880d105f0c618e07c4ff8/rts/Map/SMF/mapfile.h mapfile.h] | |||
* [https://github.com/spring/spring/blob/2e5bc43dc464ec27d6b880d105f0c618e07c4ff8/rts/Map/SMF/SmfMapFile.cpp SmfMapFile.cpp] | |||
* [http://springrts.com/phpbb/viewtopic.php?f=13&t=20337 Forum Thread with more info] | |||
[[Category:Mapdev]] | [[Category:Mapdev]] | ||
[[Category:Development]] | [[Category:Development]] | ||
Revision as of 00:32, 15 December 2012
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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)