Mapdev:SMD: Difference between revisions

From Spring
Jump to navigationJump to search
m added category
m moved Maps:SMD to Map Making:SMD: in wrong namespace
(No difference)

Revision as of 04:49, 28 May 2012

Spring Map Definition (smd) Reference

Thing are set out in sections with all relevant information for that section contained within.

variables are organised as such:

VariableName [dimensions] Required
Default: value, Description

But I dont know whats required or not.

there are FIXME's everywhere I haven't yet found information for.

Source

The engine source code which reads this file from the map is viewable here:rts/Map/MapInfo.cpp and rts/Map/MapParser.cpp

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]
   {
      ...
   }
}
Description [string] Required
The description of the map that shows in the multiplayer battleroom.
AutoShowMetal [0|1]
Default: 1, Defines wether the metal map (F4 mode) is shown automatically when a mex is queued for placement.
DefaultOptions [0|1]
Default:FIXME, FIXME
DetailTex [string]
Specifies the detail texture for the map, for examples and a library, see this sticky thread: [[1]]
ExtractorRadius [0,?]
Default: 500, The radius of effect that a single extractor will extract from. If two radii intersect, both extractors will suffer from reduced output.
Gravity [?,?]
Default: 130, The force of gravity in units/sec^2
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)
MaxMetal [0,?]
Default: 0.02, How much metal a map square with the maximum metal value gives.
TidalStrength [0,?]
Default: 0, The amount of energy which will be given by tidal generators.
voidwater [0|1]
Default: 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
notdeformable [0|1]
Default: 0, Setting it to 1 means that no explosions can deform the map.
SpecularTex [string]
FIXME
SplatDistrTex [string]
FIXME
SplatDetailTex [string]
FIXME
GrassBladeTex [string]
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.
GrassShadingTex [string]
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;
   }
   ...
}
MinHeight [-?,?]
Overrides the minimum map height specified while compiling. Compile time height used if undefined
MaxHeight [-?,?]
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;
   }
   ...
}
CloudColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 1.0 1.0 1.0, The color of the clouds. The values are in the order Red, Green, Blue.
CloudDensity [0.0,1.0]
Default: 0.5, The number of clouds in the sky. A percentage in decimal form, 0.0 to 1.0.
FogColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
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.
FogStart [0.0,?]
Default: 0.1, The distance from the camera at which the fog will start.
MinWind [0.0,?]
Default: 5.0, The minimum amount of energy the wind on the map will give.
MaxWind [0.0,?]
Default: 25.0, The maximum amount of energy the wind on the map will give.
SkyBox [string]
Specify a .dds skybox (also called skycube) for examples and resources see: [[2]]
SkyColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 0.1 0.15 0.7, The color of the sky itself. The values are in the order Red, Green, Blue.
SunColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
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;
   }
   ...
}
GroundAmbientColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
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.
GroundSunColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default:FIXME, The color of ground where it is fully sun lit (added to GroundAmbientColor). The values are in the order Red, Green, Blue.
GroundShadowDensity [?,?]
Default:0.8, How far from the non shadowed to the ambient color stuff in shadow will go.
GroundSpecularColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 0.1 0.1 0.1, FIXME
UnitAmbientColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
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.
UnitSunColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default:FIXME, 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.
UnitShadowDensity [?,?]
Default: 0.8, How far from the non shadowed to the ambient color stuff in shadow will go.
UnitSpecularColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 0.7 0.7 0.7, FIXME
SunDir [-1.0,1.0] [-1.0,1.0] [-1.0,1.0]
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
   }
   ...
}
WaterSurfaceColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
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!
WaterBaseColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
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.
WaterAbsorb [0.0,?] [0.0,?] [0.0,?]
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.
WaterMinColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 0.0 0.0 0.0, The smallest values the water will go down to due to WaterAbsorb.
WaterPlaneColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 0.0 0.4 0.0, This set the color of the groundplane under the water outside the map boundaries
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.
WaterSurfaceAlpha [0.0,1.0]
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).
WaterDiffuseColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default:FIXME, 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.
WaterSpecularColor [0.0,1.0] [0.0,1.0] [0.0,1.0]
Default: 0.5 0.5 0.5, FIXME
WaterSpecularPower [?,?]
Default:FIXME, FIXME, use of this tag disables the effect of WaterAbsorb.
WaterSpecularFactor [?,?]
Default: 20, FIXME
WaterAmbientFactor [?,?]
Default:FIXME, FIXME
WaterDiffuseFactor [?,?]
Default:FIXME, FIXME
WaterFresnelMin [?,?]
Default: 0.2, FIXME
WaterFresnelMax [?,?]
Default: 0.3, FIXME
WaterFresnelPower [?,?]
Default: 4.0, FIXME
WaterReflectionDistortion [0,?]
Default:FIXME, 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
WaterBlurBase [?,?]
Default:FIXME, FIXME, Something to do with blur, but it just seems to cause banding with values under 2 and corruption with values above 10
WaterBlurExponent [0,?]
Default:FIXME, 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
WaterPerlinStartFreq [0,?]
Default:FIXME, Wave sizes, smaller = big waves, sensible: [1,20] (influence the wave sizes) default=8
WaterPerlinLacunarity [0.0,?]
Default:2 Defines the size of the perlin waves, small values being big waves ([0.2,5] is sensible) default= 3
WaterPerlinAmplitude [0.0,?]
Default:0.9, 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


