How to fix your map environment?

Since I’ve revised my custom tilesets of “Die Macht des Feuers” the environment of my first map “Talras” wasn’t displayed correctly by editor anymore.
There were only red textures left on the whole map because it still used the old tileset ids, so I started to create the new list of my new custom tileset ids.

Unfortunately the tilesetter tool of the Grim Extension Pack seemed to be bugged (I used it by writing //! external TileSetter ). As I did not find any source code of the tilesetter tool I had to write my own tilesetter tool.
This documentation explains how map environment is saved.
As I planned to write some environment read- and writing code anyway (for the wc3lib project) I started to write a little C++ programm which allows you to replace some tilepoint data in the “war3map.w3e” file of any Warcraft 3 map which contains the environment data (tilepoints) of the map.
Most things seemed to work correctly but water height was to big, so I had to calculate the original height by using the display water height formula of the mentioned documentation and decrease the water height of all tilepoints by 512 (which should be 2 cliff levels considering the formula).
One interesting thing about my corrupted map tileset was that there were much more tileset ids than 16 (which is maximum) which all had value 0.
I don’t know how this could be happen, maybe it’s a bug of the tilesetter tool or maybe it was because I wrote my custom CliffTypes.slk file.
Finally everything seems to work correctly NOW and I dropped all cliff types.
Cliffs are created by elevation brush of terrain editor now.
You have to define your custom values in file “UI/MiscData.txt” (category “[Terrain]”, set value “MaxSlope” to 90 and maybe increase value “MaxHeight” and decrease value “MinHeight”) if you want to place nice vertical cliffs.
The bad thing about all those changes is that I’ve lost much time and I’ll have to replace all cliffs but the good thing is that there will be much nicer cliffs, more space on map and 16 different tileset ids.
In the end I want to show some “Joy of Terrain” and of course the code of my C++ program which hopefully will be available in a much better way in my wc3lib project someday:
Some weird terrain of my map "Talras" after trying to fix the environment file.

Link to C++ program source code

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: