Version 1.2
Hi folks,
This tutorial is the reference guide of my understanding of maps in MB Warband and how to mod them using Thorgrim's Map Editor (TME) and imported hieghtmap and ground-types map. This is not really for absolute newbies though and often it's more or less just hints on what to do (or not) and how rather than step-by-step walkthrough.
DISCLAIMER: I am 100% sure I have missed some things or made some errors. Don't shoot me for it. Instead, help me improve it please!
Tools used:
- Thorgrim's Map Editor 0.90: http://forums.taleworlds.com/index.php/topic,5646.0.html
Famous and except for 3D converter the only mapping tool out there currently.
- Gimp: http://www.gimp.org/
Free graphic manipulation software.
Data
- SRTM-30 data: http://dds.cr.usgs.gov/srtm/version2_1/SRTM30/ (reference map of tiles: http://www.dgadv.com/srtm30/)
- CIA World DataBank II: http://www.evl.uic.edu/pape/data/WDB/
- geography map: not yet re-found
These are the raw data I found and used for generating heightmap, ground types map and rivers. This tutorial does NOT cover how to create maps for import from these. It covers only parametres and hints about what standard they should comply to.
1) Thorgrim's Map Editor - basics
2) TME - Importing in Detail
3) TME - Editing
4) TME - Parties for Warband
Changelog
Hi folks,
This tutorial is the reference guide of my understanding of maps in MB Warband and how to mod them using Thorgrim's Map Editor (TME) and imported hieghtmap and ground-types map. This is not really for absolute newbies though and often it's more or less just hints on what to do (or not) and how rather than step-by-step walkthrough.
DISCLAIMER: I am 100% sure I have missed some things or made some errors. Don't shoot me for it. Instead, help me improve it please!
Tools used:
- Thorgrim's Map Editor 0.90: http://forums.taleworlds.com/index.php/topic,5646.0.html
Famous and except for 3D converter the only mapping tool out there currently.
- Gimp: http://www.gimp.org/
Free graphic manipulation software.
Data
- SRTM-30 data: http://dds.cr.usgs.gov/srtm/version2_1/SRTM30/ (reference map of tiles: http://www.dgadv.com/srtm30/)
- CIA World DataBank II: http://www.evl.uic.edu/pape/data/WDB/
- geography map: not yet re-found
These are the raw data I found and used for generating heightmap, ground types map and rivers. This tutorial does NOT cover how to create maps for import from these. It covers only parametres and hints about what standard they should comply to.
1) Thorgrim's Map Editor - basics
From what I have learnt so far I can say only one word: DOCUMENTATION. Or rather lack of one. This section is to remedy this:
- Install it wherever you want. When you run it (provided it loaded successfully) it will say version 0.8.5 which is apparently correct despite the installer claiming it being version 0.9.0
- You have to load valid MB module via config. It does not work for Warband modules (we will come to that later).
- settings.cfg is a crucial file and requires more in-depth explanation of some options than is provided in comments:
ForestWarning=1 ; chances are very high your map will have more forests than native and this will periodically tell you about it. If you prefer not to be warned on every save set it to 0. The game does not actually crash if you have reasonably more forests as far as I can tell.
MapWidth=280 and MapHeight=280 and MapDensity=0.5 ; Now these are peculiar and it took me a while to figure them out entirely. First two specifies the size of the new map (does NOT affect the borders of the map in any way). When you select New in the menu it will create the all-ocean map of specified size with default nodes grid. The density defines the density of the nodes grid (the tiles). If you set it to 1 (or higher) the map will be twice as detailed but the same size map will be way more demanding on system resources
BorderSize=10 ; This is the offset for the border of the map in game tiles. To understand what to set here you have to know how many tiles your map will have. For instance default 280x280 map with density 0.5 will have 140x140 tiles so maximum number of border would be 70 (but that would leave no map left). In reality though there are two borders (camera border and map border) on the map and the sensible limit here is way lower than those 70 for this map. Fortunately this can be easily changed in the editor so leave it at 10 or 0 as it is far better to tweak the borders in the editor than in the config. This is especially true for imported maps as they can get distorted badly if the number here exceeds the limit given by map size.
- Leave BorderSize at 0 or 10 if you want to import maps. They get distorted a lot if the bordersize is set too high for given map size and density.
- Size of the sourcefiles is irrelevant as they get automatically scaled on import to specified size of the map. For best results however it is recommended to have them matching your density preference so every pixel on the source file actually matters.
Example: for map size 400x300 and density 0.5 your source images should be 200x150.
- MapDensity is crucial for import. Since the imported images are automatically scaled then whatever is set here determines which pixels are actually imported on the map. So, crudely speaking, if set to default 0.5 it means only every other pixel of the source map (after scaling if size does not match) will get imported.* That is the source of the weird edges and other distortions. If you set it to 1 the imported map will be "nice" but as stated earlier also very demanding unless much smaller. Warband Native sized map with twice the number of nodes is very laggy in the editor and I suppose it would be also in-game.
- To use Warband maps in TME you have to copy map.txt, map_icons.txt and parties.txt to your mapping module in MB and after the edit put them back and mirror the four map_size settings from the mapping module.ini into your warband module.ini. The better way of doing this though would be to use the editor to only create the map for Warband (put back only map.txt) and to place the parties using the module system and coordinates got from the editor ('z' ke). Alternatively place the parties using the editor but reverse engineer the resulting parties.txt eitherp manually or use this excellent tool: http://forums.taleworlds.com/index.php/topic,45772.msg1193603.html#msg1193603
- Exporting the source images does not work. For me it just spits out the screenshot in BMP althougth the actual heightmap/ground types map flashes briefly on export. Not sure how to dig it out of the exported BMP if it's there in the first place...
*I know it is not that simple as actually every pixel is imported as half tile and then merged but still this simplification works imho.
- Install it wherever you want. When you run it (provided it loaded successfully) it will say version 0.8.5 which is apparently correct despite the installer claiming it being version 0.9.0
- You have to load valid MB module via config. It does not work for Warband modules (we will come to that later).
- settings.cfg is a crucial file and requires more in-depth explanation of some options than is provided in comments:
ForestWarning=1 ; chances are very high your map will have more forests than native and this will periodically tell you about it. If you prefer not to be warned on every save set it to 0. The game does not actually crash if you have reasonably more forests as far as I can tell.
MapWidth=280 and MapHeight=280 and MapDensity=0.5 ; Now these are peculiar and it took me a while to figure them out entirely. First two specifies the size of the new map (does NOT affect the borders of the map in any way). When you select New in the menu it will create the all-ocean map of specified size with default nodes grid. The density defines the density of the nodes grid (the tiles). If you set it to 1 (or higher) the map will be twice as detailed but the same size map will be way more demanding on system resources
BorderSize=10 ; This is the offset for the border of the map in game tiles. To understand what to set here you have to know how many tiles your map will have. For instance default 280x280 map with density 0.5 will have 140x140 tiles so maximum number of border would be 70 (but that would leave no map left). In reality though there are two borders (camera border and map border) on the map and the sensible limit here is way lower than those 70 for this map. Fortunately this can be easily changed in the editor so leave it at 10 or 0 as it is far better to tweak the borders in the editor than in the config. This is especially true for imported maps as they can get distorted badly if the number here exceeds the limit given by map size.
- Leave BorderSize at 0 or 10 if you want to import maps. They get distorted a lot if the bordersize is set too high for given map size and density.
- Size of the sourcefiles is irrelevant as they get automatically scaled on import to specified size of the map. For best results however it is recommended to have them matching your density preference so every pixel on the source file actually matters.
Example: for map size 400x300 and density 0.5 your source images should be 200x150.
- MapDensity is crucial for import. Since the imported images are automatically scaled then whatever is set here determines which pixels are actually imported on the map. So, crudely speaking, if set to default 0.5 it means only every other pixel of the source map (after scaling if size does not match) will get imported.* That is the source of the weird edges and other distortions. If you set it to 1 the imported map will be "nice" but as stated earlier also very demanding unless much smaller. Warband Native sized map with twice the number of nodes is very laggy in the editor and I suppose it would be also in-game.
- To use Warband maps in TME you have to copy map.txt, map_icons.txt and parties.txt to your mapping module in MB and after the edit put them back and mirror the four map_size settings from the mapping module.ini into your warband module.ini. The better way of doing this though would be to use the editor to only create the map for Warband (put back only map.txt) and to place the parties using the module system and coordinates got from the editor ('z' ke). Alternatively place the parties using the editor but reverse engineer the resulting parties.txt eitherp manually or use this excellent tool: http://forums.taleworlds.com/index.php/topic,45772.msg1193603.html#msg1193603
- Exporting the source images does not work. For me it just spits out the screenshot in BMP althougth the actual heightmap/ground types map flashes briefly on export. Not sure how to dig it out of the exported BMP if it's there in the first place...
*I know it is not that simple as actually every pixel is imported as half tile and then merged but still this simplification works imho.
2) TME - Importing in Detail
Doing the map by hand from scratch is insane amount of work. I usually prefer doing as many stuff automatically as possible. That includes generating my source maps, importing them in correct format etc. simply to reduce the hand-work to minimum.
Here it is important to explain the difference between Warband maps and MB maps. Red curtain is camera limit while yellow one is map border (for original MB only). The Warband has no map limit set by the yellow curtain as it has this 'distant lands' feature: unlimited map span beyond the camera. Naturally larger the area beyond the camera limit more demanding the map is (also depends on level of detail like forests there etc.
So the Warband maps border is whatever you set in the MapHeight/Width settings. The vanilla Warband map size is 700x700 with yellow borders set somewhere on the line 400x300 and the actual grid of cities is 360x290 (if you set this lower with Warband map loaded some cities will end up in the corner as in 'off map' when you create new one). However if you create the map 700x700 then even with density 0.5 it will be very large and laggy. That is because Native Warband map has much lower nod density beyond it's camera borders while the newly generated map has the same density everywhere. So this is another limit of the map making for Warband. Creating the 'distant off-camera lands' like in Native is not possible due to heavy lag so it has to be reduced to some reasonable size (much smaller).
NOTE: When you import over the loaded map the nod grid is persistent. However the Native map has roads which are created by having 3 nods very close together and your imported map will get badly distorted at those places (which are many) so it does not really work. Heaving nice distant lands is good visual/immersion feature but not worth the problems on the actual map.
Long story short when selecting the size of your map off the real map select your desired area and add some for this Warband distant lands feature. I would recommend maximum 25%-50% more though with 50% being really on the verge of serious lagging with standard sized map. Expand the desired map size accordingly in the config file. So if you want the warband-native-sized map you use 360x290 and expand it by the extra amount you wish to be the distand lands beyond camera. If you chose 50% then the map size should be 540x435. Considering full grid of nodes it would be quite laggy!
The heightmap
As mentioned above, how to get the heightmap is not covered here. I use rather complex (and not free) method so it wouldn't be of much use to you anyway. But to give you some hints the SRTM-30 data and 3Dem: http://freegeographytools.com/category/3dem are the nice start. The mentioned CIA data are excellent for auto-generate rivers and especially correct shoreline since SRTM has lots of coast errors (Caspian is very off for instance).
When you generated your heightmap (or otherwise got it - some tutorials around here can also help you) you have to make it black and white where darker down to 0,0,0 is lower and brighter is higher. Save it as BMP afterwards. You have to save it as 24-bit else the editor won't read it properly.
Note about blurriness. Since the game map is 3D and the grid of nodes is rather rough (provided you use 0.5) the heightmap has to be distorted. Amount of distortion is up to you and your tastes as some may prefer rough edges while others might prefer smoother mountains etc. Try it for yourself what will suit you best. Use Gaussean as it's very modular but generally any filter will do.
NOTE: do NOT save the heightmap as greyscale or indexed image. Even if it is actually grey scaled image it has to be RGB or otherwise the editor won't read it.
Ground types map
For this applies pretty much the same general rules as for the heightmap. It is generally good idea to have the shoreline matching but due to 3D nature of the MB map it won't match as well in the end and you will have to correct it by hand afterwards. It would be matching only if you projected on the flat map which is not very likely. So is the limits of projecting 2D maps into 3D (heightmap) and covering it with another 2D map (ground types).
For ground types the source map (colour codes are in the Editor's folder) must be precise so that it does not contain any other colour AND to ensure good results upon import it should be appropriatelly rough. Lone pixels are likely to have no or little effect. If you want small forest somewhere make it 4 pixels (square) large at least to ensure it will get there. If you do this really precisely then your imported map will be exactly correct requiring only minimum amount of hand-editing.
It is also good idea to generate mountains based on the heightmap even if you still have to correct it in the editor. Select range of grey from the foothills height up and colour the ground types map at those places with mountain colour (100,100,100). Voila, upon import you you have mountains ground type all over mountains (mostly). Naturally if you like it better to paint it in the editor it is also posible and quite efficient too. Chances are you'll have to fix some places anyway.
From the mentioned CIA data the rivers can be exported. They are very many however and it will require you to choose only those you want in. Rivers are unfortunately the one feature you will have to extensively hand-edit yourself later in the editor.
For the editor to import it properly append '-c' to the name of the file. For instance map_ground_types-c.bmp.
Here it is important to explain the difference between Warband maps and MB maps. Red curtain is camera limit while yellow one is map border (for original MB only). The Warband has no map limit set by the yellow curtain as it has this 'distant lands' feature: unlimited map span beyond the camera. Naturally larger the area beyond the camera limit more demanding the map is (also depends on level of detail like forests there etc.
So the Warband maps border is whatever you set in the MapHeight/Width settings. The vanilla Warband map size is 700x700 with yellow borders set somewhere on the line 400x300 and the actual grid of cities is 360x290 (if you set this lower with Warband map loaded some cities will end up in the corner as in 'off map' when you create new one). However if you create the map 700x700 then even with density 0.5 it will be very large and laggy. That is because Native Warband map has much lower nod density beyond it's camera borders while the newly generated map has the same density everywhere. So this is another limit of the map making for Warband. Creating the 'distant off-camera lands' like in Native is not possible due to heavy lag so it has to be reduced to some reasonable size (much smaller).
NOTE: When you import over the loaded map the nod grid is persistent. However the Native map has roads which are created by having 3 nods very close together and your imported map will get badly distorted at those places (which are many) so it does not really work. Heaving nice distant lands is good visual/immersion feature but not worth the problems on the actual map.
Long story short when selecting the size of your map off the real map select your desired area and add some for this Warband distant lands feature. I would recommend maximum 25%-50% more though with 50% being really on the verge of serious lagging with standard sized map. Expand the desired map size accordingly in the config file. So if you want the warband-native-sized map you use 360x290 and expand it by the extra amount you wish to be the distand lands beyond camera. If you chose 50% then the map size should be 540x435. Considering full grid of nodes it would be quite laggy!
The heightmap
As mentioned above, how to get the heightmap is not covered here. I use rather complex (and not free) method so it wouldn't be of much use to you anyway. But to give you some hints the SRTM-30 data and 3Dem: http://freegeographytools.com/category/3dem are the nice start. The mentioned CIA data are excellent for auto-generate rivers and especially correct shoreline since SRTM has lots of coast errors (Caspian is very off for instance).
When you generated your heightmap (or otherwise got it - some tutorials around here can also help you) you have to make it black and white where darker down to 0,0,0 is lower and brighter is higher. Save it as BMP afterwards. You have to save it as 24-bit else the editor won't read it properly.
Note about blurriness. Since the game map is 3D and the grid of nodes is rather rough (provided you use 0.5) the heightmap has to be distorted. Amount of distortion is up to you and your tastes as some may prefer rough edges while others might prefer smoother mountains etc. Try it for yourself what will suit you best. Use Gaussean as it's very modular but generally any filter will do.
NOTE: do NOT save the heightmap as greyscale or indexed image. Even if it is actually grey scaled image it has to be RGB or otherwise the editor won't read it.
Ground types map
For this applies pretty much the same general rules as for the heightmap. It is generally good idea to have the shoreline matching but due to 3D nature of the MB map it won't match as well in the end and you will have to correct it by hand afterwards. It would be matching only if you projected on the flat map which is not very likely. So is the limits of projecting 2D maps into 3D (heightmap) and covering it with another 2D map (ground types).
For ground types the source map (colour codes are in the Editor's folder) must be precise so that it does not contain any other colour AND to ensure good results upon import it should be appropriatelly rough. Lone pixels are likely to have no or little effect. If you want small forest somewhere make it 4 pixels (square) large at least to ensure it will get there. If you do this really precisely then your imported map will be exactly correct requiring only minimum amount of hand-editing.
It is also good idea to generate mountains based on the heightmap even if you still have to correct it in the editor. Select range of grey from the foothills height up and colour the ground types map at those places with mountain colour (100,100,100). Voila, upon import you you have mountains ground type all over mountains (mostly). Naturally if you like it better to paint it in the editor it is also posible and quite efficient too. Chances are you'll have to fix some places anyway.
From the mentioned CIA data the rivers can be exported. They are very many however and it will require you to choose only those you want in. Rivers are unfortunately the one feature you will have to extensively hand-edit yourself later in the editor.
For the editor to import it properly append '-c' to the name of the file. For instance map_ground_types-c.bmp.
3) TME - Editing
So now you have imported your map - both heightmap and ground types and now you have to do final edits in the Editor depending on how good where your source files.
First you should adjust the borders by draging the red curtain. Adjust it where you want the camera border to be.
Once the borders are set you'll have to repair the coast. Just press F4 to disable blending and possibly F12 to disable trees and go over the coast and fix wherever is some triangle missing land texture or where land overlap with sea. After that go to Face Edit mode (far right of tools, x-y type) and double click the section of sea. It will highlight the same texture types in given area (not whole map unless all of sea is connected). Then press ctrl+S and the Editor will smooth the edges of the coast. Chances are though you'll have to hand edit some faces/nods (either in vertex mod or face edit mod) yet later to get desired look of the coast.
Rivers
Second thing to fix are the rivers. They are pretty much the mess and you should first connect all river faces and remove extra ones. Now depending on how good looking rivers you want you may opt to use more than just one face for each river tile. Similar to how roads are done in native (of 3 nodes so two faces each tile). I personally don't think it's necessary.
Before you do the smoothing of the river you should narrow it down. You can do that by hand in vertex mode (x-y) or use the automatic tool in faces mode (the 4 inward arrows). For the later double click the river to highlight it. Then use smooth tool (or press ctrl+s) the same way. Use vertex mode (z) to adjust height where your river is running upwards.
Once you are done with rivers you should go over the map and fix whatever geographical errors you will yet see and add whichever features you'd yet liked. Some ground types a little too off, too much forest (or too little) etc. etc. Having the blending disabled (F4) all the time is essential to see what is the grid like and where to click or what to change. With blending on this might be rather frustrating guess work but turn it on occassionally to see the results.
Bridges
Last thing are bridges and fords. Fords themselves are easy but bridges are harder nut to crack. On vanilla map they are placed over the hill created underneath them on the river. You cannot really get that on your imported map because the nodes are evenly spaced and dragging enough of them to the place of the bridge would leave the surrounding landscape very weird (stretched). Fortunately with some tweakings you can fit the actual bridge deck above the river so it looks fine. Just tweak the land around so that no river is seen through the bridge and you may also consider lowering surrounding land (in vertex 'z' mode) to uncover more of the bridge (the icons are rather robust vertically). For bridges it is very hard to reverse engineer the info from parties.txt so I warmly recommend this tool for updating your parties positions and rotations: http://forums.taleworlds.com/index.php/topic,45772.msg1193603.html#msg1193603
And this is it. With the finished geographical and heightmap you are ready to start adding parties which you can do for MB right away. For Warband maps I recommend doing it differently however (see next section).
First you should adjust the borders by draging the red curtain. Adjust it where you want the camera border to be.
Once the borders are set you'll have to repair the coast. Just press F4 to disable blending and possibly F12 to disable trees and go over the coast and fix wherever is some triangle missing land texture or where land overlap with sea. After that go to Face Edit mode (far right of tools, x-y type) and double click the section of sea. It will highlight the same texture types in given area (not whole map unless all of sea is connected). Then press ctrl+S and the Editor will smooth the edges of the coast. Chances are though you'll have to hand edit some faces/nods (either in vertex mod or face edit mod) yet later to get desired look of the coast.
Rivers
Second thing to fix are the rivers. They are pretty much the mess and you should first connect all river faces and remove extra ones. Now depending on how good looking rivers you want you may opt to use more than just one face for each river tile. Similar to how roads are done in native (of 3 nodes so two faces each tile). I personally don't think it's necessary.
Before you do the smoothing of the river you should narrow it down. You can do that by hand in vertex mode (x-y) or use the automatic tool in faces mode (the 4 inward arrows). For the later double click the river to highlight it. Then use smooth tool (or press ctrl+s) the same way. Use vertex mode (z) to adjust height where your river is running upwards.
Once you are done with rivers you should go over the map and fix whatever geographical errors you will yet see and add whichever features you'd yet liked. Some ground types a little too off, too much forest (or too little) etc. etc. Having the blending disabled (F4) all the time is essential to see what is the grid like and where to click or what to change. With blending on this might be rather frustrating guess work but turn it on occassionally to see the results.
Bridges
Last thing are bridges and fords. Fords themselves are easy but bridges are harder nut to crack. On vanilla map they are placed over the hill created underneath them on the river. You cannot really get that on your imported map because the nodes are evenly spaced and dragging enough of them to the place of the bridge would leave the surrounding landscape very weird (stretched). Fortunately with some tweakings you can fit the actual bridge deck above the river so it looks fine. Just tweak the land around so that no river is seen through the bridge and you may also consider lowering surrounding land (in vertex 'z' mode) to uncover more of the bridge (the icons are rather robust vertically). For bridges it is very hard to reverse engineer the info from parties.txt so I warmly recommend this tool for updating your parties positions and rotations: http://forums.taleworlds.com/index.php/topic,45772.msg1193603.html#msg1193603
And this is it. With the finished geographical and heightmap you are ready to start adding parties which you can do for MB right away. For Warband maps I recommend doing it differently however (see next section).
4) TME - Parties for Warband
NOTE: Initial announced coordinates converter tool is not working properly due to the 2D source maps being projected in 3D so no universal relation could be determined.
One way to do it is getting the map coordinates off the editor pressing 'z' on desired spot (it also copies the coordinates) and then simply paste them for given party in your module system.
Alternatively you may let the tool mentioned above update the coordinates and names if you could move them around in the editor (due to the bug not all parties are moveable in the editor for some reason): http://forums.taleworlds.com/index.php/topic,45772.msg1193603.html#msg1193603 update your module_parties.py after you are done moving them around in the editor.
Another alternative would be to add new parties in the editor but the feature is somewhat buggy often disabling many parties from further editing (even new ones freshly created). Do not forget that the added parties has to be linked in otherp files, mainly in module_scripts.py (scripts.txt) so they belong to faction you want and have everything you want them to have (town walkers, sceneries etc.). The scripts are not covered here (not yet at least .
One way to do it is getting the map coordinates off the editor pressing 'z' on desired spot (it also copies the coordinates) and then simply paste them for given party in your module system.
Alternatively you may let the tool mentioned above update the coordinates and names if you could move them around in the editor (due to the bug not all parties are moveable in the editor for some reason): http://forums.taleworlds.com/index.php/topic,45772.msg1193603.html#msg1193603 update your module_parties.py after you are done moving them around in the editor.
Another alternative would be to add new parties in the editor but the feature is somewhat buggy often disabling many parties from further editing (even new ones freshly created). Do not forget that the added parties has to be linked in otherp files, mainly in module_scripts.py (scripts.txt) so they belong to faction you want and have everything you want them to have (town walkers, sceneries etc.). The scripts are not covered here (not yet at least .
Changelog
1.2
- Added 'bridges' section
- Provided link for reverse engineering of parties.txt
- Various minor corrections and updates
- Added changelog
1.1
- Various minor corrections and updates
- Use of spoilers for each section
- Finished 4th section
1.0
- First release
- Added 'bridges' section
- Provided link for reverse engineering of parties.txt
- Various minor corrections and updates
- Added changelog
1.1
- Various minor corrections and updates
- Use of spoilers for each section
- Finished 4th section
1.0
- First release