This is a tutorial that aims to describe how a completely new provinces map image can be converted into a working mod.
Software you'll need: Java 7 installed and Windows Excel in any version
The Map filler tool: v18|2015/11/16. v19|2016/11/30, v20|2018/04/09
1) You should have your map ready. The best techniques to create it are described elsewhere.
This consists of the provinces.bmp, the topology.bmp, world_normal_height.bmp, the rivers.bmp, terrain.bmp as well as the two colormap files. Those files are however not needed for the tool to work.
My provinces.bmp looks like this:
2) Fix up your mod folder
- If you haven't already, create this folder: [DocumentsPath]\Paradox Interactive\Crusader Kings II\mod\[modname]
- Same with the .mod file: [modname].mod has to exist in the mod folder. It should contain something like this:
- create the map folder inside your mod folder and put in the files of the map you drew before
2.1) Stuff needed in preparation for 3):
- Put this file in the map folder: http://www.mediafire.com/view/qpmas6q8dpq3iw8/provinceDef.xls
(At the moment it contains my own data, we'll have to delete that lateron)
- create gfx/flags/_other and copy flags from other mods or from vanilla into it. Vanilla flags can be found here: "..\SteamApps\common\Crusader Kings II\gfx\flags"; You need at least as many as you have counties, duchies, kingdoms and empires on your map
3) Download the Tool this thread is all about
- Install Java 7 if your system isn't running it already
- Extract the archive to a directory of your choice
- Open config.properties with a text-editor and put the directory of your mod folder right of the 'moddirectory='. You have to essentially replace "E:\\Documents\\Paradox Interactive\\Crusader Kings II\\mod\\Witcher" with your personal path. Then make sure that either "/" or "\\" are used in the directories.
4) Open up provinceDef.xls you copied in 2)
Take a look at the current content (it is similar to what needs to be written in definition.csv):
- the coloring is completely arbitrary; I usually give every kingdom a specific color but it is not necessary
- every line corresponds to a single province
- column A is a comment; I use it to give every kingdom its heading
- column B is an index starting at 1
- columns C - E is the RGB value of the province in the provinces.bmp
- column F is the name of the province
- column G is for localisation data (optional)
- columns H - J are for the de jure structure (empire, kingdom, duchy); only H can be left empty
- column K: culture
- column L: religion
- column M: terrain - you can override the terrain taken from the terrain.bmp with this
- column N: winter terrain type
- column O: number of holdings (including the capital; in the range 1-7). Alternatively you can write "NUMBER_NUMBER" (e.g. 2_4) to specify the number of built and unbuilt holdings at once.
- columns P-V: names of the baronies; can be omitted for a first try; if B (castle), C (city), T (temple) or U ("uncivilized" = tribal) is in put in brackets after the names those baronies will be built at game start. All others will be there as holding slots. There is a special notation for holy_sites that can be seen in the example file. If you use the (new) NUMBER_NUMBER notation from above custom specified holding types (e.g. (B)) will be retained. If a holding is set as built in column M the default type for that column will be used (from left to right: B, C, T, B, C, T, B). If the number of holdings is higher than the number of specified baronies the name of the county is used for them
- Culture and de jure information can only be omitted for wasteland and ocean/river/lake provinces. numH has to be always present (0 for the aforementioned exceptioned province types)
- Ocean and river provinces need to have river and ocean names in columns K and L (columns that are used for religion and terrain on land):
Edit in your own holdings
- Firstly delete all my example content and start from scratch
- Fill in all the provinces you have on your map
- The map filler tool has a .bat to extract colors from a bmp file: colors.bat; This can be used to extract all colors
of provinces.bmp at once or small batches of it
- Make blocks as I did: Wasteland on top, then each kingdom after each other, then rivers, oceans and lakes.
- Name your provinces, put in culture and religion and assign de jure duchy, kingdom and if you want empire.
- Decide upon a number of holdings
- Either put in all the holdings you want to have or leave those columns empty for now (you can add that later on as well)
5) Technology
The map filler will create a batch of technology files for you. The rule is that a file is created for every empire when that file isn't already present. To re-create tech you need to delete tech files and re-run the tool.
The very important thing here is the tech start date. DONT_EXECUTE_TECH_BEFORE in defines.lua governs the date from which on you need to provide technology history.
Decide on the earliest start date for your mod and overwrite DONT_EXECUTE_TECH_BEFORE accordingly. Then look into your map filler config file and set the years for tech1.year and tech2.year accordingly, as well as the tech values.
To have different tech levels you can create a batch of tech files, then delete some and re-create those with different settings.
6) Run mapfiller.bat from the folder you put it in 3)
The tool will now:
- Create the definition.csv; Mostly the columns B - F
- Create the landed_titles.txt: The first province listed for every empire, kingdom and duchy will be its capital, etc.
- Create province history: Baronies with (B), (T) or (C) will be enabled; If no baronies are defined one will be added by default (name = b_countyname)
- Create title history: The de jure liege will be added and currently Agnatic succession law
- Create the default.map: Don't forget to mark your ocean provinces in column L (i.e. write a common name for ocean provinces of the same ocean there). If it is a river write the name of it in column K: View attachment 121965
- Create localisation texts: names for Counties, Duchies, Kingdoms, Empires as well as basic possessive terms (countyname + "ian").
- Assign a flag for every title that has none; If you have a flag for a specific title then the tool won't overwrite that one
7) Last amendments:
- landed_titles: The landed_titles.txt doesn't contain vanilla titles. Some are necessary for certain things to work (e.g. Mongols are event-wise tied to the Pope). Put additional files in the landed_titles folder that contain such titles (e.g. 00_landed_titles_vanilla.txt). As long as the tool is used no custom changes should be made in the landed_titles.txt. Add special creation requirements once you're done with filling the map
- if you want to add manual changes to the landed_titles while not losing the ability to re-run the map filler tool oftentimes make another file for those (e.g. "manual changes to 01_landed_titles.txt"). You can there re-define any title you want (without having to put it at the right spot in the hierarchy) and define stuff like cultural localisations, capitals and colors.
-Use Notepad++ instead of the standard text editors
- edit in a starting character somewhere (112603 is an id you could use if you kept vanilla characters)
Therefore open up one of the c_? files in history/titles and add this at the bottom of the file:
8) Give it a go and see if it starts
- Pray to the gods for it to work
- If it does get yourself a beer. You did good.
- If not come to this thread and complain about the poor tutorial.
9) More stuff to do after it started for the first time
- Edit in missing baronies (if you haven't filled out the Excel file the first time around) and re-run the tool
- Enable nudge in the settings and move around county capitals and ports
- You can move around full lines in the excel (to change a capital, etc.). The IDs don't have to be in perfect order.
- This tool is designed to be re-run many, many times. You won't lose changes in history/titles and history additions to history/provinces if you do so!
- Read this. Among other things it describes some aspects of the map filler tool in more detail.
Comments and questions are welcome!
IF YOU LIKE THIS PLEASE GIVE IT SOME REP!
Software you'll need: Java 7 installed and Windows Excel in any version
The Map filler tool: v18|2015/11/16. v19|2016/11/30, v20|2018/04/09
1) You should have your map ready. The best techniques to create it are described elsewhere.
This consists of the provinces.bmp, the topology.bmp, world_normal_height.bmp, the rivers.bmp, terrain.bmp as well as the two colormap files. Those files are however not needed for the tool to work.
My provinces.bmp looks like this:

