Mapdev:SMF format: Difference between revisions
From Spring
Jump to navigationJump to search
m →Data Map: width and length paremeters had incorrect description. |
Funkencool (talk | contribs) m to match source code |
||
| Line 33: | Line 33: | ||
|- | |- | ||
| 4 || <code>float</code> || Height/max height; 512 = 1*smu | | 4 || <code>float</code> || Height/max height; 512 = 1*smu | ||
|- | |- | ||
| 4 || <code>int</code> || Byte offset to start of height map | | 4 || <code>int</code> || Byte offset to start of height map | ||
| Line 47: | Line 45: | ||
|- | |- | ||
| 4 || <code>int</code> || Byte offset to start of features map | | 4 || <code>int</code> || Byte offset to start of features map | ||
|- | |||
| 4 || <code>int</code> || No of extra headers | |||
|} | |} | ||
Latest revision as of 07:53, 3 October 2014
SMF(Spring Map File) Reference
SMF is a binary format
File location
maparchive.sd7/maps/mymapname.smf
Data Map
- smu = spring map unit, the size you see when in the lobby. roughly between 2 and 64.
| Bytes | Type | Description |
|---|---|---|
| 16 | char[] |
Magic number; "spring map file\0" |
| 4 | int |
Version number; "1" |
| 4 | unsigned int |
ID, should be as unique as possible. |
| 4 | int |
Width; smu * 64 |
| 4 | int |
Length; smu * 64 |
| 4 | int |
Square size; 8 |
| 4 | int |
Texels per square size; 8 |
| 4 | int |
Tile size; 32 |
| 4 | float |
Depth/min height; 512 = 1*smu |
| 4 | float |
Height/max height; 512 = 1*smu |
| 4 | int |
Byte offset to start of height map |
| 4 | int |
Byte offset to start of type map |
| 4 | int |
Byte offset to start of tile index |
| 4 | int |
Byte offset to start of mini map |
| 4 | int |
Byte offset to start of metal map |
| 4 | int |
Byte offset to start of features map |
| 4 | int |
No of extra headers |
| Bytes | Type | Description |
|---|---|---|
| 4 | int |
Size of the header |
| 4 | int |
Type of header |
| * | * | Data of header |
| Bytes | Type | Description |
|---|---|---|
| (width+1)*(length+1) | unsigned short[] |
Data for height map. |
| Bytes | Type | Description |
|---|---|---|
| (width/2)*(length/2) | char[] |
Data for type map. |
| Bytes | Type | Description |
|---|---|---|
| 699048 | char[] |
raw DXT1 compressed 1024x1024 image. |
| Bytes | Type | Description |
|---|---|---|
| 4 | int |
Number of tile files |
| 4 | int |
Total number of tiles in all files. |
| Bytes | Type | Description |
|---|---|---|
| 4 | int |
Number of tiles in this file |
| size of filename | char[] |
The filename of the smt. |
| Bytes | Type | Description |
|---|---|---|
| (width / 4) * (length / 4) | int[] |
Index numbers of tiles in SMT's |
| Bytes | Type | Description |
|---|---|---|
| (width / 2) * (length / 2) | char[] |
Metal Density |
| Bytes | Type | Description |
|---|---|---|
| 4 | int |
Number of features |
| 4 | int |
Number of feature types |
| * | char[] |
List of feature names delimited by null |
| Bytes | Type | Description |
|---|---|---|
| 4 | int |
Type of feature, corresponds with feature name list. |
| 4 | float |
X Position (along the width of the map) |
| 4 | float |
Y Position (Up into the sky) |
| 4 | float |
Z Position (along the length of the map) |
| 4 | float |
rotation, not sure of scale |
| 4 | float |
relative size (not implemented); 1 |
Optional Extra Headers & data
| Bytes | Type | Description |
|---|---|---|
| 4 | int |
Size of the header; 12 |
| 4 | int |
Type of header; 1 |
| 4 | int |
Byte offset to beginning of grass map |
| (width / 4) * (length / 4) | unsigned char
|
Map defining the grass on the map. not sure what 256 available values mean. |