Mapdev:terraintype: Difference between revisions
m 1cat |
m →Image File: added overrides |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 8: | Line 8: | ||
|} | |} | ||
</center> | </center> | ||
{{ | {{Caution|The use of type maps for unit speed adjustment is discouraged; due to the way units are automatically assigned to categories and the invisible nature of the type map it makes game play unpredictable.}} | ||
Spring already provides speed alteration, with pathing optimisation based on terrain incline. Units will always take the "road" if its completely flat and have to travel a fair distance along otherwise uneven terrain. | Spring already provides speed alteration, with pathing optimisation based on terrain incline. Units will always take the "road" if its completely flat and have to travel a fair distance along otherwise uneven terrain. | ||
| Line 23: | Line 22: | ||
<code><pre>local mapinfo = { | <code><pre>local mapinfo = { | ||
... | ... | ||
smf = { | |||
.... | |||
typemapTex = "", | |||
.... | |||
}, | |||
... | |||
terrainTypes = { | terrainTypes = { | ||
[0] = { | [0] = { | ||
| Line 47: | Line 52: | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
! width="15%" | File Location | ! width="15%" | File Location | ||
| The metal map is an intermediary file compiled into the SMF file using [[MapConv]] or [[MapConvNG]]. | | The metal map is an intermediary file compiled into the SMF file using [[MapConv]] or [[MapConvNG]], it can also be specified in the mapinfo.lua | ||
|- | |- | ||
! File Format | ! File Format | ||
| Line 56: | Line 61: | ||
|- | |- | ||
! Channels | ! Channels | ||
| | | Greyscale | ||
|- | |- | ||
! Resolution | ! Resolution | ||
| Line 62: | Line 67: | ||
{| class="wikitable" style="text-align: center;" | {| class="wikitable" style="text-align: center;" | ||
!Spring Map Size<sup>*</sup> | !Spring Map Size<sup>*</sup> | ||
!pixels = Spring Map Size * | !pixels = Spring Map Size * 32 | ||
|- | |- | ||
| 2 | | 2 | ||
| | | 64 | ||
|- | |- | ||
| 4 | | 4 | ||
| | | 128 | ||
|- | |- | ||
| 6 | | 6 | ||
| | | 192 | ||
|- | |- | ||
| ... | | ... | ||
| Line 77: | Line 82: | ||
|- | |- | ||
| 32 | | 32 | ||
| | | 1024 | ||
|- | |- | ||
| style="text-align: left;font-style:italic" colspan=2 | * must be multiples of 2 | | style="text-align: left;font-style:italic" colspan=2 | * must be multiples of 2 | ||
Latest revision as of 05:05, 19 April 2015
Terrain Types
Type Maps or terrain Types allow altering the speed of units, and the mount of deformation.
| (FIXME: Example typemap) |
| Example Typemap |
|---|
Spring already provides speed alteration, with pathing optimisation based on terrain incline. Units will always take the "road" if its completely flat and have to travel a fair distance along otherwise uneven terrain.
Type maps use in deformation can show distinction between terrains like sand, rock, etc. This will suffer from edges between hardness levels having different heights after deformation, however it can be somewhat mitigated by making transitional typemaps with multiple hardness levels.
Use sparingly, with obvious visual indicators in the texture image.
Specification
mapinfo.lua
The relevant sections of the mapinfo.lua file are in the terrainTypes subtable
local mapinfo = {
...
smf = {
....
typemapTex = "",
....
},
...
terrainTypes = {
[0] = {
name = "Default",
hardness = 1.0,
receiveTracks = true,
moveSpeeds = {
tank = 1.0,
kbot = 1.0,
hover = 1.0,
ship = 1.0,
},
},
[1] = {
...
},
...
},
...
}
Image File
An 8bpp greyscale image has 256 values for grey. each value represents a different terrain type, so you can have 256 different terrains, starting at zero(black)(default) to 255(white)
| File Location | The metal map is an intermediary file compiled into the SMF file using MapConv or MapConvNG, it can also be specified in the mapinfo.lua | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| File Format | Any that the Mapconv programs support | ||||||||||||||
| Colour Depth | 8bpp | ||||||||||||||
| Channels | Greyscale | ||||||||||||||
| Resolution |
| ||||||||||||||