2) Fix up your mod folder
- If you haven't already, create this folder: [DocumentsPath]\Paradox Interactive\Crusader Kings II\mod\[modname]
- Same with the .mod file: [modname].mod has to exist in the mod folder. It should contain something like this:
Code:
name = "[modname]"
path = "mod/[modname]"
user_dir = "[modname]"
replace_path = "history/provinces"
replace_path = "history/titles"
replace_path = "common/landed_titles"
...
2.1) Stuff needed in preparation for 3):
- Put this file in the map folder: http://www.mediafire.com/view/qpmas6q8dpq3iw8/provinceDef.xls
(At the moment it contains my own data, we'll have to delete that lateron)
- create gfx/flags/_other and copy flags from other mods or from vanilla into it. Vanilla flags can be found here: "..\SteamApps\common\Crusader Kings II\gfx\flags"; You need at least as many as you have counties, duchies, kingdoms and empires on your map
3) Download the Tool this thread is all about
- Install Java 7 if your system isn't running it already
- Extract the archive to a directory of your choice
- Open config.properties with a text-editor and put the directory of your mod folder right of the 'moddirectory='. You have to essentially replace "E:\\Documents\\Paradox Interactive\\Crusader Kings II\\mod\\Witcher" with your personal path. Then make sure that either "/" or "\\" are used in the directories.
4) Open up provinceDef.xls you copied in 2)
Take a look at the current content (it is similar to what needs to be written in definition.csv):

