Some basic clarifications about mask, add link to nemo’s mask guide, add link to Pngcrush, some typographic improvements.
authoralmikes@aol.com
Wed, 03 Dec 2014 20:55:58 +0000
changeset 436 0afdd1b1042c
parent 435 9e434185289a
child 437 a4b6372904c7
Some basic clarifications about mask, add link to nemo’s mask guide, add link to Pngcrush, some typographic improvements.
PresetMaps.wiki
--- a/PresetMaps.wiki	Wed Dec 03 20:35:28 2014 +0000
+++ b/PresetMaps.wiki	Wed Dec 03 20:55:58 2014 +0000
@@ -37,7 +37,7 @@
 
 The name of the *.hwp* file should be the same with the mission script.
 
-In the mission script's onGameInit(), map should be set to *some_name*. See [LuaAPI] for more about onGameInit().
+In the mission script’s `onGameInit`, map should be set to *some_name*. See [LuaAPI] for more about `onGameInit`.
 
 ----
 
@@ -46,7 +46,7 @@
 Within the folder of every map the following files are expected to be there:
 
 == Basic files ==
-=== map.cfg ===
+=== `map.cfg` ===
 Configuration file.
 
   * First line is the name of the [Theme] used by the map (for background and clouds, flakes, water, etc).  As of 0.9.19+, this theme may be overridden when setting up the game.
@@ -55,7 +55,7 @@
 
 
 
-=== map.png ===
+=== `map.png` ===
 Image of visible land area.
   * Usually _width/length ratio_ of 2:1
   * Typical size: 2048 x 1024
@@ -69,35 +69,38 @@
   * If there is no _mask.png_, this image will also be used for deciding what pixels are subject to collision: _alpha value_ not equal to 0 (so below max transparency) will be considered land
   * As of 0.9.19+, map.png is optional if a mask.png is provided.  If there is no map.png, the theme will be used to decorate the map.  No objects will be added to white areas.  Use black if you want objects.
 
-=== preview.png ===
+=== `preview.png` ===
 Preview image of the map
   * size: 256 x 128_
 
 == Optional files (for advanced features and adjustments) ==
-=== mask.png ===
+=== `mask.png` ===
 Image defining the collision areas of the map.
 
   * Pixels with _alpha value_ = 0 will not be subject to collision
-  * White pixels will be terrain
-  * Red pixels will be indestructible terrain (regardless of game mode settings)
-  * Black pixels will be terrain with background texture applied (Note: Adding any black pixels removes erasure protection from areas where the map.png is solid but the mask.png is transparent) - 0.9.17+
-  * Blue pixels will be ice - 0.9.17+
-  * Green pixels block portals - 0.9.18+  In 0.9.20+ they are implemented as "bouncy" - this is used for the Rubber weapon.  This mask can be used normally for maps or theme objects.  If bouncing is implemented and the green pixels should only block portals, place a dotted line of single red/black/white pixels a few pixels above the green, spaced a few pixels apart.  This will keep most objects from interacting with the green, but prevent portal spawning.
+  * White (255, 255, 255) pixels will be terrain, no background texture will be shown when it is destroyed.
+  * Black (0, 0, 0) pixels will be terrain with background texture applied (Note: Adding any black pixels removes erasure protection from areas where the map.png is solid but the mask.png is transparent) - 0.9.17+
+  * Red (255, 0, 0) pixels will be indestructible terrain (regardless of game mode settings)
+  * Blue (0, 0, 255) pixels will be ice - 0.9.17+
+  * Green (0, 255, 0) pixels block portals - 0.9.18+  In 0.9.20+ they are implemented as “bouncy”—this is used for the Rubber weapon. This mask can be used normally for maps or theme objects.  If bouncing is implemented and the green pixels should only block portals, place a dotted line of single red/black/white pixels a few pixels above the green, spaced a few pixels apart.  This will keep most objects from interacting with the green, but prevent portal spawning.
+
+It is recommended that your file _only_ consists of pixels which have one of the values above. This ensures that the masks works properly for your map and avoids unexpected behaviour. Also, it makes your file significantly smaller. [http://www.hedgewars.org/node/3339 Here] is a simple guide describing how you can ensure that.
 
 *Examples:*
   * [http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Maps/portal/mask.png Mask]  of [http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Maps/portal/map.png Portal Map]
 (Transparent areas may not be recognizeable as such in your browser/image preview program, so open e.g. in [http://www.gimp.org/ Gimp])
 
 
-=== map.lua ===
-A Lua-script to be used together with the map.
+=== `map.lua` ===
+A Lua script to be used together with the map.
 
-See the LuaGuide for more information on Hedgewars' scripting support.
+See the LuaGuide for more information on Hedgewars’ scripting support.
 
 == Image format ==
   * PNG, 8-bit/color RGBA (so 32 bit)
-  * Gamma correction and colour profiles should not be applied, in order to ensure the map is loaded identically on OSX as it is on other operating systems by SDL.  To ensure this happens, please run:
-pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB old/map.png new/map.png
+  * Gamma correction and colour profiles should not be applied, in order to ensure the map is loaded identically on OSX as it is on other operating systems by SDL. To ensure this happens, please run in the command-line (requires Pngcrush):
+<code language="bash">pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB old/map.png new/map.png</code>
+(Pngcrush is a command-line tool which can be found on [http://pmt.sourceforge.net/pngcrush/])
 
 or be sure your image editing software has these options disabled.