Mapdev:SMD: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
updating bumpwater smd tags
Line 299: Line 299:
   <tr>
   <tr>
     <td valign="top">'''WaterAbsorb'''</td>
     <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. 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.</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. 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.</td>
     <td valign="top">WaterAbsorb=0.004 0.004 0.002;</td>
     <td valign="top">WaterAbsorb=0.004 0.004 0.002;</td>
   </tr>
   </tr>
Line 333: Line 333:
   <tr>
   <tr>
     <td valign="top">'''WaterSurfaceAlpha'''</td>
     <td valign="top">'''WaterSurfaceAlpha'''</td>
     <td valign="top">Transparency of the water surface.</td>
     <td valign="top">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). Default=0.55</td>
     <td valign="top">WaterSurfaceAlpha = 0.55; </td>
     <td valign="top">WaterSurfaceAlpha = 0.55; </td>
   </tr>
   </tr>
Line 339: Line 339:
   <tr>
   <tr>
     <td valign="top">'''WaterDiffuseColor'''</td>
     <td valign="top">'''WaterDiffuseColor'''</td>
     <td valign="top">-no clue-</td>
     <td valign="top">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.</td>
     <td valign="top">WaterDiffuseColor = 0.55 0.4 0.3; </td>
     <td valign="top">WaterDiffuseColor = 0.55 0.4 0.3; </td>


Line 348: Line 348:


     <td valign="top">'''WaterSpecularColor '''</td>
     <td valign="top">'''WaterSpecularColor '''</td>
     <td valign="top">WaterSpecularColor = groundSunColor -no clue-</td>
     <td valign="top">WaterSpecularColor = groundSunColor - Altering this tag does not seem to have any effect at all.-</td>
     <td valign="top">WaterSpecularColor = 0.55 0.4 0.3; </td>
     <td valign="top"> //WaterSpecularColor = 0.55 0.4 0.3; </td>


   </tr>
   </tr>
Line 356: Line 356:


     <td valign="top">'''WaterSpecularPower '''</td>
     <td valign="top">'''WaterSpecularPower '''</td>
     <td valign="top"> -no clue-</td>
     <td valign="top"> -no clue-'''WARNING''': use of this tag disables the effect of ''WaterAbsorb'' </td>
     <td valign="top">WaterSpecularPower = 2.0; </td>
     <td valign="top">WaterSpecularPower = 2.0; </td>


Line 391: Line 391:


     <td valign="top">'''WaterFresnelMin'''</td>
     <td valign="top">'''WaterFresnelMin'''</td>
     <td valign="top">(0.0<x<=1.0)</td>
     <td valign="top">I have no clue what the WaterFresnel tags do, someone with more knowlegde edit this page please.(0.0<x<=1.0)</td>
     <td valign="top">WaterFresnelMin = 0.3; </td>
     <td valign="top">WaterFresnelMin = 0.3; </td>



Revision as of 15:49, 12 January 2009

SMD Syntax

The SMD, to work correctly, must be set out correctly. The following are a few of these requirements that you have to follow:

  • 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.

  • Blank lines are allowed, and can be placed to help distinguish between different sections
  • 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

