Mapdev:Tutorial Intermediate

From Spring
Jump to navigationJump to search

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.

Icon-tip.png 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
Mapdev-features-without.jpg Mapdev-features-with.jpg
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"},
       },
Mapdev-coords.png

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
Mapdev-spec without.jpg Mapdev-spec with.jpg
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
    Mapdev-spec color.jpg
    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.
    Icon-caution.png 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
    Mapdev-spec exp.jpg
    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
Mapdev-splat-without.jpg Mapdev-splat-with.jpg
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
Mapdev-details.gif Mapdev-details.png
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
Mapdev-ddist.gif Mapdev-ddist.png
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},
   },
Map measure.png
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.