Thu, 06 Jun 2013 20:38:38 +0000
changeset 323 b1f26e44ce70
parent 279 1d9a5422d1b9
child 329 21830c0b19f3
permissions -rw-r--r--
Add 0.9.19 static map changes.

#summary This page describes the technically relevant aspects of preset maps in Hedgewars

<wiki:toc max_depth="3" />


= Introduction =

One of the map types Hedgewars supports are maps that were previously drawn by an artist.

The looks of such maps are distinctly defined and are not subject to randomized values.

Additionally these maps allow [LuaGuide Lua-script] to be associated with them in order to enable adding specific gameplay changes and map behavior.


= Location =
All maps are automatically loaded from the [HedgewarsDataDir Hedgewars data directory].

In this directory there has to be a folder for every map, named after the desired map name.

  * _Data/Maps/!MyVeryOwnMap_
  * _Data/Maps/Ropes_
  * _Data/Maps/Sheep_
  * etc.


= Files =

Within the folder of every map the following files are expected to be there:

== Basic files ==
=== 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.
  * Second line is max. number of hedgehogs supported. If the second line is not provided, it is assumed to be 18

=== map.png ===
Image of visible land area.
  * Usually _width/length ratio_ of 2:1
  * Typical size: 2048 x 1024
  * Max size: no limit, 0.9.18+.  4096 x 2048 or less in 0.9.17 and earlier.
  * 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.

=== preview.png ===
Preview image of the map
  * size: 256 x 128_

== Optional files (for advanced features and adjustments) ==
=== 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+  They are defined as "bouncy" in the code, although this functionality is not implemented, and could be susceptible to change.  If bouncing is implemented and the green pixels should only block portals, place a dotted line of single red pixels a few pixels above the green, spaced a few pixels apart.

  * [ Mask]  of [ Portal Map]
(Transparent areas may not be recognizeable as such in your browser/image preview program, so open e.g. in [ Gimp])

=== map.lua ===
A Lua-script to be used together with the map.

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

or be sure your image editing software has these options disabled.

= Editing software recommendations =
== Images ==
A vector based drawing software is recommended for creating the maps.

(Reasons for that: Edges are usually automatically smoothed on export; Easier to meet [ Hedgewars Graphics rules, style constraints, guidelines]; Images are easier to change, adjust and maintain style)

If you don't have one, check out the free open-source [ Inkscape]: There are various [ Inkscape tutorials] online, so you should be able to get started easily.