Mapdev:Tutorial Intermediate: Difference between revisions

From Spring
Jump to navigationJump to search
m →Detail: added images showing with and without splatted detail maps.
Flozi (talk | contribs)
m use Tip & Caution
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Beginners Tutorial Stage 2 =
= Beginners Tutorial Stage 2 =
We continue on from [[Mapdev:Tutorial_Simple|stage 1]] of the beginners tutorial to add more detail to the map.
We continue on from [[Mapdev:Tutorial_Simple|stage 1]] of the beginners tutorial to add finer detail for the landscape, specular highlights, features like trees, rocks etc. And change the lighting conditions.


= What you will need =
= What you will need =
* An image editor, such as [http://www.gimp.org/ GIMP] or [http://www.adobe.com/products/photoshop.html Adobe Photoshop], [http://en.wikipedia.org/wiki/List_of_raster_graphics_editors#List etc]
* An image editor, such as [http://www.gimp.org/ GIMP] or [http://www.adobe.com/products/photoshop.html Adobe Photoshop], [http://en.wikipedia.org/wiki/List_of_raster_graphics_editors#List etc]
* [http://www.7-zip.org/ 7zip]
* [http://www.7-zip.org/ 7zip]
* [[MapConvNG]]
* [http://springfiles.com/spring/other/mapdev-stage1-working-files The files] we used in the [[Mapdev:Tutorial_Simple|first stage]]
* A copy of the map we used in the first tutorial
* [[Spring Features]] - [http://springfiles.com/spring/tools/spring-features archive]
* This archive which contains a couple of things you will need.(features)


There are a multitude of other tools you can use to make maps, however for the purposes of this beginners tutorial, these are the only ones you will need. Check the [[Mapdev:Main#Tools|tools]] section for more information.
There are a multitude of other tools you can use to make maps, however for the purposes of this beginners tutorial, these are the only ones you will need. Check the [[Mapdev:Main#Tools|tools]] section for more information.


= Download example =
= Download =
* {{FIXME}}Here is a link to the map from the first tutorial to continue on with
* [http://springfiles.com/spring/other/mapdev-stage2-working-files Download] the finished working files
* {{FIXME}}Here's a link to this finished tutorial
* [http://springfiles.com/spring/spring-maps/mapdev-stage2 Download] the completed map archive


= Map Features =
= Map Features =
Map features are the extra bits and bobs added to a map that give it extra bling eg.  bushes, trees, houses, rocks etc. You can bundle them with your map, or you can create a dependency to external archives like [[SpringFeatures]]. For this tutorial we will be bundling the features with the map.
Map features are the extra bits and bobs added to a map that give it extra bling eg.  bushes, trees, houses, rocks etc. You can bundle them with your map, or you can create a dependency to external archives like [[Spring Features]]. For this tutorial we will be depending on spring features.
{{infobox|title=Tip|icon=icon-tip.png|color=rgba(255,255,0,0.1)
{{Tip|There is not a simple, solid, mature way to cover your map with features yet. Provided here are instructions for the simplest method, but its very time consuming and tedious. There are better methods that yield good results, you can find them listed in the [[Mapdev:features|features]] page.}}
|body=There is not a simple, solid, mature way to cover your map with features yet. Provided here are instructions for the simplest method, but its very time consuming and tedious. There are better methods that yield good results, you can find them listed in the [[Mapdev:features|features]] page.}}
<center>
{| class="wikitable" width="100%"
{| class="wikitable"
|+ Example
|+ Example
| {{FIXME}}(example without features) || {{FIXME}}(example with specular)
| [[File:Mapdev-features-without.jpg|341px]] || [[File:Mapdev-features-with.jpg|341px]]
|-
|-
! Without Features !! With Features
! Without Features !! With Features
|}
|}</center>
{{FIXME}} Fill out this section
<ol>
<ol>
<li>Unzip the additional stuff archive into your working directory
<li>move the downloaded [[Spring Features]] archive to your spring games folder
<li>Copy the ... folders into your map.sdd directory
<li>Edit your mapinfo.lua file to include spring features as a dependency
<li>Edit the set.lua file to contain references to the map features
<code><pre> depend      = {"Map Helper v1","Spring Features 1.0"},</pre></code>
<li>Edit the ./mymap.sdd/mapconfig/featureplacer/set.lua file
<li>Under the <code>objectlist</code> subtable, add lines like the one below to place a feature
 
<code><pre>{ name = 'name', x = 0 , z = 0 , rot = "0"},</pre></code>
* The names of the features are specified in the feature folder within the map spring features archive
* Coordinate system is the same as when placing the start positions:
* <code>rot</code> is the rotation around the <code>y</code> axis.
eg.
<code><pre>  objectlist = {
      { name = 'name', x = 0 , z = 0 , rot = "0"},
      { name = 'name', x = 0 , z = 0 , rot = "0"},
      { name = 'name', x = 0 , z = 0 , rot = "0"},
      { name = 'name', x = 0 , z = 0 , rot = "0"},
  },</pre></code>
</ol>
</ol>
<center>
{| class="wikitable"
| [[File:Mapdev-coords.png]]
|}</center>


= Specular Map =
= Specular Map =
The [[Mapdev:specular|specular]] map defines how shiny and the colour of the shine that the terrain is, it is useful for ice & snow, polished rock, metal, or wet ground types. The Specular map can be any size, and is stretched over the terrain.
The [[Mapdev:specular|specular]] map defines how shiny and the colour of the shine that the terrain is, it is useful for ice & snow, polished rock, metal, or wet ground types. The Specular map can be any size, and is stretched over the terrain.
{| class="wikitable" width="100%"
<center>
{| class="wikitable"
|+ Example
|+ Example
| {{FIXME}}(example without specular) || {{FIXME}}(example with specular)
| [[File:Mapdev-spec_without.jpg|320px]] || [[File:Mapdev-spec_with.jpg|320px]]
|-
|-
! Without Specular Map !! With Specular Map
! Without Specular Map !! With Specular Map
|}
|}</center>
<ol>
<ol>
<li>Create a 1024x1024 RGB image
<li>Create a 1024x1024 RGB image
<li>Paint it white
<li>Paint it such that only the areas you wish to be shiny have colour,
{{infobox|title=Tip|icon=icon-tip.png|color=rgba(255,255,0,0.1)
|body=It is most often the case that you will leave the texture full white as most specular reflection is white, in certain circumstances though you will want to have coloured reflections.}}
<li>Save the image to your working directory as spec_color.png
<li>Save the image to your working directory as spec_color.png
{| class="wikitable" width="100%"
<center>
{| class="wikitable"
|+ Example
|+ Example
| {{FIXME}}(picture of specular color map)
| [[File:Mapdev-spec_color.jpg]]
|-
|-
! Example Specular Color Map
! Example Specular Color Map
|}
|}</center>
<li>Create another 1024x1024 greyscale image
<li>Create another 1024x1024 greyscale image
<li>Paint it such that black is matt finish, and white is full specularity. you will probably want to keep it mostly black, with some slight grey around specific areas.
<li>Paint it such that black is matt finish ie. light will be reflected no matter the viewing angle, and white is reflective finish ie light gets reflected at increasingly sharper viewing angle. you will probably want to keep it mostly grey to white.
<li>Save the image to your working directory as spec_value.png
{{Caution|Be careful not to have any fully black pixels, as it will cause artifacts when the specular highlights are multiplied.}}
{| class="wikitable" width="100%"
<li>Save the image to your working directory as spec_exp.png
<center>
{| class="wikitable"
|+ Example
|+ Example
| {{FIXME}}(picture of specular Value map)
| [[File:Mapdev-spec_exp.jpg]]
|-
|-
! Example Specular Value Map
! Example Specular Exponent Map
|}
|}</center>
<li>Combine the two images into one 1024x1024 RGBA image
<li>Combine the two images into one 1024x1024 RGBA image
<li>Save the result as "working directory"/mymapname.sdd/maps/specular.png
<li>Save the result as "working directory"/mymapname.sdd/maps/specular.png
Line 112: Line 130:
<ol>
<ol>
<li>Open mapinfo.lua in a text editor
<li>Open mapinfo.lua in a text editor
<li> blah
<li>Tweak the  <code>texScales</code> and <code>texMults</code> values to achieve a good look.
</ol>
</ol>
* tweak splat scales and multipliers
<code><pre>
  splats = {
      texScales = {0.02, 0.02, 0.01, 0.02},
      texMults  = {1.0, 0.7, 0.4, 1.0},
  },</pre></code>
<center>
<center>
{| class="wikitable"
{| class="wikitable"
Line 147: Line 169:
   | |-maphelper/
   | |-maphelper/
   | |-maps/
   | |-maps/
   | | |-details_dist.png
   | | |-ddist.png
   | | |-details.png
   | | |-details.png
  | | |-mapdev-stage2.smf
  | | |-mapdev-stage2.smt
   | | |-specular.png
   | | |-specular.png
   | |-objects3d/
   | |-objects3d/
Line 154: Line 178:
   | |-mapinfo.lua
   | |-mapinfo.lua
   | |-mapoptions.lua
   | |-mapoptions.lua
   |-heightmap.png
   |-ddist1.png
   |-metalmap.png
   |-ddist2.png
   |-diffuse.png
   |-ddist3.png
   |-minimap.png
   |-ddist4.png
   |-detail_1.png
   |-detail_1.png
   |-detail_2.png
   |-detail_2.png
   |-detail_3.png
   |-detail_3.png
   |-detail_4.png
   |-detail_4.png
   |-detail_1_dist.png
   |-diffuse.png
   |-detail_2_dist.png
   |-grasmap.png
   |-detail_3_dist.png
   |-heightmap.png
   |-detail_4_dist.png
   |-metalmap.png
   |-specular_color.png
   |-minimap.png
   |-specular_value.png
   |-spec_color.png
  |-spec_exp.png
</pre>
</pre>


Line 178: Line 203:
{{FIXME}}(show pictures of novel concepts, like bridges, scripted terrain, map borders etc.
{{FIXME}}(show pictures of novel concepts, like bridges, scripted terrain, map borders etc.


[[Category:Mapdev]]
[[Category:Map Dev]]
[[Category:Development]]

Latest revision as of 14:25, 16 February 2014

Beginners Tutorial Stage 2

We continue on from stage 1 of the beginners tutorial to add finer detail for the landscape, specular highlights, features like trees, rocks etc. And change the lighting conditions.

What you will need

There are a multitude of other tools you can use to make maps, however for the purposes of this beginners tutorial, these are the only ones you will need. Check the tools section for more information.

Download

Map Features

Map features are the extra bits and bobs added to a map that give it extra bling eg. bushes, trees, houses, rocks etc. You can bundle them with your map, or you can create a dependency to external archives like Spring Features. For this tutorial we will be depending on spring features.

Tip
There is not a simple, solid, mature way to cover your map with features yet. Provided here are instructions for the simplest method, but its very time consuming and tedious. There are better methods that yield good results, you can find them listed in the features page.
Example
Without Features With Features
  1. move the downloaded Spring Features archive to your spring games folder
  2. Edit your mapinfo.lua file to include spring features as a dependency
    	depend      = {"Map Helper v1","Spring Features 1.0"},
  3. Edit the ./mymap.sdd/mapconfig/featureplacer/set.lua file
  4. Under the objectlist subtable, add lines like the one below to place a feature
    { name = 'name', x = 0 , z = 0 , rot = "0"},
    • The names of the features are specified in the feature folder within the map spring features archive
    • Coordinate system is the same as when placing the start positions:
    • rot is the rotation around the y axis.

    eg.

       objectlist = {
          { name = 'name', x = 0 , z = 0 , rot = "0"},
          { name = 'name', x = 0 , z = 0 , rot = "0"},
          { name = 'name', x = 0 , z = 0 , rot = "0"},
          { name = 'name', x = 0 , z = 0 , rot = "0"},
       },

Specular Map

The specular map defines how shiny and the colour of the shine that the terrain is, it is useful for ice & snow, polished rock, metal, or wet ground types. The Specular map can be any size, and is stretched over the terrain.

Example
Without Specular Map With Specular Map
  1. Create a 1024x1024 RGB image
  2. Paint it such that only the areas you wish to be shiny have colour,
  3. Save the image to your working directory as spec_color.png
    Example
    Example Specular Color Map
  4. Create another 1024x1024 greyscale image
  5. Paint it such that black is matt finish ie. light will be reflected no matter the viewing angle, and white is reflective finish ie light gets reflected at increasingly sharper viewing angle. you will probably want to keep it mostly grey to white.
    Caution
    Be careful not to have any fully black pixels, as it will cause artifacts when the specular highlights are multiplied.
  6. Save the image to your working directory as spec_exp.png
    Example
    Example Specular Exponent Map
  7. Combine the two images into one 1024x1024 RGBA image
  8. Save the result as "working directory"/mymapname.sdd/maps/specular.png

Detail

Detail maps make the ground look great even when you are really close to it.

Example
Default Single Detail Map Multiple Detail Maps
* Click on images for higher res

Creating the details map

  1. Collect 4 detail textures that you would like to apply to your terrain and save them to your working directory. The detail textures will need to be tilable, and of the same resolution, resize them if necessary.
  2. Save the detail textures to your working directory as detail_1.png (detail_2.png etc.)
  3. Combine the 4 detail textures into an RGBA image.
  4. Save the combined result to "working directory"/mymap.sdd/maps/details.png
Example
Individual Detail Textures Combined Result

Creating the details distribution map

  1. For each of the four detail textures:
    1. Create an 512x512 greyscale image
    2. Paint where you would like the detail texture to show, white for full strength, black for zero strength.
    3. Save the image to your working directory as detail_1_dist.png (detail_2_dist.png etc.)
  2. Combine the 4 detail distribution maps into one RGBA image
  3. Save the result to "working directory"/mymap.sdd/maps/details_dist.png
Example
Detail Distribution maps Combined Result

Edit mapinfo.lua

  1. Open mapinfo.lua in a text editor
  2. Tweak the texScales and texMults values to achieve a good look.
   splats = {
      texScales = {0.02, 0.02, 0.01, 0.02},
      texMults  = {1.0, 0.7, 0.4, 1.0},
   },
Splat Scales Illustrated

Lighting

could be fun to explain link to Mapdev:lighting

Examples
FIXME: (Code goes here) FIXME: (example image goes here)
FIXME: (Code goes here) FIXME: (example image goes here)
FIXME: (Code goes here) FIXME: (example image goes here)
Example lighting variables In game result

Review

From this tutorial you have been able to really increase the detail level of your map using: features, specular highlights, detail splatting and lighting.

Working directory should look something similar to this:

working directory
  |-mymapname.sdd/
  | |-features/
  | |-LuaGaia/
  | |-mapconfig/
  | | |-featureplacer/
  | | | |-set.lua
  | |-maphelper/
  | |-maps/
  | | |-ddist.png
  | | |-details.png
  | | |-mapdev-stage2.smf
  | | |-mapdev-stage2.smt
  | | |-specular.png
  | |-objects3d/
  | |-unittextures/
  | |-mapinfo.lua
  | |-mapoptions.lua
  |-ddist1.png
  |-ddist2.png
  |-ddist3.png
  |-ddist4.png
  |-detail_1.png
  |-detail_2.png
  |-detail_3.png
  |-detail_4.png
  |-diffuse.png
  |-grasmap.png
  |-heightmap.png
  |-metalmap.png
  |-minimap.png
  |-spec_color.png
  |-spec_exp.png

Finalizing

Continue to this page to compile and archive your map for play

I Want More

This concludes the Beginners tutorial, there are loads more things you can do with maps so have a look through the documentation and think out of the box

FIXME: (show pictures of novel concepts, like bridges, scripted terrain, map borders etc.