PresetMaps.wiki
changeset 747 5b084a7e8574
parent 667 08030f484762
child 798 30c5f1ebd552
equal deleted inserted replaced
746:d53a01a00832 747:5b084a7e8574
     1 #summary This page describes the technically relevant aspects of preset maps in Hedgewars
     1 #summary This page describes the technically relevant aspects of preset maps in Hedgewars
       
     2 
       
     3 = Image maps and mission maps =
     2 
     4 
     3 <wiki:toc max_depth="3" />
     5 <wiki:toc max_depth="3" />
     4 
     6 
     5 ----
     7 == Introduction ==
     6 
       
     7 = Introduction =
       
     8 
     8 
     9 One of the map types Hedgewars supports are maps that were previously drawn by an artist.
     9 One of the map types Hedgewars supports are maps that were previously drawn by an artist.
    10 
    10 
    11 The looks of such maps are distinctly defined and are not subject to randomized values.
    11 The looks of such maps are distinctly defined and are not subject to randomized values.
    12 
    12 
    13 Additionally these maps allow [LuaGuide Lua-script] to be associated with them in order to enable adding specific gameplay changes and map behavior.
    13 Additionally these maps allow [LuaGuide Lua-script] to be associated with them in order to enable adding specific gameplay changes and map behavior.
    14 
    14 
    15 ----
    15 ----
    16 
    16 
    17 = Location =
    17 == Location ==
    18 All maps are automatically loaded from the [HedgewarsDataDir Hedgewars data directory].
    18 All maps are automatically loaded from the [HedgewarsDataDir Hedgewars data directory].
    19 
    19 
    20 In this directory there has to be a folder for every map, named after the desired map name.
    20 In this directory there has to be a folder for every map, named after the desired map name.
    21 
    21 
    22 *Examples:*
    22 *Examples:*
    23   * _Data/Maps/!MyVeryOwnMap_
    23   * _Data/Maps/!MyVeryOwnMap_
    24   * _Data/Maps/Ropes_
    24   * _Data/Maps/Ropes_
    25   * _Data/Maps/Sheep_
    25   * _Data/Maps/Sheep_
    26   * etc.
    26   * etc.
    27 
    27 
    28 == Mission Maps ==
    28 === Mission maps ===
    29 
    29 
    30 Missions may use preset maps that aren't located in the *Data/Maps* directory.
    30 Missions may use preset maps that aren't located in the *Data/Maps* directory.
    31 
    31 
    32 A mission may contain in the same directory with mission's lua script a .hwp file.
    32 A mission may contain in the same directory with mission's lua script a .hwp file.
    33 
    33 
    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 (255, 255, 255) pixels will be terrain, no background texture will be shown when it is destroyed.
    81   * White (255, 255, 255) pixels will be terrain, no background texture will be shown when it is destroyed.
    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+
    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+
    89 *Examples:*
    89 *Examples:*
    90   * [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Maps/portal/mask.png Mask] of [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Maps/portal/map.png Portal Map]
    90   * [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Maps/portal/mask.png Mask] of [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Maps/portal/map.png Portal Map]
    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])
    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])
    92 
    92 
    93 
    93 
    94 === `map.lua` ===
    94 ==== `map.lua` ====
    95 A Lua script to be used together with the map.
    95 A Lua script to be used together with the map.
    96 
    96 
    97 See the LuaGuide for more information on Hedgewars’ scripting support.
    97 See the LuaGuide for more information on Hedgewars’ scripting support.
    98 
    98 
    99 == Image format ==
    99 === Image format ===
   100   * PNG, 8-bit/color RGBA (so 32 bit)
   100   * PNG, 8-bit/color RGBA (so 32 bit)
   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):
   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):
   102 <code language="bash">pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB old/map.png new/map.png</code>
   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/])
   103 (Pngcrush is a command-line tool which can be found on [http://pmt.sourceforge.net/pngcrush/])
   104 
   104 
   105 or be sure your image editing software has these options disabled.
   105 or be sure your image editing software has these options disabled.
   106 
   106 
   107 ----
   107 ----
   108 = Editing software recommendations =
   108 == Editing software recommendations ==
   109 == Images ==
   109 === Images ===
   110 A vector based drawing software is recommended for creating the maps.
   110 A vector based drawing software is recommended for creating the maps.
   111 
   111 
   112 (Reasons for that: Edges are usually automatically smoothed on export; Easier to meet [http://www.hedgewars.org/node/704 Hedgewars Graphics rules, style constraints, guidelines]; Images are easier to change, adjust and maintain style)
   112 (Reasons for that: Edges are usually automatically smoothed on export; Easier to meet [http://www.hedgewars.org/node/704 Hedgewars Graphics rules, style constraints, guidelines]; Images are easier to change, adjust and maintain style)
   113 
   113 
   114 If you don't have one, check out the free open-source [http://inkscape.org Inkscape]: There are various [http://lmgtfy.com/?q=inkscape+tutorial Inkscape tutorials] online, so you should be able to get started easily.
   114 If you don't have one, check out the free open-source [http://inkscape.org Inkscape]: There are various [http://lmgtfy.com/?q=inkscape+tutorial Inkscape tutorials] online, so you should be able to get started easily.
   115 
   115 
   116 = Sharing image maps =
   116 == Sharing image maps ==
   117 You can only play a game with a custom image map against other players online if all participating players have the image map installed under the same name.
   117 You can only play a game with a custom image map against other players online if all participating players have the image map installed under the same name.
   118 
   118 
   119 If any player does not have the image map installed, the game will fail to start and an error message is displayed.
   119 If any player does not have the image map installed, the game will fail to start and an error message is displayed.
   120 
   120 
   121 If you wish, you can post your custom-made image map in the [http://www.hedgewars.org/forum/19 Content Creations] forum.
   121 If you wish, you can post your custom-made image map in the [http://www.hedgewars.org/forum/19 Content Creations] forum.