Typemap File
Moderator: Moderators
Typemap File
First what should its size be? Same as heightmap dimensions, or one less ie 1/8 Texture size? It's not in the Wiki and it should be added.
I have tried both sizes but keep getting holes in my typemap in game. My typemaps use lots of contrast like 0 and 255. What seems to be happening is the map is getting resampled and I get an intermediate value 127 at some boundaries. The same thing could happen with incremental values but it would be less obvious, no holes just wrong types.
Any ideas or fixes would be greatly appreciated.
I have tried both sizes but keep getting holes in my typemap in game. My typemaps use lots of contrast like 0 and 255. What seems to be happening is the map is getting resampled and I get an intermediate value 127 at some boundaries. The same thing could happen with incremental values but it would be less obvious, no holes just wrong types.
Any ideas or fixes would be greatly appreciated.
I can't find any docs about how to work it...
but search the forums and check a couple SMDs for specifics...
make a grayscale image where each terrain type is a specific shade, the "whiteness" of the terrain will be a type, so when compiling, you include this in the mapconv and any ground that is shade 1 will be TERRAINTYPE1, and so-on... Someone who knows and has tried all this add it to the wiki...
but search the forums and check a couple SMDs for specifics...
make a grayscale image where each terrain type is a specific shade, the "whiteness" of the terrain will be a type, so when compiling, you include this in the mapconv and any ground that is shade 1 will be TERRAINTYPE1, and so-on... Someone who knows and has tried all this add it to the wiki...
I'm pretty sure only the red channel gets read. But Sinbad has somed it up quite well.
You make a map, the size I'd like some clarification on, where you set a shade for each area of the map that you wish to have different properties, see the SMD sample below to see what you can change.
HINT:
If you use L3DT there is a trick you can do to get around the lousy export method. Make some solid colour textures in different shades of grey, edit the climate file to use them then make a low res texture map. You can use this as a typemap straight away or edit a bit.
If you want to simplify the map try some noise removing filters then posterise or reduce colour depth to remove any intermediate shades.
I have edited this SMD code a little for ease of reading.
My observations;
- Use underscores for spaces in the name if you use a space nothing after it will show.
- Hardness multipies if you set base hardness to 100 and terraintype hardness to 20 actual hardness will be 2000.
You make a map, the size I'd like some clarification on, where you set a shade for each area of the map that you wish to have different properties, see the SMD sample below to see what you can change.
HINT:
If you use L3DT there is a trick you can do to get around the lousy export method. Make some solid colour textures in different shades of grey, edit the climate file to use them then make a low res texture map. You can use this as a typemap straight away or edit a bit.
If you want to simplify the map try some noise removing filters then posterise or reduce colour depth to remove any intermediate shades.
I have edited this SMD code a little for ease of reading.
Code: Select all
[TERRAINTYPE0]
//which terrain type goes where on the map is determined by the typemap
{
name=Rock;
//human visible identifier of the terrain type
hardness=200;
//multiplier of the global maphardness value (default value=1)
tankmovespeed=0.8;
//multiplier of tank units speed after slope mods etc has been applied (default value=1)
kbotmovespeed=0.8;
//multiplier of kbot units speed after slope mods etc has been applied (default value=1)
hovermovespeed=0.8;
//multiplier of hover units speed after slope mods etc has been applied (default value=1)
shipmovespeed=0.8;
//multiplier of ship units speed after slope mods etc has been applied (default value=1)
}
[TERRAINTYPE102]
//which terrain type goes where on the map is determined by the typemap
{
name=Baked_Earth;
//human visible identifier of the terrain type
hardness=50;
//multiplier of the global maphardness value (default value=1)
tankmovespeed=1.2;
//multiplier of tank units speed after slope mods etc has been applied (default value=1)
kbotmovespeed=1.2;
//multiplier of kbot units speed after slope mods etc has been applied (default value=1)
hovermovespeed=1.2;
//multiplier of hover units speed after slope mods etc has been applied (default value=1)
shipmovespeed=1.2;
//multiplier of ship units speed after slope mods etc has been applied (default value=1)
}
[TERRAINTYPE255]
//which terrain type goes where on the map is determined by the typemap
{
name=Compacted_Salt;
//human visible identifier of the terrain type
hardness=10;
//multiplier of the global maphardness value (default value=1)
tankmovespeed=1;
//multiplier of tank units speed after slope mods etc has been applied (default value=1)
kbotmovespeed=1;
//multiplier of kbot units speed after slope mods etc has been applied (default value=1)
hovermovespeed=1;
//multiplier of hover units speed after slope mods etc has been applied (default value=1)
shipmovespeed=1;
//multiplier of ship units speed after slope mods etc has been applied (default value=1)
}
- Use underscores for spaces in the name if you use a space nothing after it will show.
- Hardness multipies if you set base hardness to 100 and terraintype hardness to 20 actual hardness will be 2000.
Found this advise from zwzsg from a while back.
So I've found my answer but still have a bug. I have confirmed that castles does the same on one side of the castles. Look at the point one terrian type changes to another some pixels will display as terrain type default.zwzsg wrote:genblood: you create yet another bmp, same size as heightmap.
Give a different color to each kind of terrain:
- All colors with red=0 will be terrain type 0.
- All colors with red=1 will be terrain type 1.
- Etc...
Then add -y "your_terrain.bmp" to the mapconv commandline.
Wow...
This could be used for some interesting things, now that I think about how powerful it makes the Spring mapping system. You could do "Pincushion" with pure landscape by making the spires of a tougher "rock" material. It would also look nice on city maps like "Trout Farm" and "Attack On Suburbia" where there's both road and forest - the road areas can be of a harder material more conducive to vehicles.
Damn, I really want to see Trout Farm now. But alas, I am too lazy to do it myself.
Edit: what happens if a speed is 0? Does the unit just get stuck? Or treat it as navigational impasse intelligently (drive around it, etc.). If the latter, it could be neat to create zones that are totally unit-specific. Like swamp/quicksand that is mainly for hovercraft only, and K-bots can move super-slow through it but vehicles can't manage it at all.
Damn, I really want to see Trout Farm now. But alas, I am too lazy to do it myself.
Edit: what happens if a speed is 0? Does the unit just get stuck? Or treat it as navigational impasse intelligently (drive around it, etc.). If the latter, it could be neat to create zones that are totally unit-specific. Like swamp/quicksand that is mainly for hovercraft only, and K-bots can move super-slow through it but vehicles can't manage it at all.
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
Do the "" work, allowing the usage of spaces in the name?Weaver wrote:...My observations;Code: Select all
... name=Baked_Earth; //human visible identifier of the terrain type ...
- Use underscores for spaces in the name if you use a space nothing after it will show.
...
Code: Select all
name="Baked Earth";
- SwiftSpear
- Classic Community Lead
- Posts: 7287
- Joined: 12 Aug 2005, 09:29
Indeed, but it's still incovenient, expecially when changing terrain hardness because you can get single pixle sinkholes between what would normally be a solid typemap change, expecially when dealing with large explosion map deformation. It would be great if typemaps would pad one pixle and any overlap would be seemless with the smaller typemap # taking precident, thus removing accidental blank space between typemap seams.Gnome wrote:That's probably just because of the discrepency in pixel size between the texture map and typemap. The typemap is 1/8 the resolution, so it gets stretched and made a bit inaccurate.
When I tried that I gotPauloMorfeo wrote:Do the "" work, allowing the usage of spaces in the name?Code: Select all
name="Baked Earth";
Terrain Type "Baked
The underscore is the way to do it as the _ shows as a space ingame so it's no problem.
On TerrainType holes...
I have tried a few things;
- Using a much bigger typemap causes no compiler errors but has the same ingame problems.
- Using colour values, 0, 1, 2, etc. Then use them for areas where its ok if there is some terraintype1 between terriantype0 and terraintype2. This should leave no holes and is probably the best solution for now.
Units will not get stuck they will navigate around, this pretty much what terraintypes were intended for.Pxtl wrote:Edit: what happens if a speed is 0? Does the unit just get stuck? Or treat it as navigational impasse intelligently (drive around it, etc.). If the latter, it could be neat to create zones that are totally unit-specific. Like swamp/quicksand that is mainly for hovercraft only, and K-bots can move super-slow through it but vehicles can't manage it at all.
Maybe I was wrong, try other resolution of terraintype, such as same resolution of texture, or resolution of texture +1, or.... , and maybe it'll work better! I know that for metal/geo you can use different resolutions and mapconv, or Spring, I don't know, will stretch them so they fit. I noticed when making Azure Rampart that at the limit between terrain type there was a thin line with a wrong terrain type. To fix that I made sure terrain that are adjacent use the closest colors, so when the color average inbetween you can't get a different type of terrain, but that isn't a very good solution.Weaver wrote:Found this advise from zwzsg from a while back.So I've found my answer but still have a bug. I have confirmed that castles does the same on one side of the castles. Look at the point one terrian type changes to another some pixels will display as terrain type default.zwzsg wrote:genblood: you create yet another bmp, same size as heightmap.
Give a different color to each kind of terrain:
- All colors with red=0 will be terrain type 0.
- All colors with red=1 will be terrain type 1.
- Etc...
Then add -y "your_terrain.bmp" to the mapconv commandline.