• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

JonStryker

ɹǝʞʎɹʇSuoſ
67 Badges
Mar 20, 2012
5.291
376
  • Europa Universalis IV: Common Sense
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Europa Universalis IV: Mare Nostrum
  • Imperator: Rome Deluxe Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • The Showdown Effect
  • Stellaris: Ancient Relics
  • Magicka 2
  • Humble Paradox Bundle
  • Warlock: Master of the Arcane
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Stellaris
  • Age of Wonders III
  • Crusader Kings Complete
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Galaxy Edition
  • Victoria 3 Sign Up
  • Europa Universalis 4: Emperor
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Distant Stars
  • Imperator: Rome Sign Up
  • Imperator: Rome
  • Europa Universalis IV
  • Crusader Kings II: Holy Fury
  • Shadowrun Returns
  • Hearts of Iron III Collection
  • Heir to the Throne
  • Leviathan: Warships
  • Magicka
  • Semper Fi
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Knights of Pen and Paper +1 Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis III
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: The Old Gods
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:
3pk.png


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"
...
- 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):

t2ph0UO.png


- 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):

T2Xamyq.png



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
  • 4Like
Reactions:
Hi.

Your tutorial made weeks of work shorten to hours, thanks.
And still, I did everything as you said, but unfortunately it only creates 2 files:

- "_Province names" in "Localisation" folder, with lines like PROV1, the name and a column with "X"
- "definition" in map folder which only has one line: province, red, green, blue, x, x

Can you figure out what I might be doing wrong? I created a map with 10 provinces (5 wastelands, 1 province, 1 river, 1 lake, 2 seas).

Thanks!
 
@Shaku
Thanks for the premature praise :)

Not that easy to find out what is causing this. Maybe you have forgotten to put some of the files in exactly the place the tool needs. Or an oversight in the tool. Fastest way would be probably to send me your complete mod folder so I can check myself.

For more information you could start the .bat file in a console window to see if anything serious happened during its run.
 
Hi.

Your tutorial made weeks of work shorten to hours, thanks.
And still, I did everything as you said, but unfortunately it only creates 2 files:

- "_Province names" in "Localisation" folder, with lines like PROV1, the name and a column with "X"
- "definition" in map folder which only has one line: province, red, green, blue, x, x

Can you figure out what I might be doing wrong? I created a map with 10 provinces (5 wastelands, 1 province, 1 river, 1 lake, 2 seas).

Thanks!

Your provinceDef.xls wasn't quite right (every province has to have kingdom, duchy, culture, religion and numh (number of holdings) defined). I'll try to improve that section in the tutorial. Without pictures it can be hard to understand what I am aiming for.
Also, you didn't copy flags to gfx\flags\_other. Currently the tool doesn't like it when those flags it substitutes if some are not present aren't there.

I fixed everything up in your Dropbox folder (I guessed missing stuff in the provinceDef.xls). It doesn't load up at the moment but that can be caused by a variety of things. The files the tool generates look fine to me.
 
Last edited:
Hi, this is amazing. Thank you so much. But I have a problem. It appears that it's only created the localisation for my provinces and titles. I followed the instructions to the letter but I can't find where it's placed the other files.

Post me a screenshot of your provinceDef.xls. Either the problem is there or you have forgotten to create one of the needed files. A bug is of course also possible.
 
Thanks for the help, it generated the files (no landed_titles though).

The problem with it not starting is most likely the adjacencies file... i have no idea how to define the needed portage. I tried like you wrote on another thread to define a river-lake through a land province, but that didn't work.
 
Thanks for the help, it generated the files (no landed_titles though).

The problem with it not starting is most likely the adjacencies file... i have no idea how to define the needed portage. I tried like you wrote on another thread to define a river-lake through a land province, but that didn't work.

Landed titles is right here: https://www.dropbox.com/s/ie9l5q5xanu5353/landed_titles.txt (The flaming rose block on top is a bug in the tool that shouldn't break anything)

