Mapdev:SMD: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m Flozi moved page Map Making:SMD to Mapdev:SMD: already an Enetheru page using templates
 
(53 intermediate revisions by 15 users not shown)
Line 1: Line 1:
== Maelstrom's SMD Creator ==
{{deprecated|Use of SMD is deprecated, use [[Map_Making:mapinfo.lua|mapinfo.lua]] instead!}}
Maelstrom has made a handy little SMD creating utility, which can be found in this forum thread: http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2420
This page should only be used when dealing with old maps. new maps use
[[Map_Making:mapinfo.lua|mapinfo.lua]]
= Spring Map Definition (smd) Reference =
variables are organised as such:
{{tag|range=[valid range]|special=Required}}


== SMD Syntax ==
==Source==
The SMD, to work correctly, must be set out correctly. The following are a few of these requirements that you have to follow:
The engine source code which reads this file from the map is viewable here:
*All lines must end in a ';'. This is just like any C derived programming language
*Sections begin with a keyword wrapped in [Square brackets], and are wrapped in {Curly Brackets}
*Each different tag must be placed on a different line (?)


The following are some recomendations to help other people read your SMD.
* {{sourcelink|file=rts/Map/MapInfo.cpp}}
*Blank lines are allowed, and can be placed to help distinguish between different sections
* {{sourcelink|file=rts/Map/MapParser.cpp}}
*You may place comments in the SMD, and again like C programming languages, these are preceded by a '//'. Anything following a comment marker is ignored by the parser.
*You can tabulate your SMD to help the overall readability, and to show where sections begin and end.


== Example SMD ==
= General Formatting =
* All lines must end in a semicolon.
* Sections begin with a keyword wrapped in square brackets, and are wrapped in curly brackets
* Blank lines are allowed
* Comments are preceded by // anything following a comment marker is ignored
* Whitespace is ignored so you can tabulate your SMD to help the overall readability, and to show where sections begin and end.
* The names are not case sensitive


[MAP]
<code><pre>// Example (this is a comment)
{
[MAP]
Description=Lot of metal in middle but look out for kbot walking over the mountains;
{
TidalStrength=20;
  ...
Gravity=130;
  // this is a comment
MaxMetal=0.03;
  [subsection]
  {
ExtractorRadius=400;
      ...
MapHardness=100;
      ThisIsAValue = something;
      AnotherValue = somethingelse; // another comment
      ...
  }
  ...
}</pre></code>


DetailTex=mydetailtex.bmp;
= Sections =
AutoShowMetal=1;
== MAP ==
The map section describes the basic options of the map.
[ATMOSPHERE]
<code><pre>[MAP]
{
{
Skybox=space.dds;
  // properties
  Description = "mountainous whatever";
  AutoShowMetal = 1;
  DefaultOptions = 1;
  DetailTex = detailtex.bmp;
  ExtractorRadius = 400;
  Gravity = 130;
  MapHardness = 100;
  MaxMetal = 0.03;
  TidalStrength = 20;
  voidwater = 0;
  notdeformable = 0;
  SpecularTex = speculartex.tga;
  SplatDistrTex = splatdist.tga;
  SplatDetailTex = splattex.tga;
  GrassBladeTex = grassbladetex.tga;
  GrassShadingTex = grassshading.bmp;


FogColor=0.7 0.7 0.8;
  // subsections
FogStart=0.2;
  [SMF]
  {
CloudColor=0.9 0.9 0.9;
      ...
SkyColor=0.1 0.15 0.7;
  }
  [ATMOSPHERE]
SunColor=1.0 1.0 1.0;
  {
CloudDensity=0.55;
      ...
  }
MinWind=5;
  [WATER]
MaxWind=20;
  {
}
      ...
[WATER]
  }
{
  [LIGHT]
WaterTexture=mywatertexture.jpg;
  {
WaterSurfaceColor=0.4 0.6 0.8;
      ...
WaterPlaneColor=0.4 0.6 0.8;
  }
  [TEAMx]
  {
      ...
  }
  [TERRAINTYPEx]
  {
      ...
  }
  [GRASS]
  {
      ...
  }
  [SPLATS]
  {
      ...
  }
}</pre></code>


WaterBaseColor=0.4 0.6 0.8;
{{tag|name=Description|type=string|special=Required
WaterAbsorb=0.004 0.004 0.002;
|description=The description of the map that shows in the multiplayer battleroom}}
WaterMinColor=0.1 0.1 0.3;
WaterDamage=20;
}
[LIGHT]
{
SunDir=0 1 2;
GroundAmbientColor=0.4 0.4 0.4;
GroundSunColor=0.7 0.7 0.7;
GroundShadowDensity=0.8;
UnitAmbientColor=0.3 0.3 0.3;
UnitSunColor=0.8 0.8 0.8;
UnitShadowDensity=0.8;


SpecularSunColor=0.3 0.3 0.3;
{{tag|name=AutoShowMetal|type=bool|range=[0|1]|default=1
}
|description=Defines wether the metal map (F4 mode) is shown automatically when a mex is queued for placement}}
[TEAM0]
{
StartPosX=600;
StartPosZ=600;
}
[TEAM1]
{
StartPosX=3600;
StartPosZ=3600;
}
[TEAM2]
{
StartPosX=3600;
StartPosZ=600;
}
[TEAM3]
{
StartPosX=600;
StartPosZ=3600;
}
[TEAM4]
{
StartPosX=2000;
StartPosZ=600;
}
[TEAM5]
{
StartPosX=2000;
StartPosZ=3600;
}
//Up to [TEAM9]
[TERRAINTYPE0]
{
name=default;
hardness=1;
tankmovespeed=1;
kbotmovespeed=1;
hovermovespeed=1;
shipmovespeed=1;
}
}


