PresetMaps.wiki
changeset 436 0afdd1b1042c
parent 372 3ba6ae9321df
child 559 43337323f97a
equal deleted inserted replaced
435:9e434185289a 436:0afdd1b1042c
    35 
    35 
    36 In the *some_name* directory the files map.cfg, map.png and mask.png are located. See the Basic Files section for more on these files.
    36 In the *some_name* directory the files map.cfg, map.png and mask.png are located. See the Basic Files section for more on these files.
    37 
    37 
    38 The name of the *.hwp* file should be the same with the mission script.
    38 The name of the *.hwp* file should be the same with the mission script.
    39 
    39 
    40 In the mission script's onGameInit(), map should be set to *some_name*. See [LuaAPI] for more about onGameInit().
    40 In the mission script’s `onGameInit`, map should be set to *some_name*. See [LuaAPI] for more about `onGameInit`.
    41 
    41 
    42 ----
    42 ----
    43 
    43 
    44 = Files =
    44 = Files =
    45 
    45 
    46 Within the folder of every map the following files are expected to be there:
    46 Within the folder of every map the following files are expected to be there:
    47 
    47 
    48 == Basic files ==
    48 == Basic files ==
    49 === map.cfg ===
    49 === `map.cfg` ===
    50 Configuration file.
    50 Configuration file.
    51 
    51 
    52   * 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.
    52   * 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.
    53   * Second line is max. number of hedgehogs supported. If the second line is not provided, it is assumed to be 18
    53   * Second line is max. number of hedgehogs supported. If the second line is not provided, it is assumed to be 18
    54 
    54 
    55 
    55 
    56 
    56 
    57 
    57 
    58 === map.png ===
    58 === `map.png` ===
    59 Image of visible land area.
    59 Image of visible land area.
    60   * Usually _width/length ratio_ of 2:1
    60   * Usually _width/length ratio_ of 2:1
    61   * Typical size: 2048 x 1024
    61   * Typical size: 2048 x 1024
    62   * Max size: no limit, 0.9.18+.  4096 x 2048 or less in 0.9.17 and earlier.  There are a few practical limits to map size that should be examined for people trying to make very large maps.
    62   * Max size: no limit, 0.9.18+.  4096 x 2048 or less in 0.9.17 and earlier.  There are a few practical limits to map size that should be examined for people trying to make very large maps.
    63     * SDL 1.2 - SDL 1.2 can only load maps that are <=16,384px wide, and <=65,536px high. SDL 1.2 rect is only capable of handling a map that is <=32768 high, while behaviour in Hedgewars 0.9.20 or lower forces <=16,384 if using a mask.png without a map.png.
    63     * SDL 1.2 - SDL 1.2 can only load maps that are <=16,384px wide, and <=65,536px high. SDL 1.2 rect is only capable of handling a map that is <=32768 high, while behaviour in Hedgewars 0.9.20 or lower forces <=16,384 if using a mask.png without a map.png.
    67     * Graphics card. This is the big one. Your graphics card probably has anywhere from 256MiB to 2GiB of vRAM.  If blurry land is enabled and the map has a typical amount of empty space, you can make a map w/ ~2x the pixels as a card has vRAM. But. Most people don't like using Blurry Land, so best to limit to ~½ the pixels as a card has vRAM. Targetting support for people on 256MiB of vRAM, that means a 2:1 rectangular map should not be larger than 16,384x8192 which coincidentally fits in the SDL 1.2 width limit.
    67     * Graphics card. This is the big one. Your graphics card probably has anywhere from 256MiB to 2GiB of vRAM.  If blurry land is enabled and the map has a typical amount of empty space, you can make a map w/ ~2x the pixels as a card has vRAM. But. Most people don't like using Blurry Land, so best to limit to ~½ the pixels as a card has vRAM. Targetting support for people on 256MiB of vRAM, that means a 2:1 rectangular map should not be larger than 16,384x8192 which coincidentally fits in the SDL 1.2 width limit.
    68     * There is also a completely arbitrary check in game for widths/height < ~billion pixels which avoids possible integer issues, and a limit on size in pixels of 6 billion or so, which was just a basic sanity limit.  However given the limitations above, these are not likely to be reached.
    68     * There is also a completely arbitrary check in game for widths/height < ~billion pixels which avoids possible integer issues, and a limit on size in pixels of 6 billion or so, which was just a basic sanity limit.  However given the limitations above, these are not likely to be reached.
    69   * 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
    69   * 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
    70   * 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.
    70   * 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.
    71 
    71 
    72 === preview.png ===
    72 === `preview.png` ===
    73 Preview image of the map
    73 Preview image of the map
    74   * size: 256 x 128_
    74   * size: 256 x 128_
    75 
    75 
    76 == Optional files (for advanced features and adjustments) ==
    76 == Optional files (for advanced features and adjustments) ==
    77 === mask.png ===
    77 === `mask.png` ===
    78 Image defining the collision areas of the map.
    78 Image defining the collision areas of the map.
    79 
    79 
    80   * Pixels with _alpha value_ = 0 will not be subject to collision
    80   * Pixels with _alpha value_ = 0 will not be subject to collision
    81   * White pixels will be terrain
    81   * White (255, 255, 255) pixels will be terrain, no background texture will be shown when it is destroyed.
    82   * Red pixels will be indestructible terrain (regardless of game mode settings)
    82   * 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+
    83   * 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+
    83   * Red (255, 0, 0) pixels will be indestructible terrain (regardless of game mode settings)
    84   * Blue pixels will be ice - 0.9.17+
    84   * Blue (0, 0, 255) pixels will be ice - 0.9.17+
    85   * 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.
    85   * 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.
       
    86 
       
    87 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.
    86 
    88 
    87 *Examples:*
    89 *Examples:*
    88   * [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]
    90   * [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]
    89 (Transparent areas may not be recognizeable as such in your browser/image preview program, so open e.g. in [http://www.gimp.org/ Gimp])
    91 (Transparent areas may not be recognizeable as such in your browser/image preview program, so open e.g. in [http://www.gimp.org/ Gimp])
    90 
    92 
    91 
    93 
    92 === map.lua ===
    94 === `map.lua` ===
    93 A Lua-script to be used together with the map.
    95 A Lua script to be used together with the map.
    94 
    96 
    95 See the LuaGuide for more information on Hedgewars' scripting support.
    97 See the LuaGuide for more information on Hedgewars’ scripting support.
    96 
    98 
    97 == Image format ==
    99 == Image format ==
    98   * PNG, 8-bit/color RGBA (so 32 bit)
   100   * PNG, 8-bit/color RGBA (so 32 bit)
    99   * 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:
   101   * 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):
   100 pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB old/map.png new/map.png
   102 <code language="bash">pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB old/map.png new/map.png</code>
       
   103 (Pngcrush is a command-line tool which can be found on [http://pmt.sourceforge.net/pngcrush/])
   101 
   104 
   102 or be sure your image editing software has these options disabled.
   105 or be sure your image editing software has these options disabled.
   103 
   106 
   104 ----
   107 ----
   105 = Editing software recommendations =
   108 = Editing software recommendations =