[MAP]
{
	Description=Lot of metal in middle but look out for kbot walking over the mountains;
	TidalStrength=20;
	Gravity=130;
	MaxMetal=0.03;

	ExtractorRadius=400;
	MapHardness=100;
	
	[SMF]
	{
	 	minheight = -135;
	 	maxheight = 265;
	}
	[ATMOSPHERE]
	{
		FogColor=0.7 0.7 0.8;
		FogStart=0.2;

		CloudColor=0.9 0.9 0.9;
		SkyColor=0.1 0.15 0.7;

		SunColor=1.0 1.0 1.0;
		CloudDensity=0.55;

		MinWind=5;
		MaxWind=20;
	}
	[WATER]
	{
		WaterBaseColor=0.4 0.6 0.8;
		WaterAbsorb=0.004 0.004 0.002;

		WaterMinColor=0.1 0.1 0.3;
	}
	[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;

	}
	[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




Variable Description Examples
[TEAMX] 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 [TEAM3]
[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] [TERRAINTYPE0]
CloudColor 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. CloudColor=0.9 0.9 0.9;
CloudDensity The number of clouds in the sky. A percentage in decimal form, 0.0 to 1.0. CloudDensity=0.55;
Description The description of the map that shows in the multiplayer battleroom. Description=Strong wind, good for 2v2 team games;
ExtractorRadius The radius of effect that a single extractor will extract from. If two radii intersect, both extractors will suffer from reduced output. ExtractorRadius=400;
GroundAmbientColor The ambient (non-sun-lit) color of ground, grass, trees and other features. GroundAmbientColor=0.4 0.4 0.4;
GroundShadowDensity How far from the non shadowed to the ambient color stuff in shadow will go. GroundShadowDensity=0.8;
GroundSunColor The color of ground where it is fully sun lit (added to GroundAmbientColor). GroundSunColor=0.7 0.7 0.7;
FogColor 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. FogColor=0.7 0.7 0.8;
FogStart The distance from the camera at which the fog will start. FogStart=0.2;
Hardness (terraintype) Used as a multiplier against the 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. hardness=0.75;
HoverNoveSpeed 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. hovermovespeed=1;
KbotMoveSpeed 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. kbotmovespeed=1;
MapHardness Defines how much the terrain will deform due to explosions and weapons. MapHardness=100;
MaxMetal 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. MaxMetal=0.03;
MaxWind The maximum amount of energy the wind on the map will give. MaxWind=20;
MinWind The minimum amount of energy the wind on the map will give. MinWind=5;
Name (terraintype) Used to define the name of the type of terrain. "Snow" or "Rock" or whatever you want. Name=default;
ShipMoveSpeed 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. shipmovespeed=1;
SkyColor The color of the sky itself. Works the same way as CloudColor and FogColor. SkyColor=0.1 0.15 0.7;
StartPosX The X (east-west in the TA camera) coordinates on the map where the player will start. StartPosX=600;
StartPosZ The Z (north-south in the TA camera) coordinates on the map where the player will start. StartPosZ=600;
SunColor 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. SunColor=1.0 1.0 1.0;
SunDir The direction of the sun, which is normalized by Spring. The Y-axis is up. Here's a basic chart for values:
1 .5 -10 .5 -1-1 .5 -1
1 .5 00 1 0-1 .5 0
1 .5 10 .5 1-1 .5 1
SunDir=0 1 2;
TankMoveSpeed 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. tankmovespeed=1;
TidalStrength The amount of energy which will be given by tidal generators. TidalStrength=30;
UnitAmbientColor The ambient (non-sun-lit) color of units and corpses. UnitAmbientColor=0.3 0.3 0.3;
UnitShadowDensity How far from the non shadowed to the ambient color stuff in shadow will go. UnitShadowDensity=0.8;
UnitSunColor The color of units where they is fully sun lit (added to UnitAmbientColor). UnitSunColor=0.8 0.8 0.8;
WaterAbsorb 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. WaterAbsorb=0.004 0.004 0.002;
WaterBaseColor The color of the water just beneath the surface plane. This is the starting color from which deeper waters will absorb more color. WaterBaseColor=0.4 0.6 0.8;
WaterMinColor The smallest values the water will go down to due to WaterAbsorb. WaterMinColor=0.1 0.1 0.3;
WaterPlaneColor This set the color of the groundplane under the water outside the map boundaries WaterPlaneColor = 0.75 0.8 0.85;
WaterSurfaceColor The color of the water surface. Mostly affects the colors of the reflections off the top of the water. Does NOT effect bumped water! WaterSurfaceColor = 0.75 0.8 0.85;

Bump mapped water SMD tags. These tags only affect bump mapped water and dont affect the other types.

WaterSurfaceAlpha 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). Default=0.55 WaterSurfaceAlpha = 0.55;
WaterDiffuseColor 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. WaterDiffuseColor = 0.55 0.4 0.3;
WaterSpecularColor WaterSpecularColor = groundSunColor - Altering this tag does not seem to have any effect at all.- //WaterSpecularColor = 0.55 0.4 0.3;
WaterSpecularPower -no clue-WARNING: use of this tag disables the effect of WaterAbsorb WaterSpecularPower = 2.0;
WaterSpecularFactor -no clue- WaterSpecularFactor = 0.3;
WaterAmbientFactor -no clue- WaterAmbientFactor = 1.3;
WaterDiffuseFactor -no clue- WaterDiffuseFactor = 0.3;
WaterFresnelMin I have no clue what the WaterFresnel tags do, someone with more knowlegde edit this page please.(0.0<x<=1.0) WaterFresnelMin = 0.3;
WaterFresnelMax (<1-WaterFresnelMin) WaterFresnelMax = 0.8;
WaterFresnelPower -no clue- WaterFresnelPower = 4;
WaterReflectionDistortion 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 WaterReflectionDistortion = 0.1;
WaterBlurBase Something to do with blur, but it just seems to cause banding with values under 2 and corruption with values above 10 WaterBlurBase = 2;
WaterBlurExponent 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 WaterBlurExponent = 2;
WaterPerlinStartFreq Wave sizes, smaller = big waves, sensible: 1-20 (influence the wave sizes) default=8 WaterPerlinStartFreq = 8;
WaterPerlinLacunarity new, any float; seems to define the size of the perlin waves, small values being big waves (0.2-5 is sensible) default= 3 WaterPerlinLacunarity = 3;
WaterPerlinAmplitude 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 default=0.9 WaterPerlinAmplitude= 0.9;