Dont know if they have relevant options but there is also these options in the defaults.

  • texture: Specifies the basic water (water 0) texture. Unzip the bitmaps.sdz file of spring in spring/base to see an example for caustics. Or unzip the map Mercury_v1.sd7 for an example.
  • foamtexture: Specifies the texture of the shore waves. Unzip the bitmaps.sdz file of spring in spring/base to see an example.
  • normaltexture: Specifies a normal map for bump water. Unzip the bitmaps.sdz file of spring in spring/base to see an example
  • caustics : Specifies a sequence of images that shallow waters will have to model surface wave distortion of lighting on the water floor. Unzip the bitmaps.sdz file of spring in spring/base to see an example for caustics. If the images are called caustic0**.bmp, put watercaustics=caustic; in the SMD
  • repeatx: These two specify the tile resulotion of the 'watertexture' smd tag
  • repeaty

TEAMx

Is used to describe the starting positions of the players.

[MAP]
{
   ...
   [TEAM0]
   {
      StartPosX=730;
      StartPosZ=821;
   }
   [TEAM1]
   {
      ...
   }
   [TEAMn]
   {
       ...
   }
   ...
}
StartPosX [0,map width]
The X (east-west in the TA camera) coordinates on the map where the player will start.
StartPosZ [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]
   {
      ...
   }
   ...
}
name [string]
A label for the terrain type.
hardness [0.0,?]
Default : 1.0, 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.
recievetracks [0|1]
Default: 1, Effects whether track decals will be placed on the ground from moving vehicles.
tankmovespeed [0.0,2.0]
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]
kbotmovespeed [0.0,2.0]
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.
hovermovespeed [0.0,2.0]
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.
shipmovespeed [0.0,2.0]
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

Page about the grass feature in maps

[MAP]
{
   ...
   [GRASS]
   {
      GrassBladeWaveScale = 1.0;
      GrassBladeWidth = 0.32;
      GrassBladeHeight = 4;
      GrassBladeAngle = 1.57;
   }
   ...
}
GrassBladeWaveScale [FIXME]
Default: 1, 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.
GrassBladeWidth [FIXME]
Default: 0.32, Specifies the width of each blade of grass
GrassBladeHeight [FIXME]
Default 4, Specifies the length of each blade of grass
GrassBladeAngle [FIXME]
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;
   }
   ...
}
SplatTexScales [?]
FIXME
SplatTexMults [?]
FIXME

Exampe

--add some file that can be c&p into new maps.