author | kyberneticist@gmail.com |
Wed, 06 Nov 2013 16:33:05 +0000 | |
changeset 337 | fcceaed03448 |
parent 336 | 43e9272e3153 |
child 339 | 1664d3e63c05 |
permissions | -rw-r--r-- |
279
1d9a5422d1b9
Edited wiki page PresetMaps through web user interface.
sheepyluva@gmail.com
parents:
264
diff
changeset
|
1 |
#summary This page describes the technically relevant aspects of preset maps in Hedgewars |
96 | 2 |
|
3 |
<wiki:toc max_depth="3" /> |
|
4 |
||
5 |
---- |
|
6 |
||
7 |
= Introduction = |
|
8 |
||
9 |
One of the map types Hedgewars supports are maps that were previously drawn by an artist. |
|
10 |
||
11 |
The looks of such maps are distinctly defined and are not subject to randomized values. |
|
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. |
|
14 |
||
15 |
---- |
|
16 |
||
17 |
= Location = |
|
18 |
All maps are automatically loaded from the [HedgewarsDataDir Hedgewars data directory]. |
|
19 |
||
20 |
In this directory there has to be a folder for every map, named after the desired map name. |
|
21 |
||
22 |
*Examples:* |
|
23 |
* _Data/Maps/!MyVeryOwnMap_ |
|
24 |
* _Data/Maps/Ropes_ |
|
25 |
* _Data/Maps/Sheep_ |
|
26 |
* etc. |
|
27 |
||
329
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
28 |
== Mission Maps == |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
29 |
|
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
30 |
Missions may use preset maps that aren't located in the *Data/Maps* directory. |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
31 |
|
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
32 |
A mission may contain in the same directory with mission's lua script a .hwp file. |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
33 |
|
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
34 |
This file is a zip file with an altered extension from *.zip* to *.hwp* and it contains the directory *Maps/some_name*. |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
35 |
|
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
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. |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
37 |
|
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
38 |
The name of the *.hwp* file should be the same with the mission script. |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
39 |
|
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
40 |
In the mission script's onGameInit(), map should be set to *some_name*. See [LuaAPI] for more about onGameInit(). |
21830c0b19f3
Edited wiki page PresetMaps and added section for .hwp mission maps.
pntanasis@gmail.com
parents:
323
diff
changeset
|
41 |
|
96 | 42 |
---- |
43 |
||
44 |
= Files = |
|
45 |
||
46 |
Within the folder of every map the following files are expected to be there: |
|
47 |
||
48 |
== Basic files == |
|
49 |
=== map.cfg === |
|
50 |
Configuration file. |
|
51 |
||
323 | 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. |
105
5aafdbd7206f
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
97
diff
changeset
|
53 |
* Second line is max. number of hedgehogs supported. If the second line is not provided, it is assumed to be 18 |
96 | 54 |
|
55 |
||
56 |
||
57 |
||
58 |
=== map.png === |
|
59 |
Image of visible land area. |
|
60 |
* Usually _width/length ratio_ of 2:1 |
|
61 |
* Typical size: 2048 x 1024 |
|
336
43e9272e3153
Edited wiki page PresetMaps through web user interface.
kyberneticist@gmail.com
parents:
329
diff
changeset
|
62 |
* Max size: no limit, 0.9.18+. 4096 x 2048 or less in 0.9.17 and earlier. (note: while there is no in-game limit apart from a mild sanity check restricting width or height to < 1073741824 and total size to < 24GiB of RAM, there is a limit if hedgewars is built w/ SDL 1.2 that restricts the maximum width to 16,384 and maximum height to 65,536) |
96 | 63 |
* 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 |
323 | 64 |
* 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. |
96 | 65 |
|
66 |
=== preview.png === |
|
67 |
Preview image of the map |
|
68 |
* size: 256 x 128_ |
|
69 |
||
70 |
== Optional files (for advanced features and adjustments) == |
|
71 |
=== mask.png === |
|
72 |
Image defining the collision areas of the map. |
|
73 |
||
74 |
* Pixels with _alpha value_ = 0 will not be subject to collision |
|
75 |
* White pixels will be terrain |
|
151
33266ae95c27
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
106
diff
changeset
|
76 |
* Red pixels will be indestructible terrain (regardless of game mode settings) |
153
23efe87db6b6
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
152
diff
changeset
|
77 |
* 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+ |
23efe87db6b6
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
152
diff
changeset
|
78 |
* Blue pixels will be ice - 0.9.17+ |
264 | 79 |
* 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. |
96 | 80 |
|
81 |
*Examples:* |
|
264 | 82 |
* [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] |
96 | 83 |
(Transparent areas may not be recognizeable as such in your browser/image preview program, so open e.g. in [http://www.gimp.org/ Gimp]) |
84 |
||
97
0803dadcc229
Edited wiki page PresetMaps through web user interface.
sheepyluva
parents:
96
diff
changeset
|
85 |
|
96 | 86 |
=== map.lua === |
87 |
A Lua-script to be used together with the map. |
|
88 |
||
89 |
See the LuaGuide for more information on Hedgewars' scripting support. |
|
90 |
||
91 |
== Image format == |
|
92 |
* PNG, 8-bit/color RGBA (so 32 bit) |
|
105
5aafdbd7206f
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
97
diff
changeset
|
93 |
* 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: |
5aafdbd7206f
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
97
diff
changeset
|
94 |
pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB old/map.png new/map.png |
106
ee13fb16ebb5
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
105
diff
changeset
|
95 |
|
105
5aafdbd7206f
Edited wiki page PresetMaps through web user interface.
kyberneticist
parents:
97
diff
changeset
|
96 |
or be sure your image editing software has these options disabled. |
96 | 97 |
|
98 |
---- |
|
99 |
= Editing software recommendations = |
|
100 |
== Images == |
|
101 |
A vector based drawing software is recommended for creating the maps. |
|
102 |
||
103 |
(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) |
|
104 |
||
97
0803dadcc229
Edited wiki page PresetMaps through web user interface.
sheepyluva
parents:
96
diff
changeset
|
105 |
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. |