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.
This is going to be a guide to modding in form similar to the one of an AAR. I am going to post continuous chapters, each building upon the one before it. I am going to create a medium sized example mod about Ireland that is supposed to be playable but probably won't reach an overly polished state.
I am no expert in a wide array of things regarding CK2 modding so it would be very helpful for readers regardless of their expertise in modding to post suggestions and criticism. So even if you think that you probably know everything that I will post here consider to read it and then comment. I'll be thankful for all kinds of input even if it is only typos you've found
Suggestions for further chapters would be nice, too. For instance I am not even sure in what year I should place my Ireland mod's standard bookmark.
Preparation and Basic Information
There is a few things you need:
Photoshop: You can do all the relevant things in other image editing softwares, too, but I am going to describe relevant steps in Photoshop only. You can get Adobe Photoshop CS2 for free (google it). I'll be using CS6 but CS2 is almost as good.
XLS editing software: Excel or another xls editing software (like LibreOffice)
CHAPTER 1 Mod file, folder structure and coastline
Mod name
First thing to settle on is the name of the mod. It should be something catchy that is not too long. For this guide I am going to use just "Ireland" as my mod name. Whatever you choose insert in place of <modname> when going through the following chapters.
Mod file
For a mod we need a mod file that provides the name and path information for the CK2 engine to load up the mod.
For this we go to our local Windows "Documents" folder (usually at "C:\Users\<username>\Documents") and there navigate to "Crusader Kings II\mod". If "mod" doesn't exist yet create this folder. Then create a file called "<modname>.mod" (easiest way is to copy and rename the modfile of an existing mod). If your modname contains spaces remove them from the modfile's name (e.g. mod name = "Witcher Kings", mod file name = WitcherKings.mod) -><modname_nospaces>.
Next thing to do is to open up the mod file in Notepad++ and put this in as content (again, replace <modname> with the name you have chosen):
path tells the engine where to look for the mod's other files
user_dir is the name of the folder in "Paradox Interactive\Crusader Kings II" where temporary files like the flag cache is stored
If you load up a mod normally all vanilla files are loaded alongside the mod files. If you put a file with the exact same name and path as a vanilla file in the mod folder the vanilla file is not loaded. Another way to exclude vanilla files to be loaded is to put in a replace_path. It tells the engine to not use the vanilla files of a certain folder when the mod is started. Subfolders are still loaded up. With cleverly using replace_path you can achieve to not have to include unchanged vanilla files in your mod.
You can use different values for name, path and user_dir if you want to. For simplicity's sake I am usually using the same text for most of them (the exception being name).
The above selection of replace paths is a good selection for a new mod. If a mod with these settings gets past the character selection it will run into problems as vanilla events and decisions won't (yet) work properly. That shouldn't be a concern at this point, though.
Folder Structure
Next thing to do is create the mod folder. This is the folder path is pointing to. In the case of the Ireland mod we create a folder called "Ireland" in the same folder the Ireland.mod file is located. The mod folder will as a mod grows look more and more like the installation directory of CK2. To mod certain things a specific file has to be copied over from vanilla and then changed (e.g. adding a new bookmark: common/bookmarks.txt). For certain other moddable things it is sufficient to place a file in a certain folder (e.g. a new culture: put a file into common/cultures).
Always keep in mind that if not properly stated in the mod file vanilla files will be loaded alongside modded files.
Coastline
Something that is very important for a mod that is not based upon the vanilla map is the coastline. If you have a map that shows in two colors what is water and what is land (e.g. in black and white) you can create all the files that are needed for the game to properly load up from it.
Most of the time the coastline is based upon some kind of reference material.
If you want to do something that is based on a real part of the world or a well documented fantasy world do a lot of research to get the best maps that are out there.
Google Image search is - as expected - pretty solid for such a task. But there is of course always much better data elsewhere if you want to go for more accuracy. For instance google maps (and earth) can be used to get detailed satellite and elevation data.
As a rule of thumb try to use something that is larger than the map size you are going to use (e.g. 2048x2048, 3072x2048,...) and try to avoid pictures that are too heavily anti-aliased.
For this guide I've chosen to use this picture from the wikimedia commons to base my map upon (Topography_Ireland.jpg -> google it):
(resized for viewing purposes from 6,587 × 8,336 pixels)
Then settle upon the size of your CK2 map. Common sizes are 2048x2048 (old standard size) and 3072x2048 (new standard size). But you can theoretically use anything that has multiples of 64 on each side (8 according to other sources). Just keep in mind that the larger the map is the more space is there to be filled with content. In earlier versions the engine bugged out when the total number of pixels on a map was larger than a certain number (15 (?) million) but this restriction was removed since then.
For the guide I'll go with 2048x2048 as a square map is very fitting for a map that contains Ireland only.
Drawing in Photoshop
First thing to do is to set the "Image Interpolation" setting. Click edit and then Preferences > General.... In the menu select "Nearest neighbour" for "Image Interpolation" (third from the top).
Open up Photoshop and create a new file with 2048px width and height.
Open up the map you are using as reference, copy it and insert into the newly created picture. You should have a second layer now.
As the inserted image is probably much larger than the 2048x2048 you have to make it smaller. You can do that by pressing CTRL+T and then changing the size by clicking and moving the corners of the marked area while holding shift at the same time.
Place the re-sized map at the center of your picture. Cut off all unwanted areas (in my case that tip of Scotland) by marking an area with the Lasso Tool and then removing this part with delete.
On first glance the black and white map can be done pretty easily: All that is blue is going to be white and all the rest (i.e. the land) black. But this map here (and almost every map you can find on the net) will be anti-aliased to some degree. This makes a picture look "smoother" as hard edges are made softer. The result of this is that there is not a single RGB value for the water but several with different degrees of "blueishness".
To still get our black / white map (without any anti aliasing!) different strategies can be used depending on the reference map. For the Ireland map it is sufficient to use the Magic Wand tool, disable contiguous (to also include lakes), and use a tolerance of ~75. For some maps it might be necessary to draw the coastline by hand (by using the magic lasso tool).
Then make a new layer (CTRL+Shift+N) and paint the selection you got from the magic wand tool white. Paint the empty space at the sides white, too. And paint the part that is land black. Contiguous on/off is helpful when using the paint bucket tool.
As a last step you should spend some time on refining the result. Some parts of the coastline might not be completely correct and need correction. Try to avoid having single pixels on your map. A lake sized one pixel isn't very pretty to look at and the same applies for islands of this size.
Use a 1px pencil to fix the things you come across. It is a good idea to get the coastline right right away as correcting mistakes later is more work.
In the next chapter we will make good use of this file!
Please comment, gives suggestions and tell me if something is not clear enough or way too clear
Good night!51
Points: the name of the .mod file should not contain spaces, so it will remain selected in the launcher between games.
The name field in the mod file can be anything, but shouldn't be too long to fit in the launcher. If it contains spaces, it should be quoted.
The name of the mod folder must match the name in the path field, but otherwise doesn't need to match the name of the .mod file, or the name field.
A detailed guide to map conversion, with links to the tools and programs you used, and explanations of why things matter? You are a good person and I truly hope you see this through. If our paths should ever cross IRL I'll gladly buy you a drink.
Points: the name of the .mod file should not contain spaces, so it will remain selected in the launcher between games.
The name field in the mod file can be anything, but shouldn't be too long to fit in the launcher. If it contains spaces, it should be quoted.
The name of the mod folder must match the name in the path field, but otherwise doesn't need to match the name of the .mod file, or the name field.
Interesting. I didn't know about spaces making a difference. Yeah, I know, you can theoretically use different names for all these things: mod name, mod path, user_dir. I just think that you probably should try to use similar terms for all of them.
I thought 15 million is the limit as the ElderKings map has ~14,7 million pixels and has been working for quite some time. Doesn't really matter, though, as this restriction isn't there anymore.
Also, regarding map size limitations: So there is no longer a 10M pixel limit? What is the current limit? What about map size/game speed and provinces munber/game speed ratios and province numver limitations? I'd like to see those things covered in future installments of the guide.
Also, the Elder Kings map is currently 4608*2048 which still amounts to less than ten million pixels.
It's good to see someone finally put a tutorial like this together. I would have done so myself if I wasn't so bad at explaining, but you seamed to understand me sot that's good at least.
Also, regarding map size limitations: So there is no longer a 10M pixel limit? What is the current limit? What about map size/game speed and provinces munber/game speed ratios and province numver limitations? I'd like to see those things covered in future installments of the guide.
Also, the Elder Kings map is currently 4608*2048 which still amounts to less than ten million pixels.
The current limit isn't known to us currently, however Keanon got a(i think) 8192x8192 map to run. The new Diadochi Kings map has a size of 4608x2560 and runs very well. In old EK builds, the mod was actually faster than vanilla was while having a larger map size as well as a larger province number. Provinces or map size aren't the things that most affect speed, it's the history for the provinces and events that need to trigger for characters.
Nice guide Jon! Perhaps it is an idea to host it on the wiki as well, since that is editable by everyone and more easy to maintain with new patches coming around.
Thank you for this. I tried looking for a complete, concise guide and wasn't able to find a current one for CK2. This will definitely come in handy.
I second hosting this on the wiki even if you're the only contributor. Even with an index, it'll be more legible as this thread accumulates posts and comments to have it all in one place.
Map size is pretty free right now though you might still get artifacts if you get too funky, the normal map is still limited though and that can have a big impact on what size you might want depending on the aesthetic you're going for.
Edit:
Also, Photoshop is probably pretty rare and might not make for the best guide if the longterm goal is availability. I tried hard to learn to do everything in GIMP for a tutorial but GIMP was just impossible to work in for me. I actually use an ancient drawing software called Jasc Paint Shop pro, version 7, and no other software has as easy a time with the colour indexes as this does. Its only real limits is for many fancy scripts and brushes and things if you want to draw say the colormap and saving as DDS. Everything else it's just perfect for imo and even better, it's really simple compared to newer media editing software.
I considered trying to make a guide for above mentioned software since it's so freely and easily available all things compared, but it just hasn't worked out for me for various reasons. Regardless, I hope most people will be able to atleast understand all the concepts well enough to take it to other programs if nothing else.
Edit2: Oh and you really shouldn't suggest OpenOffice, ever since it was discontiuned it's been distributed with tons of spyware all across the internet. You should suggest LibreOffice which most people who did OpenOffice is now making.
Map size is pretty free right now though you might still get artifacts if you get too funky, the normal map is still limited though and that can have a big impact on what size you might want depending on the aesthetic you're going for.
Edit:
Also, Photoshop is probably pretty rare and might not make for the best guide if the longterm goal is availability. I tried hard to learn to do everything in GIMP for a tutorial but GIMP was just impossible to work in for me. I actually use an ancient drawing software called Jasc Paint Shop pro, version 7, and no other software has as easy a time with the colour indexes as this does. Its only real limits is for many fancy scripts and brushes and things if you want to draw say the colormap and saving as DDS. Everything else it's just perfect for imo and even better, it's really simple compared to newer media editing software.
I considered trying to make a guide for above mentioned software since it's so freely and easily available all things compared, but it just hasn't worked out for me for various reasons. Regardless, I hope most people will be able to atleast understand all the concepts well enough to take it to other programs if nothing else.
Edit2: Oh and you really shouldn't suggest OpenOffice, ever since it was discontiuned it's been distributed with tons of spyware all across the internet. You should suggest LibreOffice which most people who did OpenOffice is now making.
What are the rules about normal maps? I remember reading a posting from you where you stated that it doesn't have to have the same dimensions as the other map files. Or that there is a maximum size for it ... can't quite remember
The thing is that I am going to use Photoshop and not GIMP. If someone is looking for a GIMP tutorial he has to look elsewhere, sorry. Promoting PaintShop Pro v7 isn't something I want to do, either. That software is almost 15 years old :O
I put LibreOffice in the OP if that is better. Personally I am using Excel but I just wanted to point out that there are free alternatives to it.
I'd love to hear your input on topology, colormap & Co. btw
The mountains in my WitcherKings mod were mostly made by Yurtex and talias so I certainly am no expert on these kinds of things ...
I remember reading somewhere buried in the map testing thread that normal height maps only work for square maps. Don't know if that kepps aplying nowadays
What are the rules about normal maps? I remember reading a posting from you where you stated that it doesn't have to have the same dimensions as the other map files. Or that there is a maximum size for it ... can't quite remember
I think it either has to be 2048x2048 or 3072x3072. It will from that size automatically stretch to meet the size of your map and it will work. It is working perfectly for the new Diadochi Kings map this way.
This could not come at a better time, as I'm currently working on a Discworld map and will be able to follow you step by step. I literally just finished the coast outline (took me forever, traced it with the pencil tool pixel by pixel).
Would you mind if I post my progress at each stage for feedback and criticism? It's my first time making a map and I could use the help. Thanks!