CHAPTER 2
The files you need for the map to load up
After we created our coastline we - of course - want to see how it looks in game. Getting this done can be pretty frustrating due to the fact that the ck2 engine can bug out at various stages of the loading process without providing much information about the reason(s).
This chapter will detail how to make a map mod load up as quick as possible. The end result can be downloaded here:
http://www.mediafire.com/download/npt0df5i6rt85h5/Ireland_chapter2.7z
Version for CK2 2.5 (tbr):
http://www.mediafire.com/download/o6o8rjkzp82rff9/Ireland_chapter2_v2.5.rar
I. Map Files
Map files are very important for the look and feel of a mod. Many of them deserve a chapter of their own.
1. topology.bmp
This file determines the height of every point of the map (land and ocean) based upon how dark each pixel is. For this purpose grey scale RGB colors are used. A grey scale color is a color that has three identical numbers for the three properties red, green and blue: 0/0/0, 1/1/1, ... 255/255/255.
As a rule of thumb you should use 94/94/94 as your highest color for anything under water and 96/96/96 and above for things above the water level. 95/95/95 is technically under water, too, but should be avoided. Theoretically 255/255/255 (white) can be used for the highest mountains but keep in mind that the highest peaks vanilla CK2 has are ~230/230/230.
For this chapter we won't put a lot of effort into this and just use two colors: One for land and one for water.
First thing we do is copy over the topology.bmp to our mod folder (<modfolder>/map). If necessary we resize it to our map size. Then we take our black and white map we drew in chapter one and paint-bucket 94/94/94 over white and 96/96/96 over black. Make sure that no anti-aliasing took place. Finally paste it into topology.bmp, flatten the file (i.e. merge all layers) and save it.
2. terrain.bmp
This file defines what terrain types are present in each province. Please note that this file's contents has an effect on the appearance of the map as terrain type changes the texture used on the map. The types of terrain are listed in map\terrain.txt; You can look at the file's color table to see the available colors.
For this chapter we won't put a lot of effort into this and just use two colors: One for land and one for water.
First thing we do is copy over the terrain.bmp to our mod folder (<modfolder>/map). If necessary we resize it to our map size. Then we take our black and white map we drew in chapter one and paint-bucket the blue that is used for vanilla ocean over white and the green that is used in vanilla grass lands over black. Make sure that no anti-aliasing took place. Finally paste it into terrain.bmp, flatten the file (i.e. merge all layers) and save it.
If you ask yourself "why should I copy the vanilla file in the first place?" here's why: All the map files except provinces and world_normal_height have an index. That is a pre-set selection of colors that can be used. In Photoshop you can view it by clicking "Image > Mode > Color Table ...".
It is vital to use a color index that corresponds (in the case of terrain.bmp) to the available terrain types.
Here's the one terrain.bmp is using:
3. rivers.bmp
This file is to add non-navigable rivers to the map. It is again a file with a limited number of allowed colors. Different shades of blue can be used to create rivers of different size.
For this chapter we won't put a lot of effort into this. We will not add any rivers and just use two colors: One for land and one for water.
First thing we do is copy over the rivers.bmp to our mod folder (<modfolder>/map). If necessary we resize it to our map size. Then we take our black and white map we drew in chapter one and paint-bucket the pink that is used for vanilla ocean over white and white over black. Make sure that no anti-aliasing took place. Finally paste it into rivers.bmp, flatten the file (i.e. merge all layers) and save it.
4. trees.bmp
This file sets where the 3D trees appear on the map. The file can contain black (no trees) or various shades of green (trees). You can find a description of the tree types and their colors at the end of map\terrain.txt.
The size of the file is 1/8 of the other map files. My way of doing it is to keep a tree map with the regular size. Whenever I make changes I size it down to 1/8 and paste it over the trees.bmp
For this chapter we won't put a lot of effort into this. We will just use a file with only black, disregarding oceans.
First thing we do is copy over the trees.bmp to our mod folder (<modfolder>/map). If necessary we resize it to our map size divided by 8 (2048x2048 -> 256x256). Then we replace the content with black and save the file.
5. world_normal_height.bmp
This is a normal map, a file used to simulate 3D lighting. Basically, it is a picture of what the lights/shadows from topology.bmp should look like. As such, it is generated from topology.bmp. The Nvidia DDS Photoshop plugin can generate this (go to Filter>NVIDIA Tools>NormalMapFilter). The free tool CrazyBump can be used for this task as well.
For this chapter it'll be enough to just copy over the vanilla world_normal_height.bmp and paint the whole image with a single color chosen at random from the vanilla file. It is however, pretty easy to create it from the topology.bmp by means of the NVIDIA plugin (more about this later).
6. provinces.bmp
This file controls provinces and their borders. Each province is identified by a unique RGB color. Painting this is fun and easy but can be pretty time consuming.
For this chapter we want to create a single small land province and two large ocean provinces.
We start with our coastline image from chapter one.
Somewhere on the land we paint one province with a randomly chosen RGB color. Do not use white and black for province colors. Choose a color that is not light blue as those should be used for ocean provinces to easier tell them apart. All in all there are 16777214 distinct colors. Therefore if you pick a color at random from the color picker you have a very good chance to not use a number twice.
Use the lasso tool, select the area you want and then fill it with the paint bucket tool.
Next we paint the left half of the ocean in one light blue color and the right one in another. Too large sea provinces make the game CTD. Two sea provinces for a 2048x2048 map seem to be small enough.
Keep the inland lakes as white.
7. colormap and colormap_water
These files are purely cosmetic, determining what the terrain map in the game looks like. Of the colormap file only the landed part is used and of the colormap_water only the water-y part. The usual way to do it is to start from a far advanced terrain.bmp.
These files are in the DDS format. You can just edit it like any other type of image once you have installed the
nvidia dds plugins.
For this chapter it would be sufficient to either a) disable it by setting the alpha layer to black (i.e. make it invisible) or just use some plain green.
But remember what we started from: A satellite image of Ireland. One of the reasons I picked it was that it can be used as a very excellent colormap.dds.
Do not copy the whole content of map/terrain over to your mod (e.g. border1cornerdata.tga) unless you have actually changed them. Many people seem to do this for some reason.
II. Text files in /map
adjacencies.csv
This file determines which straits can be crossed over by units. There are three possible types in CK2.
sea: Is used to define straits. A land unit can move from province A to province B via ocean province C.
major_river: Is used to define crossings over major rivers. A land unit can move from province A to province B via major river province C.
portage: Is used to define portages. A naval unit can move from major_river / ocean province A to major_river / ocean province B via land province C.
For this chapter we will go with no adjacency at all. We copy over the adjacencies.csv from vanilla and delete everything except the first line from it.
positions.txt
positions.txt is used to determine where cities, ports, councillors and armies are placed on the map. If your units are using awkward paths to move from province to province most likely the positions.txt is at fault.
For this chapter we will go with no positions at all. Create an empty file "positions.txt" in your mod's map folder.
continent.txt, region.txt
Create continent.txt and region.txt empty in your map folder. As their names suggest they are used to group provinces into continents and regions.
static.txt
This files defines the frame that is shown around the map once loaded up. All but one of the blocks in the file are commented out (i.e. prefixed with '#'). Which means that those blocks are ignored.
Here we are using a square map so we are commenting in the first block ("frame") and commenting out the second one ("frame3072"). The second one is for maps that have the current size of the vanilla map (3072x2048). If your map isn't using either of these sizes you can comment out all blocks which disables the frame.
The other frames are for larger map sizes you can experiment with.
III. Map Filler Tool
For the next step we need to use the "map filler tool" (give me a word if you can think of a better name for it). Go
here and read the guide.
For our simple provinces.bmp this content for the provinceDef.xls is enough
EDIT: Recent versions of the map filler tool need to have the seasons in column M (previous column M moved one column to the right).
4) in the map filler thread
C-E are the RGB values of the three provinces: 1x land and 2x sea
numH is 1_4 which means that 1 holding is built out of 4.
Without specifying names for baronies (columns N+) all baronies will have the name of the county (column F)
For the sea provinces you'd have to put the name of the ocean zone in column L.
Once you run the map filler tool you'll get created:
- common/landed_titles/01_landed_titles.txt
- history/titles
- history/provinces
- map/default.map
- map/definition.csv
- localistation
IV. The test guy
In order to load up the game at least one landed person needs to exist in the history files. To do this we create the folders history/characters and there a txt file with any name.
There we post a character like this:
Code:
1 = {
name=William
dynasty=752
religion=catholic
culture=irish
1027.01.15 = { birth=yes }
1087.09.09 = { death=yes }
}
Then we go to history/titles and add "1060.1.1={holder=1}" at the bottom of at least one of the county files (i.e. files prefixed with "c_").
V. Starting it
These files should be enough to start up the mod.
If you wonder why I put the replace_path for culture in: If vanilla cultures are enabled the game is likely to CTD after character selection.
If you want to take a look at my mod after chapter 2 download it from here:
http://www.mediafire.com/download/npt0df5i6rt85h5/Ireland_chapter2.7z
Version for CK2 2.5 (tbr):
http://www.mediafire.com/download/o6o8rjkzp82rff9/Ireland_chapter2_v2.5.rar