== SMD Tags List ==
{{tag|name=DefaultOptions|type=bool|range=[0|1]}}
<table border="1">
  <tr>
    <th valign="top" bgcolor="#C0C0C0">Variable</th>
    <th valign="top" bgcolor="#C0C0C0">Description</th>
    <th valign="top" bgcolor="#C0C0C0">Examples</th>
  </tr>
  <tr>
    <td valign="top">'''[TEAM''X'']'''</td>
    <td valign="top">The number of the team, starting at 0 for player 1 and going on up to 9 for player 10, where ''X'' is the player number</td>
    <td valign="top">[TEAM3]</td>
  </tr>
  <tr>
    <td valign="top">'''[TERRAINTYPE''X'']'''</td>
    <td valign="top">Used to define different terrain types that exist on the map. The value starts at 0 and goes on for as many terrain types as you have, where ''X'' is the type number. Which terrain type goes where on the map is determined by the typemap when compiling the map.</td>
    <td valign="top">[TERRAINTYPE0]</td>
  </tr>
  <tr>
    <td valign="top">'''AutoShowMetal'''</td>
    <td valign="top">A boolean, turning it off makes it so the user must press F4 to view the metal map, leaving it on will make it so the metal map is turned on whenever they choose to build a metal extractor.</td>
    <td valign="top">AutoShowMetal=0;</td>
  </tr>


  <tr>
{{tag|name=DetailTex|type=string|
    <td valign="top">'''CloudColor'''</td>
|description=Specifies the detail texture for the map, for examples and a library, see this sticky thread: [[http://springrts.com/phpbb/viewtopic.php?f=56&t=21565]]}}
    <td valign="top">The color of the clouds. The values are in the order Red, Green, Blue. For all intensive purposes, 0.0 is black and 1.0 is white; however, giving values higher than 1.0 will give brighter fog and less than 0.0 will give darker.</td>
    <td valign="top">CloudColor=0.9 0.9 0.9;</td>
  </tr>
  <tr>
    <td valign="top">'''CloudDensity'''</td>


    <td valign="top">The number of clouds in the sky. A percentage in decimal form, 0.0 to 1.0.</td>
{{tag|name=ExtractorRadius|type=float|range=[0-max]|default=500
    <td valign="top">CloudDensity=0.55;</td>
|description=The radius of effect that a single extractor will extract from. If two radii intersect, both extractors will suffer from reduced output}}
  </tr>
  <tr>
    <td valign="top">'''Description'''</td>
    <td valign="top">The description of the map that shows in the multiplayer battleroom.</td>
    <td valign="top">Description=Strong wind, good for 2v2 team games;</td>


  </tr>
{{tag|name=Gravity|type=float|range=[0.0-max]|default=130
  <tr>
|description=The force of gravity in units/sec^2}}
    <td valign="top">'''DetailTex'''</td>
    <td valign="top">The texture which will be shown on the map in the color of the texture map when a player zooms very far in. Leaving this blank will make the game default to detailtex2.bmp. It is assumed you can only use the bitmap format for these textures.</td>
    <td valign="top">DetailTex=mydetailtex.bmp;</td>
  </tr>


  <tr>
{{tag|name=MapHardness|type=float|default=100
    <td valign="top">'''ExtractorRadius'''</td>
|description=Defines how much a map will deform from impacts. Higher values mean less deformation, negative values will result in negative deformation (really funny looking)}}
    <td valign="top">The radius of effect that a single extractor will extract from. If two radii intersect, both extractors will suffer from reduced output.</td>
    <td valign="top">ExtractorRadius=400;</td>
  </tr>
  <tr>


    <td valign="top">'''GroundAmbientColor'''</td>
{{tag|name=MaxMetal|type=float|range=[0.0-max]|default=0.02
    <td valign="top">The ambient (non-sun-lit) color of ground, grass, trees and other features.</td>
|description=How much metal a map square with the maximum metal value gives}}
    <td valign="top">GroundAmbientColor=0.4 0.4 0.4;</td>
  </tr>
  <tr>
    <td valign="top">'''GroundShadowDensity'''</td>
    <td valign="top">How far from the non shadowed to the ambient color stuff in shadow will go.</td>


    <td valign="top">GroundShadowDensity=0.8;</td>
{{tag|name=TidalStrength|type=float|range=[0,max]|default=0
  </tr>
|description=The amount of energy which will be given by tidal generators}}
  <tr>
    <td valign="top">'''GroundSunColor'''</td>
    <td valign="top">The color of ground where it is fully sun lit (added to <i>GroundAmbientColor</i>).</td>
    <td valign="top">GroundSunColor=0.7 0.7 0.7;</td>


  </tr>
{{tag|name=voidwater|type=bool|range=[0|1]|default=0
  <tr>
|description=Voidwater means there will be no water plane, and all parts of the map under water will be completely transparent, to show the skybox through the map. For example, check Apophis_v2 : http://springrts.com/phpbb/viewtopic.php?f=13&t=20684&hilit=apophis}}
    <td valign="top">'''FogColor'''</td>
    <td valign="top">The color of the fog and the infinite plane below the world. The values are in the order Red, Green, Blue. For all intensive purposes, 0.0 is black and 1.0 is white; however, giving values higher than 1.0 will give brighter fog and less than 0.0 will give darker.</td>
    <td valign="top">FogColor=0.7 0.7 0.8;</td>
  </tr>
  <tr>


    <td valign="top">'''FogStart'''</td>
{{tag|name=notdeformable|type=bool|range=[0|1]|default=0
    <td valign="top">The distance from the camera at which the fog will start.</td>
|description=Setting it to 1 means that no explosions can deform the map}}
    <td valign="top">FogStart=0.2;</td>
  </tr>
  <tr>
    <td valign="top">'''Hardness (terraintype)'''</td>
    <td valign="top">Used as a multiplier against the <i>MapHardness</i> value. Can be used to make a particular terrain type softer or harder. A value of '1' will make it as hard as <i>MapHardness</i>, and 0.5 will make it half as hard.</td>


    <td valign="top">hardness=0.75;</td>
{{tag|name=SpecularTex|type=string}}
  </tr>
  <tr>
    <td valign="top">'''HoverNoveSpeed'''</td>
    <td valign="top">Speed multiplier for hovercraft when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type.</td>
    <td valign="top">hovermovespeed=1;</td>
  </tr>


  <tr>
{{tag|name=SplatDistrTex|type=string}}
    <td valign="top">'''KbotMoveSpeed'''</td>
    <td valign="top">Speed multiplier for Kbots when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type.</td>
    <td valign="top">kbotmovespeed=1;</td>
  </tr>
  <tr>
    <td valign="top">'''MapHardness'''</td>
    <td valign="top">Defines how much the terrain will deform due to explosions and weapons.</td>
    <td valign="top">MapHardness=100;</td>
  </tr>
  <tr>
    <td valign="top">'''MaxMetal'''</td>
    <td valign="top">How much metal a map square with the maximum metal value gives. Unsure how this is calculated, but a value of around 0.03 will give OTA-esque levels of metal from metal extractors.</td>
    <td valign="top">MaxMetal=0.03;</td>


  </tr>
{{tag|name=SplatDetailTex|type=string}}
  <tr>
    <td valign="top">'''MaxWind'''</td>
    <td valign="top">The maximum amount of energy the wind on the map will give.</td>
    <td valign="top">MaxWind=20;</td>
  </tr>
  <tr>


    <td valign="top">'''MinWind'''</td>
{{tag|name=GrassBladeTex|type=string
    <td valign="top">The minimum amount of energy the wind on the map will give.</td>
|description=Specifies the texture to be used on the grass blades themselves. Green-yellow gradients make for some interesting effects. Defaults to the internally generated blade texture}}
    <td valign="top">MinWind=5;</td>
  </tr>
  <tr>
    <td valign="top">'''Name (terraintype)'''</td>
    <td valign="top">Used to define the name of the type of terrain. "Snow" or "Rock" or whatever you want.</td>
    <td valign="top">Name=default;</td>
  </tr>
  <tr>
    <td valign="top">'''ShipMoveSpeed'''</td>
    <td valign="top">Speed multiplier for Ship when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type.</td>
    <td valign="top">shipmovespeed=1;</td>
  </tr>
  <tr>
    <td valign="top">'''SkyBox'''</td>
    <td valign="top">The image to display in the sky during gameplay, rather than having the engine dynamically render one. This allows for complex skies, which may include stars, planets, etc overhead. Skyboxes are stored as .DDS cubeboxes. A skybox's .dds file should be placed in the maps directory of a compressed file, along with the .smf, .smd, and .smt files.</td>
    <td valign="top">Skybox=space.dds;</td>
  </tr>


  <tr>
{{tag|name=GrassShadingTex|type=string
    <td valign="top">'''SkyColor'''</td>
|description=Specifies the color variation of the grass across the map. This defaults to the minimap, so the grass color can match the map color}}
    <td valign="top">The color of the sky itself. Works the same way as <i>CloudColor</i> and <i>FogColor</i>.</td>
    <td valign="top">SkyColor=0.1 0.15 0.7;</td>
  </tr>
  <tr>
    <td valign="top">'''SpecularSunColor'''</td>
    <td valign="top">The color of the reflected light off of stuff (otherwise will be UnitSunColor)</td>
    <td valign="top">SpecularSunColor=0.1 0.15 0.7;</td>
  </tr>


  <tr>
== SMF ==
    <td valign="top">'''StartPosX'''</td>
<code><pre>[MAP]
    <td valign="top">The X (east-west in the TA camera) coordinates on the map where the player will start.</td>
{
    <td valign="top">StartPosX=600;</td>
  ...
  </tr>
  [SMF]
  <tr>
  {
    <td valign="top">'''StartPosZ'''</td>
      MinHeight = -100;
      MaxHeight = 100;
  }
  ...
}</pre></code>
{{tag|name=MinHeight|type=float|default=0
|description=Overrides the minimum map height specified while compiling. Compile time height used if undefined}}


    <td valign="top">The Z (north-south in the TA camera) coordinates on the map where the player will start.</td>
{{tag|name=MaxHeight|type=float|default=0
    <td valign="top">StartPosZ=600;</td>
|description=Overrides the maximum map height specified while compiling. Compile time height used if undefined}}
  </tr>
  <tr>
    <td valign="top">'''SunColor'''</td>
    <td valign="top">The color of the sun in the sky. This will also effect the size of the star. As the value increases (including over 1.0), the disc will get bigger; the inverse is also true.</td>
    <td valign="top">SunColor=1.0 1.0 1.0;</td>


  </tr>
  <tr>
    <td valign="top">'''SunDir'''</td>
    <td valign="top">The direction of the sun, which is normalized by Spring. The Y-axis is up. In the following chart, using the values in a square will make shadows fall in that square if the shadow caster (like a unit) is placed in the center. ie: you use the values from the top-left (North-West) corner box, shadows will be cast in a North-Westerly direction:
      <center>[[Image:ShadowDirection.gif]]</center>
    </td>
    <td valign="top">SunDir=0 1 2;</td>
  </tr>


  <tr>
== ATMOSPHERE ==
    <td valign="top">'''TankMoveSpeed'''</td>
<code><pre>[MAP]
    <td valign="top">Speed multiplier for tanks when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type.</td>
{
    <td valign="top">tankmovespeed=1;</td>
  ...
  </tr>
  [ATMOSPHERE]
  <tr>
  {
    <td valign="top">'''TidalStrength'''</td>
      CloudColor = 0.9 0.9 0.9;
    <td valign="top">The amount of energy which will be given by tidal generators.</td>
      CloudDensity = 0.25;
    <td valign="top">TidalStrength=30;</td>
      FogColor = 0.7 0.7 0.8;
  </tr>
      FogStart = 0.48;
  <tr>
      MinWind = 1;
    <td valign="top">'''UnitAmbientColor'''</td>
      MaxWind = 25;
    <td valign="top">The ambient (non-sun-lit) color of units and corpses.</td>
      SkyBox = nebulus.dds;
    <td valign="top">UnitAmbientColor=0.3 0.3 0.3;</td>
      SkyColor = 0.1 0.15 0.7;
      SunColor = 1.0 1.0 1.0;
  }
  ...
}</pre></code>
{{tag|name=CloudColor|type=rgb|default=1.0 1.0 1.0
|description=The color of the clouds. The values are in the order Red, Green, Blue}}


  </tr>
{{tag|name=CloudDensity|type=float|range=[0.0-max]|default=0.5
  <tr>
|description=The number of clouds in the sky. A percentage in decimal form, 0.0 to 1.0.}}
    <td valign="top">'''UnitShadowDensity'''</td>
    <td valign="top">How far from the non shadowed to the ambient color stuff in shadow will go.</td>
    <td valign="top">UnitShadowDensity=0.8;</td>
  </tr>
  <tr>


    <td valign="top">'''UnitSunColor'''</td>
{{tag|name=FogColor|type=rgb|default=0.7 0.7 0.8
    <td valign="top">The color of units where they is fully sun lit (added to <i>UnitAmbientColor</i>).</td>
|description=The color of the fog and the infinite plane below the world. The values are in the order Red, Green, Blue. However, giving values higher than 1.0 will give brighter fog and less than 0.0 will give darker}}
    <td valign="top">UnitSunColor=0.8 0.8 0.8;</td>
  </tr>
  <tr>
    <td valign="top">'''WaterAbsorb'''</td>
    <td valign="top">How fast different colors (RGB in order) are absorbed by the water. Can be used to make the water look murky at deeper sections and so on.</td>
    <td valign="top">WaterAbsorb=0.004 0.004 0.002;</td>
  </tr>
  <tr>
    <td valign="top">'''WaterBaseColor'''</td>
    <td valign="top">The color of the water at the surface.</td>
    <td valign="top">WaterBaseColor=0.4 0.6 0.8;</td>


  </tr>
{{tag|name=FogStart|type=float|default=0.1
  <tr>
|description=The distance from the camera at which the fog will start}}
    <td valign="top">'''WaterDamage'''</td>
    <td valign="top">Amount of damage water does to units in it. Someone add the value that make water impassable (like lava) and the rate at which damage is applied. It is assumed for now that it does WaterDamage per 30 internal frames.</td>
    <td valign="top">WaterDamage=20;</td>


  </tr>
{{tag|name=MinWind|type=float|range=[0.0-max]|default=5.0
  <tr>
|description=The minimum amount of energy the wind on the map will give}}
    <td valign="top">'''WaterMinColor'''</td>
    <td valign="top">The smallest values the water will go down to due to <i>WaterAbsorb</i>.</td>
    <td valign="top">WaterMinColor=0.1 0.1 0.3;</td>
  </tr>
  <tr>
    <td valign="top">'''WaterSurfaceColor'''</td>
    <td valign="top">Changes the surface color of the water (mother thinks this is an XOR thing with WaterTexture. WaterTexture is for non-reflective water and WaterSurfaceColor only for reflective water)</td>
    <td valign="top">WaterMinColor=0.1 0.1 0.3;</td>
  </tr>


  <tr>
{{tag|name=MaxWind|type=float|range=[0.0-max]|default=25.0
    <td valign="top">'''WaterPlaneColor'''</td>
|description=The maximum amount of energy the wind on the map will give}}
    <td valign="top">The color of the 'water plane' outside the map's bounds</td>
    <td valign="top">WaterPlaneColor=0.1 0.1 0.3;</td>
  </tr>


{{tag|name=SkyBox|type=string
|description=Specify a .dds skybox (also called skycube) for examples and resources see: [[http://springrts.com/phpbb/viewtopic.php?f=56&t=11009]]}}


  <tr>
{{tag|name=SkyColor|type=rgb|default=0.1 0.15 0.7
    <td valign="top">'''WaterTexture'''</td>
|description=The color of the sky itself. The values are in the order Red, Green, Blue}}
    <td valign="top">Replaces the default ocean texture with the one specified. Must apparently be jpeg format, though bitmap might work.</td>
    <td valign="top">WaterTexture=mywatertexture.jpg;</td>
  </tr>


{{tag|name=SunColor|type=rgb|default=1 1 1
|description=The color of the sun in the sky. The values are in the order Red, Green, Blue. This will also effect the size of the star. As the values increase (including over 1.0), the disc will get bigger; the inverse is also true}}


</table>
== LIGHT ==
<code><pre>[MAP]
{
  ...
  [LIGHT]
  {
      GroundAmbientColor=0.6 0.6 0.6;
      GroundSunColor=0.9 0.9 0.9;
      GroundShadowDensity=0.6;
      GroundSpecularColor=0 0 0;
      UnitAmbientColor=0.6 0.6 0.6;
      UnitSunColor=0.93 0.93 0.93;
      UnitShadowDensity=0.8;
      UnitSpecularColor=0 0 0;
      SunDir=2 1 1;
  }
  ...
}</pre></code>
{{tag|name=GroundAmbientColor|type=rgb|default=0.5 0.5 0.5
|description=The ambient (non-sun-lit) color of ground, grass, trees and other features. The values are in the order Red, Green, Blue}}
 
{{tag|name=GroundSunColor|type=rgb|default=0.5 0.5 0.5
|description=The color of ground where it is fully sun lit (added to GroundAmbientColor). The values are in the order Red, Green, Blue}}
 
{{tag|name=GroundShadowDensity|type=float|default=0.8
|description=How far from the non shadowed to the ambient color stuff in shadow will go}}
 
{{tag|name=GroundSpecularColor|type=rgb|default=0.1 0.1 0.1}}
 
{{tag|name=UnitAmbientColor|type=rgb|default=0.4 0.4 0.4
|description=The ambient (non-sun-lit) color of units and corpses. The values are in the order Red, Green, Blue}}
 
{{tag|name=UnitSunColor|type=rgb
|description=The color of units where they is fully sun lit (added to UnitAmbientColor). The color of units where they is fully sun lit (added to UnitAmbientColor). The values are in the order Red, Green, Blue}}
 
{{tag|name=UnitShadowDensity|type=float|default=0.8
|description=How far from the non shadowed to the ambient color stuff in shadow will go}}
 
{{tag|name=UnitSpecularColor|type=rgb|default=0.7 0.7 0.7}}
 
{{tag|name=SunDir|type=float[3]||default=0.0 1.0 2.0
|description=The direction of the sun, which is normalized by Spring. The Y-axis is up}}
 
== WATER ==
<code><pre>[MAP]
{
  ...
  [WATER]
  {
      // basic options
      WaterSurfaceColor=0.3 0.3 0.4;
      WaterBaseColor=0.4 0.6 0.8;
      WaterAbsorb=0.004 0.004 0.002;
      WaterMinColor=0.1 0.1 0.3;
      WaterPlaneColor= 0.1 0.1 0.3;
      WaterDamage=0;
 
      // bump mapped Water Settings
      WaterSurfaceAlpha = 0.55;
      WaterDiffuseColor = 0.55 0.4 0.3;
      WaterSpecularColor = 0.55 0.4 0.3;
      WaterSpecularPower = 2.0;
      WaterSpecularFactor = 0.3;
      WaterAmbientFactor = 1.3;
      WaterDiffuseFactor = 0.3;
      WaterFresnelMin = 0.3;
      WaterFresnelMax = 0.8;
      WaterFresnelPower = 4;
      WaterReflectionDistortion = 0.1;
      WaterBlurBase = 2;
      WaterBlurExponent = 2;
      WaterPerlinStartFreq = 8;
      WaterPerlinLacunarity = 3;
      WaterPerlinAmplitude= 0.9
  }
  ...
}</pre></code>
{{tag|name=WaterSurfaceColor|type=rgb|default=0.75 0.8 0.85
|description=The color of the water surface. The values are in the order Red, Green, Blue. Mostly affects the colors of the reflections off the top of the water. Has no effect on bump mapped water!}}
 
{{tag|name=WaterBaseColor|type=rgb|default=0.0 0.0 0.0
|description=The color of the water just beneath the surface plane. This is the starting color from which deeper waters will absorb more color. The values are in the order Red, Green, Blue}}
 
{{tag|name=WaterAbsorb|type=rgb|default=0.0 0.0 0.0
|description=How fast different colors (RGB in order) are absorbed by the water. Can be used to make the water look murky at deeper sections and so on. How this works: the waterabsorb value for the color channel gets multiplied by the depth of the water at a point, and this product gets subtracted from WaterBaseColor, until WaterMinColor is reached. Example: WaterAbsorb is 0.01, for the red channel, and we want to know how much red will be left in the water at a Spring elevation of -100, since 0.01*100= 1 , at this depth, there will be no more red component in the water, unless WaterMinColor is higher than 0 on the red channel}}
 
{{tag|name=WaterMinColor|type=rgb|default=0.0 0.0 0.0
|description=The smallest values the water will go down to due to WaterAbsorb}}
 
{{tag|name=WaterPlaneColor|type=rgb|default=0.0 0.4 0.0
|description=This set the color of the groundplane under the water outside the map boundaries}}
 
{{tag|name=WaterDamage|type=float|default=0.0
|description=Number of hit points per game frame (30 frames per second) a unit will be damaged if it is in the water}}
 
{{tag|name=WaterSurfaceAlpha|type=float|default=0.55
|description=Transparency of the water surface. 0 meaning almost fully transparent water plane(low amount of reflections visible), and 1 being nearly opaque (massive amount of reflections)}}
 
{{tag|name=WaterDiffuseColor|type=rgb
|description=This specifies the diffuse color of the water body. WARNING: use of this tag disables the effect of WaterAbsorb , in fact, this tag does nothing but disable WaterAbsorb. Avoid}}
 
{{tag|name=WaterSpecularColor|type=rgb|default=0.5 0.5 0.5}}
 
{{tag|name=WaterSpecularPower|type=float|default=20
|description=use of this tag disables the effect of WaterAbsorb}}
 
{{tag|name=WaterSpecularFactor|type=float|default=1.0}}
 
{{tag|name=WaterAmbientFactor|type=float|default=1.0}}
 
{{tag|name=WaterDiffuseFactor|type=float|default=1.0}}
 
{{tag|name=WaterFresnelMin|type=float|default=0.2}}
 
{{tag|name=WaterFresnelMax|type=float|default=0.3}}
 
{{tag|name=WaterFresnelPower|type=float|default=4.0}}
 
{{tag|name=WaterReflectionDistortion|type=float|default=1.0
|description=How much the surface should distort reflections that are cause by waves not being level: ergo it adds more choppyness to your reflections sensible from 0 to 20}}
 
{{tag|name=WaterBlurBase|type=float|default=2.0
|description=Something to do with blur, but it just seems to cause banding with values under 2 and corruption with values above 10}}
 
{{tag|name=WaterBlurExponent|type=float|default=1.5
|description=How much reflections on water surface should be blurred together with the water surface, lower values meaning clearer reflections, (0.2-5) Warning: above 5 seems to cause water corruption}}
 
{{tag|name=WaterPerlinStartFreq|type=float|default=8
|description=Wave sizes, smaller = big waves, sensible: [1,20] (influence the wave sizes)}}
 
{{tag|name=WaterPerlinLacunarity|type=float||default:3.0
|description=Defines the size of the perlin waves, small values being big waves ([0.2,5] is sensible)}}
 
{{tag|name=WaterPerlinAmplitude|type=float|default:0.9
|description=Base stillness of water surface, 0 is dead still, 1 is 'windy' .This doesnt affect the bump texture depth, besides the fact that this disables the bump texture when set to 0}}
 
== TEAMx ==
Is used to describe the starting positions of the players.
<code><pre>[MAP]
{
  ...
  [TEAM0]
  {
      StartPosX=730;
      StartPosZ=821;
  }
  [TEAM1]
  {
      ...
  }
  [TEAMn]
  {
      ...
  }
  ...
}</pre></code>
{{tag|name=StartPosX|type=int|range=[0-map width]|
|description=The X (east-west in the TA camera) coordinates on the map where the player will start}}
 
{{tag|name=StartPosZ|type=int|range=[0-map length]
|description=The Z (north-south in the TA camera) coordinates on the map where the player will start}}
 
== TERRAINTYPEx ==
Used to define different terrain types that exist on the map. The value starts at 0 and goes on for as many terrain types as you have, where X is the type number. Which terrain type goes where on the map is determined by the typemap when compiling the map. For example, if the typemap has an area of red 128, then the corresponding terraintype tag is [TERRAINTYPE128]
<code><pre>[MAP]
{
  ...
  [TERRAINTYPE0]
  {
      name = my terrain type;
      hardness = 1;
      recievetracks = 0;
      tankmovespeed = 1;
      kbotmovespeed = 1;
      hovermovespeed = 1;
      shipmovespeed = 1;
  }
  [TERRAINTYPE1]
  {
      ...
  }
  [TERRAINTYPEn]
  {
      ...
  }
  ...
}</pre></code>
{{tag|name=name|type=string
|description=A label for the terrain type}}
 
{{tag|name=hardness|type=float|range=[0.001-max]|default=1.0
|description=Used as a multiplier against the [MAP].MapHardness value. Can be used to make a particular terrain type softer or harder. A value of '1' will make it as hard as MapHardness, and 0.5 will make it half as hard}}
 
{{tag|name=recievetracks|type=bool|range=[0|1]|default=1
|description=Effects whether track decals will be placed on the ground from moving vehicles}}
 
{{tag|name=tankmovespeed|type=float|default=1.0
|description=Speed multiplier for tanks when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type. '''All move speeds are clamped to [0,2]'''}}
 
{{tag|name=kbotmovespeed|type=float|default=1.0
|description=Speed multiplier for Kbots when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type}}
 
{{tag|name=hovermovespeed|type=float|default=1.0
|description=Speed multiplier for hovercraft when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type}}
 
{{tag|name=shipmovespeed|type=float|default=1.0
|description=Speed multiplier for Ship when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type}}
 
== GRASS ==
<code><pre>[MAP]
{
  ...
  [GRASS]
  {
      GrassBladeWaveScale = 1.0;
      GrassBladeWidth = 0.32;
      GrassBladeHeight = 4;
      GrassBladeAngle = 1.57;
  }
  ...
}</pre></code>
{{tag|name=GrassBladeWaveScale|type=float|default=1.0
|description=Specifies how much the wind should effect grass blade movement, as well as the amplitude of the grass motion. Setting it to 0 will stop grass animation}}
 
{{tag|name=GrassBladeWidth|type=float|default=0.32
|description=Specifies the width of each blade of grass}}
 
{{tag|name=GrassBladeHeight|type=float|default=4.0
|description=Specifies the length of each blade of grass}}
 
{{tag|name=GrassBladeAngle|type=float|default=1.57
|description=Unit is radians. Specifies the curvature of each blade of grass. Zero means a completely straight blades of grass}}
 
== SPLATS ==
<code><pre>[MAP]
{
  ...
  [SPLATS]
  {
      SplatTexScales = 1.0 1.0 1.0 1.0;
      SplatTexMults = 1.0 1.0 1.0 1.0;
  }
  ...
}</pre></code>
{{tag|name=SplatTexScales|type=float[3]}}
 
{{tag|name=SplatTexMults|type=float[3]}}
[[Category:Map Dev]]

Latest revision as of 09:57, 19 October 2014

Use of SMD is deprecated, use mapinfo.lua instead!


This page should only be used when dealing with old maps. new maps use mapinfo.lua

Spring Map Definition (smd) Reference

variables are organised as such: type name  default: ? range: [valid range] Required

FIXME:

Source

The engine source code which reads this file from the map is viewable here:

General Formatting

  • All lines must end in a semicolon.
  • Sections begin with a keyword wrapped in square brackets, and are wrapped in curly brackets
  • Blank lines are allowed
  • Comments are preceded by // anything following a comment marker is ignored
  • Whitespace is ignored so you can tabulate your SMD to help the overall readability, and to show where sections begin and end.
  • The names are not case sensitive
// Example (this is a comment)
[MAP]
{
   ...
   // this is a comment
   [subsection]
   {
      ...
      ThisIsAValue = something;
      AnotherValue = somethingelse; // another comment
      ...
   }
   ...
}

Sections

MAP

The map section describes the basic options of the map.

[MAP]
{
   // properties
   Description = "mountainous whatever";
   AutoShowMetal = 1;
   DefaultOptions = 1;
   DetailTex = detailtex.bmp;
   ExtractorRadius = 400;
   Gravity = 130;
   MapHardness = 100;
   MaxMetal = 0.03;
   TidalStrength = 20;
   voidwater = 0;
   notdeformable = 0;
   SpecularTex = speculartex.tga;
   SplatDistrTex = splatdist.tga;
   SplatDetailTex = splattex.tga;
   GrassBladeTex = grassbladetex.tga;
   GrassShadingTex = grassshading.bmp;

   // subsections
   [SMF]
   {
      ...
   }
   [ATMOSPHERE]
   {
      ...
   }
   [WATER]
   {
      ...
   }
   [LIGHT]
   {
      ...
   }
   [TEAMx]
   {
      ...
   }
   [TERRAINTYPEx]
   {
      ...
   }
   [GRASS]
   {
      ...
   }
   [SPLATS]
   {
      ...
   }
}

string Description  default: ? Required

The description of the map that shows in the multiplayer battleroom

bool AutoShowMetal  default: 1 range: [0 

Defines wether the metal map (F4 mode) is shown automatically when a mex is queued for placement

bool DefaultOptions  default: ? range: [0 

FIXME:

string DetailTex  default: ? 

Specifies the detail texture for the map, for examples and a library, see this sticky thread: [[1]]

float ExtractorRadius  default: 500 range: [0-max] 

The radius of effect that a single extractor will extract from. If two radii intersect, both extractors will suffer from reduced output

float Gravity  default: 130 range: [0.0-max] 

The force of gravity in units/sec^2

float MapHardness  default: 100 

Defines how much a map will deform from impacts. Higher values mean less deformation, negative values will result in negative deformation (really funny looking)

float MaxMetal  default: 0.02 range: [0.0-max] 

How much metal a map square with the maximum metal value gives

float TidalStrength  default: 0 range: [0,max] 

The amount of energy which will be given by tidal generators

bool voidwater  default: 0 range: [0 

Voidwater means there will be no water plane, and all parts of the map under water will be completely transparent, to show the skybox through the map. For example, check Apophis_v2 : http://springrts.com/phpbb/viewtopic.php?f=13&t=20684&hilit=apophis

bool notdeformable  default: 0 range: [0 

Setting it to 1 means that no explosions can deform the map

string SpecularTex  default: ? 

FIXME:

string SplatDistrTex  default: ? 

FIXME:

string SplatDetailTex  default: ? 

FIXME:

string GrassBladeTex  default: ? 

Specifies the texture to be used on the grass blades themselves. Green-yellow gradients make for some interesting effects. Defaults to the internally generated blade texture

string GrassShadingTex  default: ? 

Specifies the color variation of the grass across the map. This defaults to the minimap, so the grass color can match the map color

SMF

[MAP]
{
   ...
   [SMF]
   {
      MinHeight = -100;
      MaxHeight = 100;
   }
   ...
}

float MinHeight  default: 0 

Overrides the minimum map height specified while compiling. Compile time height used if undefined

float MaxHeight  default: 0 

Overrides the maximum map height specified while compiling. Compile time height used if undefined


ATMOSPHERE

[MAP]
{
   ...
   [ATMOSPHERE]
   {
      CloudColor = 0.9 0.9 0.9;
      CloudDensity = 0.25;
      FogColor = 0.7 0.7 0.8;
      FogStart = 0.48;
      MinWind = 1;
      MaxWind = 25;
      SkyBox = nebulus.dds;
      SkyColor = 0.1 0.15 0.7;
      SunColor = 1.0 1.0 1.0;
   }
   ...
}

rgb CloudColor  default: 1.0 1.0 1.0 

The color of the clouds. The values are in the order Red, Green, Blue

float CloudDensity  default: 0.5 range: [0.0-max] 

The number of clouds in the sky. A percentage in decimal form, 0.0 to 1.0.

rgb FogColor  default: 0.7 0.7 0.8 

The color of the fog and the infinite plane below the world. The values are in the order Red, Green, Blue. However, giving values higher than 1.0 will give brighter fog and less than 0.0 will give darker

float FogStart  default: 0.1 

The distance from the camera at which the fog will start

float MinWind  default: 5.0 range: [0.0-max] 

The minimum amount of energy the wind on the map will give

float MaxWind  default: 25.0 range: [0.0-max] 

The maximum amount of energy the wind on the map will give

string SkyBox  default: ? 

Specify a .dds skybox (also called skycube) for examples and resources see: [[2]]

rgb SkyColor  default: 0.1 0.15 0.7 

The color of the sky itself. The values are in the order Red, Green, Blue

rgb SunColor  default: 1 1 1 

The color of the sun in the sky. The values are in the order Red, Green, Blue. This will also effect the size of the star. As the values increase (including over 1.0), the disc will get bigger; the inverse is also true

LIGHT

[MAP]
{
   ...
   [LIGHT]
   {
      GroundAmbientColor=0.6 0.6 0.6;
      GroundSunColor=0.9 0.9 0.9;
      GroundShadowDensity=0.6;
      GroundSpecularColor=0 0 0;
      UnitAmbientColor=0.6 0.6 0.6;
      UnitSunColor=0.93 0.93 0.93;
      UnitShadowDensity=0.8;
      UnitSpecularColor=0 0 0;
      SunDir=2 1 1;
   }
   ...
}

rgb GroundAmbientColor  default: 0.5 0.5 0.5 

The ambient (non-sun-lit) color of ground, grass, trees and other features. The values are in the order Red, Green, Blue

rgb GroundSunColor  default: 0.5 0.5 0.5 

The color of ground where it is fully sun lit (added to GroundAmbientColor). The values are in the order Red, Green, Blue

float GroundShadowDensity  default: 0.8 

How far from the non shadowed to the ambient color stuff in shadow will go

rgb GroundSpecularColor  default: 0.1 0.1 0.1 

FIXME:

rgb UnitAmbientColor  default: 0.4 0.4 0.4 

The ambient (non-sun-lit) color of units and corpses. The values are in the order Red, Green, Blue

rgb UnitSunColor  default: ? 

The color of units where they is fully sun lit (added to UnitAmbientColor). The color of units where they is fully sun lit (added to UnitAmbientColor). The values are in the order Red, Green, Blue

float UnitShadowDensity  default: 0.8 

How far from the non shadowed to the ambient color stuff in shadow will go

rgb UnitSpecularColor  default: 0.7 0.7 0.7 

FIXME:

float[3] SunDir  default: 0.0 1.0 2.0 

The direction of the sun, which is normalized by Spring. The Y-axis is up

WATER

[MAP]
{
   ...
   [WATER]
   {
      // basic options
      WaterSurfaceColor=0.3 0.3 0.4;
      WaterBaseColor=0.4 0.6 0.8;
      WaterAbsorb=0.004 0.004 0.002;
      WaterMinColor=0.1 0.1 0.3;
      WaterPlaneColor= 0.1 0.1 0.3;
      WaterDamage=0;

      // bump mapped Water Settings
      WaterSurfaceAlpha = 0.55;
      WaterDiffuseColor = 0.55 0.4 0.3;
      WaterSpecularColor = 0.55 0.4 0.3;
      WaterSpecularPower = 2.0;
      WaterSpecularFactor = 0.3;
      WaterAmbientFactor = 1.3;
      WaterDiffuseFactor = 0.3;
      WaterFresnelMin = 0.3;
      WaterFresnelMax = 0.8;
      WaterFresnelPower = 4;
      WaterReflectionDistortion = 0.1;
      WaterBlurBase = 2;
      WaterBlurExponent = 2;
      WaterPerlinStartFreq = 8;
      WaterPerlinLacunarity = 3;
      WaterPerlinAmplitude= 0.9
   }
   ...
}

rgb WaterSurfaceColor  default: 0.75 0.8 0.85 

The color of the water surface. The values are in the order Red, Green, Blue. Mostly affects the colors of the reflections off the top of the water. Has no effect on bump mapped water!

rgb WaterBaseColor  default: 0.0 0.0 0.0 

The color of the water just beneath the surface plane. This is the starting color from which deeper waters will absorb more color. The values are in the order Red, Green, Blue

rgb WaterAbsorb  default: 0.0 0.0 0.0 

How fast different colors (RGB in order) are absorbed by the water. Can be used to make the water look murky at deeper sections and so on. How this works: the waterabsorb value for the color channel gets multiplied by the depth of the water at a point, and this product gets subtracted from WaterBaseColor, until WaterMinColor is reached. Example: WaterAbsorb is 0.01, for the red channel, and we want to know how much red will be left in the water at a Spring elevation of -100, since 0.01*100= 1 , at this depth, there will be no more red component in the water, unless WaterMinColor is higher than 0 on the red channel

rgb WaterMinColor  default: 0.0 0.0 0.0 

The smallest values the water will go down to due to WaterAbsorb

rgb WaterPlaneColor  default: 0.0 0.4 0.0 

This set the color of the groundplane under the water outside the map boundaries

float WaterDamage  default: 0.0 

Number of hit points per game frame (30 frames per second) a unit will be damaged if it is in the water

float WaterSurfaceAlpha  default: 0.55 

Transparency of the water surface. 0 meaning almost fully transparent water plane(low amount of reflections visible), and 1 being nearly opaque (massive amount of reflections)

rgb WaterDiffuseColor  default: ? 

This specifies the diffuse color of the water body. WARNING: use of this tag disables the effect of WaterAbsorb , in fact, this tag does nothing but disable WaterAbsorb. Avoid

rgb WaterSpecularColor  default: 0.5 0.5 0.5 

FIXME:

float WaterSpecularPower  default: 20 

use of this tag disables the effect of WaterAbsorb

float WaterSpecularFactor  default: 1.0 

FIXME:

float WaterAmbientFactor  default: 1.0 

FIXME:

float WaterDiffuseFactor  default: 1.0 

FIXME:

float WaterFresnelMin  default: 0.2 

FIXME:

float WaterFresnelMax  default: 0.3 

FIXME:

float WaterFresnelPower  default: 4.0 

FIXME:

float WaterReflectionDistortion  default: 1.0 

How much the surface should distort reflections that are cause by waves not being level: ergo it adds more choppyness to your reflections sensible from 0 to 20

float WaterBlurBase  default: 2.0 

Something to do with blur, but it just seems to cause banding with values under 2 and corruption with values above 10

float WaterBlurExponent  default: 1.5 

How much reflections on water surface should be blurred together with the water surface, lower values meaning clearer reflections, (0.2-5) Warning: above 5 seems to cause water corruption

float WaterPerlinStartFreq  default: 8 

Wave sizes, smaller = big waves, sensible: [1,20] (influence the wave sizes)

float WaterPerlinLacunarity  default: ? 

Defines the size of the perlin waves, small values being big waves ([0.2,5] is sensible)

float WaterPerlinAmplitude  default: ? 

Base stillness of water surface, 0 is dead still, 1 is 'windy' .This doesnt affect the bump texture depth, besides the fact that this disables the bump texture when set to 0

TEAMx

Is used to describe the starting positions of the players.

[MAP]
{
   ...
   [TEAM0]
   {
      StartPosX=730;
      StartPosZ=821;
   }
   [TEAM1]
   {
      ...
   }
   [TEAMn]
   {
       ...
   }
   ...
}

int StartPosX  default: ? range: [0-map width] 

The X (east-west in the TA camera) coordinates on the map where the player will start

int StartPosZ  default: ? range: [0-map length] 

The Z (north-south in the TA camera) coordinates on the map where the player will start

TERRAINTYPEx

Used to define different terrain types that exist on the map. The value starts at 0 and goes on for as many terrain types as you have, where X is the type number. Which terrain type goes where on the map is determined by the typemap when compiling the map. For example, if the typemap has an area of red 128, then the corresponding terraintype tag is [TERRAINTYPE128]

[MAP]
{
   ...
   [TERRAINTYPE0]
   {
      name = my terrain type;
      hardness = 1;
      recievetracks = 0;
      tankmovespeed = 1;
      kbotmovespeed = 1;
      hovermovespeed = 1;
      shipmovespeed = 1;
   }
   [TERRAINTYPE1]
   {
      ...
   }
   [TERRAINTYPEn]
   {
      ...
   }
   ...
}

string name  default: ? 

A label for the terrain type

float hardness  default: 1.0 range: [0.001-max] 

Used as a multiplier against the [MAP].MapHardness value. Can be used to make a particular terrain type softer or harder. A value of '1' will make it as hard as MapHardness, and 0.5 will make it half as hard

bool recievetracks  default: 1 range: [0 

Effects whether track decals will be placed on the ground from moving vehicles

float tankmovespeed  default: 1.0 

Speed multiplier for tanks when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type. All move speeds are clamped to [0,2]

float kbotmovespeed  default: 1.0 

Speed multiplier for Kbots when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type

float hovermovespeed  default: 1.0 

Speed multiplier for hovercraft when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type

float shipmovespeed  default: 1.0 

Speed multiplier for Ship when travelling on the parent terrain type. A value of '1' is normal speed, 0.5 will make them travel at half speed on the parent terrain type

GRASS

[MAP]
{
   ...
   [GRASS]
   {
      GrassBladeWaveScale = 1.0;
      GrassBladeWidth = 0.32;
      GrassBladeHeight = 4;
      GrassBladeAngle = 1.57;
   }
   ...
}

float GrassBladeWaveScale  default: 1.0 

Specifies how much the wind should effect grass blade movement, as well as the amplitude of the grass motion. Setting it to 0 will stop grass animation

float GrassBladeWidth  default: 0.32 

Specifies the width of each blade of grass

float GrassBladeHeight  default: 4.0 

Specifies the length of each blade of grass

float GrassBladeAngle  default: 1.57 

Unit is radians. Specifies the curvature of each blade of grass. Zero means a completely straight blades of grass

SPLATS

[MAP]
{
   ...
   [SPLATS]
   {
      SplatTexScales = 1.0 1.0 1.0 1.0;
      SplatTexMults = 1.0 1.0 1.0 1.0;
   }
   ...
}

float[3] SplatTexScales  default: ? 

FIXME:

float[3] SplatTexMults  default: ? 

FIXME: