Professional Documents
Culture Documents
Contents
Required installations:........................................................................................................................................2
A Note to GIMP users........................................................................................................................................2
First steps - Modding of the modding folder (I love those word plays)............................................................2
Know your GIMP...............................................................................................................................................3
The map files......................................................................................................................................................4
Outline................................................................................................................................................................5
Filling.................................................................................................................................................................6
Layers.................................................................................................................................................................6
High creation......................................................................................................................................................6
Down from the height, onto the ground.............................................................................................................6
A Region, my kingdom for a region..................................................................................................................7
More features.....................................................................................................................................................8
I like tropical climate.........................................................................................................................................8
Of fog and water.................................................................................................................................................9
And then there were leftovers............................................................................................................................9
Other non-essential graphic files........................................................................................................................9
All the text..........................................................................................................................................................9
Configuration.cfg file.......................................................................................................................................13
Additonal Links................................................................................................................................................14
Required installations:
1. The GIMP, a free graphics program
2. ‘Bare Geomod Kingdoms’, a basic Kingdoms folder
3. M2TW Kingdoms Expansion
4. Map of Iceland
First steps - Modding of the modding folder (I love those word plays)
The ‘Bare Geomod’ installation will have created a new directory in M2TW\mods (provided you followed
instructions) that is aptly named ‘bare_geomod’. For the purpose of this tutorial, I want you to rename it
‘MyMapping’.
Small warning: if you do not type the names of files or directories in the way it is done here you will have a
CTD, so please don’t rush!
After this, we need to turn our attention to the ‘configuration.cfg’ file in that directory. Open the file with
Notepad and change this entry ‘mod = mods/Bare_Geomod’ to read ‘mod = mods/MyMapping’. Save and
exit. For those of you curious enough to have a look at the rest of the file: we will come back to a few of
these entries later.
Unfortunately this nifty installation does not come with a map directory, which means more hard work for
us. Create the following directory: data\world\maps\base. Once done repeat the fun and create this directory:
data\world\maps\campaign\imperial_campaign.
Here now the last preparation: create a new text file in the data\world\maps\base directory by right clicking
in an empty space of that directory; choose ‘New’ and then ‘Text Document’. Name this document
‘descr_terrain’. Copy the following lines into this file, save and exit:
dimensions
{
width 225
height 250
}
heights
{
min_sea_height -3122.256
max_land_height 7511.272
}
roughness
{
min 50.000
max 200.000
}
fractal
{
multiplier 0.500
}
lattitude
{
min 22.000
max 56.000
}
I can hear a complaint: ‘Why didn’t we copy this file from the M2TW directory?’ Answer one: ‘Oops.’
Answer two: ‘Teaching you basic file creating so you don’t have an excuse when I am asking you to create a
file’.
Copy the ‘Iceland.gif’ file into the maps\base directory.
Note: the maximum value for the numbers marked in green is 510 for width and 510 for height.
As a good exercise, we will convert the format and change the size of the ‘Iceland.gif’ file. Right click the
file and choose ‘Edit with the GIMP’. For the sake of convention, I will call the window with the map ‘Pic
window’ and the window with the tool options ‘Tool window’.
A note on resizing: any graphics program will slightly ‘distort’ (changing the RGB value of pixels) a picture
while resizing it. That is quite a cool feature when working with the picture of your dear and beloved ones,
but it is disastrous when working on map files that depend on certain RGB values. We come to the meaning
of ‘RGB’ right now. In the pic window go to ‘image\scale image’. Next to the Width and Height indicators
is a chain symbol. Click on it to disable automatic scaling. Enter 451 for Width and 501 for Height. These
are double the values in our descr_terrain file plus one pixel in case someone wonders. Look a bit further
down in that small window and you see a ‘Quality’ segment. In the ’Interpolation’ drop down list choose
‘None’, this prevents distortion.
Now click ‘Scale’. The pic looks rather small now and we will give it a new name. Click on ‘file\save as’. In
the new window, type ‘Map_big.tga’ in the name space. Take note of the new file extension – it will make
our life a bit easier as all the map files are in tga format. Clicking on a tga file should also trigger the GIMP
to open it (unless you have another sophisticated program like Photoshop already installed). Now click
‘Save’ twice. Close the pic window (exit).
The creation process starts with map_heights. We will use Map_big.tga to create this file. But first we
follow the first golden rule of modding: back up! To do this, simply right click the tga file in Explorer,
choose copy and then right click the folder on the left pane of Explorer and choose paste. This will create a
file that will be named ‘Copy of Map_big’
Note: every time you change your map files and want to run the game you need to delete the old map.rwm
file. The game will generate a new file from your map files.
Outline
I will introduce you now to one of the good friends of the mapper: the layer mode. It is relative easy to
obtain (definitely easier than Nirvana). In the tool window, click on ‘file\ new’. In the ‘Fill with’ option
choose ‘Transparency’. If you tend to be vain or have that urge to be recognized, change the ‘Comment’
entry to reflect your name. Change the size to 451 x 501. Click ‘OK’. You now have a nice checkered empty
area. These ‘checks’ indicate transparency in the GIMP program.
Back to the layer business: in the pic window click ‘file\open as layers’ and choose ‘Map_Big’ by double
clicking. To help you control the two layers (big_map and transparent new) activate the pic window and
press Ctrl L. One more window pops up: ‘Layers’. Most of it should be self-explanatory. If we want to trace
the coastline of the map, we have to move the ‘background’ layer to the top. Highlight ‘background’ and
click on the upwards arrow. Apparently, nothing changed in the pic window. But then how do you tell if the
transparency is on top? Only when looking at the ‘layers’ window for the time being is the answer. Let’s
work with it.
In the tools window click on the pencil icon. Then change the brush size to 1 by clicking on the box with the
dot in the bottom part of the window and then choosing the smallest dot. In the area next to ‘Brush’ you
should now see ‘Circle (01)’. Now click on the black rectangle in the upper part of the window. A new
window will open: ‘Change Foreground Color’. This is the window were you set your custom colors. If you
look closer, you will have solved the riddle of the RGB: there are three horizontal lines that have these
letters in front of them. We will only concentrate on these, the other three are not important for us for this
tutorial. The values are 0,0,0 – change this value to 1,1,1. Close this window by clicking ‘OK’.
Our scale of the pic window will make it difficult for us to work with a brush size this small, so let’s go big!
Activate the window by clicking on its frame and press ‘Shift +’ six times. That should do it and a little
window at the bottom left should show read now 800%. In the layer window highlight the ‘background’
layer and then go ahead and trace the coastal outline. Make sure there are no gaps between the pixels!
STOP! Let me first introduce you to my personal friend the ‘Undo’ button. He sits in the pic window under
‘edit’. Somewhat awkward and long winded, that’s why the shortcut is ‘Ctrl Z’. Now off you go and have
fun with your paint box!
Once you are finished with the outline, reduce the scale of the pic window to 100% (remember, bottom left)
and check for inland water bodies (fancy word for lakes). These will also need to be outlined, but Iceland
hasn’t got any lakes. There is a little island to the South West of the mainland (bottom left for geographical
challenged individuals), put a line around that as well. Now we have to save the masterpiece. Activate the
‘layers’ window and check that the ‘opacity’ slider is all the way the right. (Just in case you have been
playing with it). Activate the pic window and click on ‘file\save as’. Enter ‘map_heights.tga’ as name, click
‘Save’, ‘Export’, ‘Save’ when it comes up.
Filling
Time to introduce you to a new tool: the paint bucket. On the tools window click the icon that looks like an
overflowing bucket. Scroll down the lower portion of the window until you come to a slider labeled
‘Threshold’. Make sure it reads 0.0 by sliding it all the way to left. Now fill the area in between your tracing
with the current color. Should everything go black than you didn’t listen to me earlier on and left a gap
between the pixels. Go see my good friend ‘Undo’ and find the error. If you are about to go nuts, change the
brush size to 3 or 5 and redraw the coastal outline. Now simply save your work (pic window, file\save click
export), I will show you what layers can be about.
Layers
Activate the ‘layers’ window and make sure the ‘background’ layer is high lighted. Now move the slider to
the left. Nifty, isn’t it? This will come very handy later on. Just remember this: when saving, make sure that
the slider is all the way to the right. The correct file name has to be displayed on top of the pic window as
well, else you will have to ‘Save as’ instead of ‘Save’.
We’ve got the land, we need the sea: fill the rest of map_heights with the RGB value 0,0,253. Now check
your coast line at 800% to make sure all pixels are either black or blue, it will save a lot of heart ache later
on. Save. Close pic window (exit). One file done!
Note: if your top layer has still got transparency in it you will have to remove the other layers before saving.
Simply highlight the other layer and click on the dustbin. If you need to save that layer as well, move it to
the top, opacity on 100, check correct filename, save and then remove.
High creation
This is one chapter where your artistic side will be challenged. You obviously don’t want a huge flat map.
Iceland got mountains, right? Fortunately our map_big file has got contour colors. The first step will be to
save the current map (map_heights) as ‘map_base.tga’. Open it again if you have taken a break and then
save it as ‘map_base.tga’. The reason for this will be revealed at a later stage. (I do love a little suspense.)
Now open map_big as layers, move it to the bottom and slide the opacity to the left until you can
comfortably see those contours (map_base at the bottom, map_heights on top and selected when using the
slider). Change RGB to 20, 20, 20 and trace the first (lowest) contour line, fill with the same RGB value
when finished. Change to 50, 50, 50 and do the dark green contour (don’t forget filling), follow it up with
90, 90, 90 for the white contour (which you fill as well…).
With a little imagination, you will realize that this is going to look like the rice terraces in Cambodia and not
like mountains. This is where creativity comes in. And a new GIMP tool: smudge. It is located on the right
of the third row in the tool window. Set the brush size to 3 (or 5 if you are adventurous) and use it to ‘blur’
the differences between the shades of grey. The same way can be used to create little hills. You might have
realized by now that the numbers in the RGB values are the same. It is called grey shade. And the lighter the
shade, the higher the mountain. Don’t forget to save your master pieces as map_heights! Right now it is
called map_base, that one we still need. A tip for the future: always leave one pixel of 1, 1, 1 at the edge of
waterbodies, it makes the shore look proper, even if you want sheer cliffs.
Never use 0,0,0 – this looks black but gets created as water. The famous ‘Ragusa port bug’ is the result of
the use of this RGB value.
Note: The best way to avoid smudging the blue (water) is by selecting the blue color with the Color Tool
(Shift+O) and then invert the selection (Ctlr+I), that way you can only work on the landmass.
Note: You will require 10 or more (depending on your map size) regions to have a stable, playable
More features
The map_features file is the one that will (at more complex maps certainly) give you the most head ache. A
simple misplacement of a pixel can cause a crash here, so pay attention closely.
First step will be to reduce the size of Map_big to default (225*250) and save it as Map_small.tga. Done?
You are getting good at this. (You didn’t forget about to set the interpolation to ‘None’, didn’t you?)
Step two will be to open a new layer. (I didn’t say: close map_small, so it should still be open) Press
CTRL+L to open the layers dialog box. Click on the bottom left button to create a new, transparent layer.
Change your color to 0, 0, 255 and trace all the rivers on the map. STOP! This is where 99% of errors on
this map file occur. Diagonal ‘connections’ will not work – the river will not be visible from this point on in
the campaign map. Example picture underneath.
Red indicates a missing pixel. Green indicates a surplus pixel. Yellow is a valid branch.
Once you have got all the rivers in place (extend the river two pixels beyond the coastline to create a proper
‘mouth’), change the color to 255, 255, 255 and place a single pixel at the source (spring) of each river. If
you want to cross the river or have the urge to build a nice bridge replace a blue single pixel of 0, 0, 255
with 0, 255, 255. Once you are finished with all the river stuff fill in the rest of the area with 0,0,0 (not
absolutely necessary), delete the map_small layer and save as ‘map_features.tga’.
Other features that you can place are cliffs, land bridges (remember the Bosporus or Straits of Gibraltar?)
and volcanoes, these will not cause any CTD if placed wrongly, just some embarrassment. The valid RGB
codes are here:
descr_regions.txt……………………………………………
London_Province
London
england
English_Rebels
31 224 31
none
5
4
religions { catholic 85 orthodox 0 islam 0 pagan 13 heretic 2 }
Paris_Province
Paris
france
French_Rebels
232 41 46
none
5
5
religions { catholic 85 orthodox 0 islam 0 pagan 10 heretic 5 }
……………………………………………………………………
descr_sounds_music_types.txt……………………………….
music_type northern_european
; england
regions London_Province
; france
regions Paris_Province
factions england france
……………………………………………………………………
The data file for the region names in the data\text folder. Important: the funny sign has to be in the first line!
Note: you have to save this file in UNICODE format, click on the drop down menu ‘encoding’ when using
‘Save As’ and choose UNICODE.
For more detailed information see this tutorial.
imperial_campaign_regions_and_settlement_names.txt……
¬
{London_Province}London Region
{London}London
{Paris_Province}Paris Region
{Paris}Paris
……………………………………………………………………
campaign_script.txt……………………………………………
script
restrict_strat_radar false
end_script
……………………………………………………………………
descr_strat.txt…………………………………………...............
campaign imperial_campaign
playable
england
france
end
unlockable
end
nonplayable
slave
end
marian_reforms_disabled
rebelling_characters_active
gladiator_uprising_disabled
night_battles_enabled
;show_date_as_turns
brigand_spawn_value 60
pirate_spawn_value 90
year_founded 0
population 3800
plan_set default_set
faction_creator england
building
{
type core_building wooden_wall
}
building
{
type barracks town_guard
}
building
{
type temple_catholic small_church
}
building
{
type city_hall town_hall
}
building
{
type market corn_exchange
}
building
{
type hinterland_roads roads
}
}
character William, named character, male, leader, age 40, x 73, y 129
traits Factionleader 1 , GoodCommander 1 , Intelligent 2 , VictorVirtue 3 , PublicFaith 2 , BattleDread 2 ,
StrategyDread 2 , ReligionStarter 1
army
unit NE Bodyguard exp 1 armour 0 weapon_lvl 0
unit Spear Militia exp 0 armour 0 weapon_lvl 0
unit Spear Militia exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0
unit Peasants exp 0 armour 0 weapon_lvl 0
year_founded 0
population 3800
plan_set default_set
faction_creator france
building
{
type core_building wooden_wall
}
building
{
type barracks town_guard
}
building
{
type temple_catholic small_church
}
building
{
type city_hall town_hall
}
building
{
type market corn_exchange
}
building
{
type hinterland_roads roads
}
}
script
campaign_script.txt
……………………………………………………………………
The following two files are blank (no entry what so ever): descr_mercenaries.txt and
descr_win_conditions.txt
Configuration.cfg file
The provided file is set up for ‘Hotseat’ games and the Battle Editor is enabled.
The following line (green) will be of interest to the hard core modders:
[video]
windowed = false ## used for modding
Change the value from false to true to have a window in which the game runs. This makes it unnecessary to
exit the game if you wish to make changes in the original files. Just remember that you have to delete the
map.rwm file and restart your game for map changes to take effect. If you do changes midway through a
campaign and delete map.rwm you might get some weird results. You have been warned.
[log]
to = logs/M2TW.system.log.txt
level = * error
This value can be changed to ‘trace’ to get a more detailed look (MBs of it) of what is going on. Only
change this if the normal (error) log does not give you a clue what is going on. Chances are not very good
then either, but it doesn’t hurt to try.
And that is the end of the tutorial. Click on the ‘Executable’ to drool over your accomplishment.
Additonal Links
If you want to learn more about adding regions properly and other mapping issues, have a look at my other
tutorials at the TWCentre (in the list below). Other helpful stuff from this author and other great thinkers:
---
Creating a World - Functional Grape Shot
---
Creating a World - Replacing Strat Models
---
Creating a World - Adding a Culture
---
Creating a World - Using the Install Creator
---
Creating a World - Adding a new Faction
---
Creating a World - Height Map with 3Dem
---
Creating a World – Adding detailed Regions
---
Creating a World – Map Templates with Worldwind
---
Creating a World – Bare Kingdoms
---
Creating a World – Name Converter
---
Creating a World – The Grail of the seven Forts
---
Creating a World – Formatted Campaign ModelDB files
---
MapMod: Trees, Textures, Sea v1.0
---
New strat models for castles by Agart
---
Crashes and how to fix them by uanime5
---
Shared, Tooltips and Strat.txt
---
StringBin Converter
---
GeoMod Tool