Typemap File

Typemap File

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

Post Reply
User avatar
Weaver
Posts: 644
Joined: 07 Jul 2005, 21:15

Typemap File

Post by Weaver »

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.
User avatar
Imperator
Posts: 85
Joined: 13 Oct 2005, 00:04

Post by Imperator »

what does a typemap do and how does one use it? there seems to be no documentaton of that, someone please update that ...
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

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...
User avatar
Weaver
Posts: 644
Joined: 07 Jul 2005, 21:15

Post by Weaver »

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.

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)
	}
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.
User avatar
Weaver
Posts: 644
Joined: 07 Jul 2005, 21:15

Post by Weaver »

Found this advise from zwzsg from a while back.
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.
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.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

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.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Wow...

Post by Pxtl »

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.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Weaver wrote:...

Code: Select all

...
name=Baked_Earth;			
//human visible identifier of the terrain type
...
My observations;
- Use underscores for spaces in the name if you use a space nothing after it will show.
...
Do the "" work, allowing the usage of spaces in the name?

Code: Select all

name="Baked Earth";
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

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.
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.
User avatar
Weaver
Posts: 644
Joined: 07 Jul 2005, 21:15

Post by Weaver »

PauloMorfeo wrote:Do the "" work, allowing the usage of spaces in the name?

Code: Select all

name="Baked Earth";
When I tried that I got
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.
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.
Units will not get stuck they will navigate around, this pretty much what terraintypes were intended for.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Weaver wrote:Found this advise from zwzsg from a while back.
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.
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.
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.
Post Reply

Return to “Map Creation”