- the coloring is completely arbitrary; I usually give every kingdom a specific color but it is not necessary
- every line corresponds to a single province
- column A is a comment; I use it to give every kingdom its heading
- column B is an index starting at 1
- columns C - E is the RGB value of the province in the provinces.bmp
- column F is the name of the province
- column G is for localisation data (optional)
- columns H - J are for the de jure structure (empire, kingdom, duchy); only H can be left empty
- column K: culture
- column L: religion
- column M: terrain - you can override the terrain taken from the terrain.bmp with this
- column N: winter terrain type
- column O: number of holdings (including the capital; in the range 1-7). Alternatively you can write "NUMBER_NUMBER" (e.g. 2_4) to specify the number of built and unbuilt holdings at once.
- columns P-V: names of the baronies; can be omitted for a first try; if B (castle), C (city), T (temple) or U ("uncivilized" = tribal) is in put in brackets after the names those baronies will be built at game start. All others will be there as holding slots. There is a special notation for holy_sites that can be seen in the example file. If you use the (new) NUMBER_NUMBER notation from above custom specified holding types (e.g. (B)) will be retained. If a holding is set as built in column M the default type for that column will be used (from left to right: B, C, T, B, C, T, B). If the number of holdings is higher than the number of specified baronies the name of the county is used for them
- Culture and de jure information can only be omitted for wasteland and ocean/river/lake provinces. numH has to be always present (0 for the aforementioned exceptioned province types)
- Ocean and river provinces need to have river and ocean names in columns K and L (columns that are used for religion and terrain on land):

Edit in your own holdings
- Firstly delete all my example content and start from scratch
- Fill in all the provinces you have on your map
- The map filler tool has a .bat to extract colors from a bmp file: colors.bat; This can be used to extract all colors
of provinces.bmp at once or small batches of it
- Make blocks as I did: Wasteland on top, then each kingdom after each other, then rivers, oceans and lakes.
- Name your provinces, put in culture and religion and assign de jure duchy, kingdom and if you want empire.
- Decide upon a number of holdings
- Either put in all the holdings you want to have or leave those columns empty for now (you can add that later on as well)
5) Technology
The map filler will create a batch of technology files for you. The rule is that a file is created for every empire when that file isn't already present. To re-create tech you need to delete tech files and re-run the tool.
The very important thing here is the tech start date. DONT_EXECUTE_TECH_BEFORE in defines.lua governs the date from which on you need to provide technology history.
Decide on the earliest start date for your mod and overwrite DONT_EXECUTE_TECH_BEFORE accordingly. Then look into your map filler config file and set the years for tech1.year and tech2.year accordingly, as well as the tech values.
To have different tech levels you can create a batch of tech files, then delete some and re-create those with different settings.
6) Run mapfiller.bat from the folder you put it in 3)
The tool will now:
- Create the definition.csv; Mostly the columns B - F
- Create the landed_titles.txt: The first province listed for every empire, kingdom and duchy will be its capital, etc.
- Create province history: Baronies with (B), (T) or (C) will be enabled; If no baronies are defined one will be added by default (name = b_countyname)
- Create title history: The de jure liege will be added and currently Agnatic succession law
- Create the default.map: Don't forget to mark your ocean provinces in column L (i.e. write a common name for ocean provinces of the same ocean there). If it is a river write the name of it in column K: View attachment 121965
- Create localisation texts: names for Counties, Duchies, Kingdoms, Empires as well as basic possessive terms (countyname + "ian").
- Assign a flag for every title that has none; If you have a flag for a specific title then the tool won't overwrite that one
7) Last amendments:
- landed_titles: The landed_titles.txt doesn't contain vanilla titles. Some are necessary for certain things to work (e.g. Mongols are event-wise tied to the Pope). Put additional files in the landed_titles folder that contain such titles (e.g. 00_landed_titles_vanilla.txt). As long as the tool is used no custom changes should be made in the landed_titles.txt. Add special creation requirements once you're done with filling the map
- if you want to add manual changes to the landed_titles while not losing the ability to re-run the map filler tool oftentimes make another file for those (e.g. "manual changes to 01_landed_titles.txt"). You can there re-define any title you want (without having to put it at the right spot in the hierarchy) and define stuff like cultural localisations, capitals and colors.
-Use Notepad++ instead of the standard text editors
- edit in a starting character somewhere (112603 is an id you could use if you kept vanilla characters)
Therefore open up one of the c_? files in history/titles and add this at the bottom of the file:
Code:
1050.1.1={
holder=[characterID]
}
8) Give it a go and see if it starts
- Pray to the gods for it to work
- If it does get yourself a beer. You did good.
- If not come to this thread and complain about the poor tutorial.
9) More stuff to do after it started for the first time
- Edit in missing baronies (if you haven't filled out the Excel file the first time around) and re-run the tool
- Enable nudge in the settings and move around county capitals and ports
- You can move around full lines in the excel (to change a capital, etc.). The IDs don't have to be in perfect order.
- This tool is designed to be re-run many, many times. You won't lose changes in history/titles and history additions to history/provinces if you do so!
- Read this. Among other things it describes some aspects of the map filler tool in more detail.
Comments and questions are welcome!
IF YOU LIKE THIS PLEASE GIVE IT SOME REP!
Last edited:
- 24
- 18
- 4