Starting problems: Either the adjacencies or something more serious is wrong with the map. I'll take a look at your adjacencies file, maybe it is easily fixed.

Edit: I guess something is wrong with the colortables. I played around a bit with it maybe it helps.
 
Last edited:
That looks okay. There are no ocean provinces defined but that shouldn't be much of a problem.
Try to start the .bat file in a command window and check for errors and/or let me take a look at your files.

Hi, sorry for the long reply. I paused the bat file and this is what it looks like after going though it's process:
S2WWveJ.jpg

I don't want to send the mod files due to size and other reasons. But in the mod's folder I have two files map and gfx.

gfx\flags\_other leads to the game's flags as said in the instructions. Below is the content of the map folder:
v1IPaNH.jpg

The terrain folder leads to the files atlas0, colormap and colormap_water.

All these files work in game. I hope this helps.
 
@Tirenedon
For some reason the tool fails to compile the lines in the excel file into proper counties, duchies, kingdoms and empires. Your xls file looks pretty good, though ...
This is a step early on, flags aren't touched at that point.
If you don't want to share your files, fair enough. Basically the tool doesn't even need the map files to function. If I wanted I could simulate it by typing down the content of the screenshot and try it with that although that would be pretty tedious.

Download the new version I just uploaded and - again - tell me the output. I aligned it a bit better to make it less confusing.
 
@Tirenedon
For some reason the tool fails to compile the lines in the excel file into proper counties, duchies, kingdoms and empires. Your xls file looks pretty good, though ...
This is a step early on, flags aren't touched at that point.
If you don't want to share your files, fair enough. Basically the tool doesn't even need the map files to function. If I wanted I could simulate it by typing down the content of the screenshot and try it with that although that would be pretty tedious.

Download the new version I just uploaded and - again - tell me the output. I aligned it a bit better to make it less confusing.

It worked. The only problem I've encountered is that the game still uses the vanilla game's history files for the provinces, but the rest is working.
 
When it didn't create history/provinces and history/titles it most certainly did not work :sad:

It created the history files. I set all provinces to English culture and catholic religion with 3 baronies each but in the game some provinces are Irish, Norse or Saxon, one is Norse pagan and these problem provinces also have more or less than the set 3 baronies. They match the history files for the same province ID number in the base game instead of using the new ones created. I don't know why it's just some of the provinces and not the others though. The titles are working though.
 
It created the history files. I set all provinces to English culture and catholic religion with 3 baronies each but in the game some provinces are Irish, Norse or Saxon, one is Norse pagan and these problem provinces also have more or less than the set 3 baronies. They match the history files for the same province ID number in the base game instead of using the new ones created. I don't know why it's just some of the provinces and not the others though. The titles are working though.

That sounds weird. The Tool doesn't look at the vanilla files at all. It doesn't even know where they are stored.
Regarding the baronies: On your above screenshot you set your number of holdings to three each. Keep in mind that you would have to define the barony names right of it for the best result. I'd delete the content of the history/provinces folder and re-run the tool and check if anything changes.
 
I re-ran it and it didn't work. I checked the history files and they are all correct, but for some reason the cultures, religions and number of baronies for some provinces are coming from the vanilla game's files when they are keeping the correct county title, De Jure structure and baronies names from the mod.

SoEafco.jpg
In this picture the northern provenances are supposed to be all English whist the southern Island is supposed to be Andalusian. The History files are all correct for the mod.
 
I re-ran it and it didn't work. I checked the history files and they are all correct, but for some reason the cultures, religions and number of baronies for some provinces are coming from the vanilla game's files when they are keeping the correct county title, De Jure structure and baronies names from the mod.

View attachment 83908
In this picture the northern provenances are supposed to be all English whist the southern Island is supposed to be Andalusian. The History files are all correct for the mod.

Do you have this in your *.mod file?

replace_path = "history/provinces"
replace_path = "history/titles"
replace_path = "common/landed_titles"