• 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.
Thank you. I have all my province, river, terrain images done by hand already. But I have trouble making the text file required for the mod to load. Does that mean I only need to run the "6 - Make Provinces Setup.bat" ? If it is the case, what are bare minimum the files I need to put in the input folder?
It absolutely needs those 3 files :
  • output/map/provinces.bmp
  • output/map/terrain.bmp
  • input/settlements.bmp
I'd say you're in the same situation as tsf4... Basically it won't work if you don't have at least a settlements.bmp.
Since you already have a provinces.bmp you could use it as a starting point, put a red dot in every land province and a blue dot in every sea zone and save that as input/settlements.bmp
 
First things first, this is really really good. It's easy to use and the files it generates all look really good - the provinces generation is particularly impressive in my opinion.

But I'm just wondering if there's perhaps a part missing to the generator? I've used it a few times (with your empty mod template) and always get a game crash at "Loading Flags", which has happened for two different worlds. I checked the logs and it threw up a lot of errors (mainly to do with events and DLC characters), even after adding flags. Despite this, your mod seems to have worked very consistently. I'm unsure of why we'd get different results; I've followed the instructions in full.
 
First things first, this is really really good. It's easy to use and the files it generates all look really good - the provinces generation is particularly impressive in my opinion.

But I'm just wondering if there's perhaps a part missing to the generator? I've used it a few times (with your empty mod template) and always get a game crash at "Loading Flags", which has happened for two different worlds. I checked the logs and it threw up a lot of errors (mainly to do with events and DLC characters), even after adding flags. Despite this, your mod seems to have worked very consistently. I'm unsure of why we'd get different results; I've followed the instructions in full.

Hi,

I wouldn't bet my hand on it but it sounds like there could be a problem with your dejure maps ? Did you try to mke them by hand ? Are they outdated maybe ? I've had similar problems with those, it silently messes up the landed_titles generation and then the game crashes while "loading flags".
 
Alright, Loc_n_lol, first I want to say, the tool is great. I have always been more of a visual learner and the fact that the program allows simple use of pictures to compile data where other tools require spreadsheets and whatnot, makes things so much more fun and easy for me. However, I am having a problem. When I run provinces set up with the culture map, province map and settlement map, essentially the basics for single provinces and whatnot, I get this error:

C:\Users\||||||\Desktop\ck2\Offical Map\CK2 Map Tools V2>java -classpath "./bin" ck2maptools/main/CK2MakeProvinceSetup
Loading ./output/map/provinces.bmp
Loading ./input/settlements.bmp
Loading ./output/map/terrain.bmp
Loading ./input/dejure_duchies.bmp
dejure duchies map not found
Loading ./input/dejure_kingdoms.bmp
dejure kingdoms map not found
Loading ./input/dejure_empires.bmp
dejure empires map not found
Loading ./input/defacto_duchies.bmp
defacto duchies map not found
Loading ./input/defacto_kingdoms.bmp
defacto kingdoms map not found
Loading ./input/defacto_empires.bmp
defacto empires map not found
Loading ./input/government.bmp
government map not found
Loading ./input/religions.bmp
religion map not found
Loading ./input/cultures.bmp
Loading ./input/numslots.bmp
number of holding slots map not found
Loading ./input/technology.bmp
technology map not found
Loading ./input/climate.bmp
Loading ./input/input.bmp
Loading ./input/rivers.bmp
Initializing...
Found new wasteland : 0,0,255
Found new wasteland : 255,0,255
Determining province territory...


Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

C:\Users\||||||\Desktop\ck2\Offical Map\CK2 Map Tools V2>pause
Press any key to continue . . .

I double checked the file index colors and bit sizes. They're good as well as my prov map. I also have more than 2 wastelands. I have 4,
255,255,0 yellow
0,255,0 green
0,0,255 blue
255,0,255 magneta
While they are not marked on the settlements map, As you've said that is optional. And of course I have some good chunks labeled 0,0,0 for mountains

So I looked for possible problems that ties around the wastelands, since the program closes at province reading and only found half of my wastelands before having some sort of memory error. I found this,
0gXHE6Y.png

Ignore Minecraft, lmao. My sis plays it at times. Anyways, the yellow is a wasteland, which if you notice, isn't being read by the program before shutting down. As well, my Green wasteland doesn't have this issue.

So, I went ahead and placed the province colors on top of their settlement pixels that are outlined above. If this was the problem, it would be fixed. Well, it didint work out. On top of it the response code was just the same as before. So It's not reading my Green or Yellow Wastelands and only finding 2 out of the 4. At that point, the province set up breaks down.

In other words, Do you have an idea to the problem?

If it would help, I could upload my files.
 
Next time, I'm going to change the way wastelands work because honestly it's not very good...

For your immediate problem here's my best explanation so far : you have not one but two settlement spots in the middle of your yellow wasteland province, this possibility wasn't accounted for, so in some cases it gets treated as a wasteland (due to its color) and in some cases it gets treated as a regular province because settlement. And then there's the problem of having more than 1 settlement on the same province which can't be good and should have been caught early but wasn't.

The rule right now is one settlement spot per province, and none in wastelands.
Try to move both of the settlement spots in the yellow province into their actual province areas, and likewise for your green province.

None of that really explains the out of memory part though, and frankly I'm a bit concerned about that... Just how big is that map of yours ? If you're willing to upload them, I wouldn't mind checking out your files so I can understand what's going on and fix any bugs I can find.
 
Last edited:
Hi,

So I don't know about the memory error. Memory usage can spike a bit but nowhere near max usage, for me at least, maybe it wasn't the best idea to keep minecraft in the background though... But maybe the way I model coordinates and map province territory is far from optimal... that's a lot of rework though.

Regarding your other map problems it's all related to mismatches between settlements and provinces (multiple settlements in 1 province, and some settlements in wastelands). There are quite a few, so I didn't go through the trouble of fixing them all, what I did instead is regenerate your provinces.bmp, and reapply the changes you did to wastelands, impassable terrain, and sea zones, minus the parts where wastelands were overlapping with a settlement. Also your info.csv was named wrong, so I changed that. And it did finish :
ta0Jb5H.jpg

https://www.dropbox.com/s/jzqw7b37vf5yv4z/quickfix.zip?dl=0
 
Awesome tool you made, you really saved me a lot of trouble with these.
Ran into the same "out of memory" once for making the map too big (After the End Size). And on the sixth step, this time in the "generating holding slots map", any idea of why that is ? Tried making my own numslot.bmp, and erasing anything unnecesary for the process, to no avail.
Anyways, thanks a lot !
 
Last edited:
I just want to say a HUGE thank you for these tools! I've tried getting into modding for CK2 several times but I always just lose my patience at one point or another when it comes to making tonns of characters, typing hundreds of entries out everywhere and running into constant crashes and such. This will make things so much easier! I was just wondering what plans you have for the future of the tools? Will it mostly just be tweaks to the existing systems or are you looking at adding more tools down the road?
Also do you have a paypal or patreon account?

EDIT: Just did my first test, wanted to just check out how it all worked so I used the base images from your first tutorial part as an example. It all works well so far! Only issues I've found is one of my cultures' baronies not getting names despite having more than enough being designated randomly. I've probably just made a mistake somewhere though :p

A quick tip for those wanting names quickly for testing, you can use this page https://www.mithrilandmages.com/utilities/CityNames.php and select a country then generate 50 at a time. Open your csv file in notepad++ and paste in the names. I did 100 at a time with blank lines between each set of 100. You can then select the 100 names, hit ctrl-h to open fin/replace. click the replace tab, then click regular expression at the bottom. in the 'find what' part, type ^ to insert text at the start of a line or $ to insert text at the end. Just make sure to also tick the 'in selection' box to limit it to your selection.

For example if you have 100 welsh names you want to randomly assign to welsh culture counties you would select them and using the instructions above and firstly type ^ in the find what field, then in the replace with field type county;
That will add county; to the start of them all. With the lines still selected simply replace ^ with $ and county; with ;welsh
that will add ;welsh to the end of the selected lines. Hope that makes sense!

(I feel like I explain things badly in text so here's a quick video guide, feel free to link it in the naming post if you want loc_n_lol
)


Only issue I've run into so far is a lot of characters spawning with absolutely no traits or anything https://steamuserimages-a.akamaihd....377/254AD348E1A880D459C95E9DEA260C387F63714E/

Would that just be a side-effect of there being no random events and such firing?

If I get time I might start going through all the events and decisions and start making a 'template' of sorts for new maps and total conversions with only the events and decisions which don't require specific cultures/religions/land etc. I had something similar made a while back but can't find it now. It would help with getting started for sure
 
Last edited:
I was just wondering what plans you have for the future of the tools? Will it mostly just be tweaks to the existing systems or are you looking at adding more tools down the road?
Also do you have a paypal or patreon account?

Hi,
"Plans" seems to be a big word, but right now theres two things I'd like to do:

First, based just on my experience in making a how-to guide in this thread, I've come to realize there's a few things that made sense when I was just using it for myself, but should have been changed for a public release. I want to add at least a few more parameters, have fewer hard-coded rules.
For example, initially, the info.csv was going to contain absolutely everything, but somewhere down the line I changed my mind on that and decided to have new files for new features (like holy sites and title names). I think this was the correct approach and cultures and religions should have been in their own files too.
I'm also removing the requirement to make cultures before you can try the map in-game. If the tool can't find any culture files to parse, it will find other ways to generate rulers and dynasties instead of crashing.
I want the main config file to contain variables that can be modified by the user, like how high / steep do you want your mountains to be, or would you rather have an input map on a 1:1 scale or 1:4, instead of the 1:2 I decided to use or my own project.
All of the above is pretty much already done.

Secondly, based on the feedback I receiverd here, I think I need to look into the "reverse-engineering" maps thing again. At a minimum to generate a settlements.bmp from an existing provinces.bmp.

Also I still haven't explained trade routes, but it needed a little bit more work.

Lastly I'd love to figure out why the game doesn't seem to like my straits and why the AI doesn't fully understand how to navigate my seas, but so far still no luck, everything I've tried to do differently changes nothing.
EDIT : another user just figured out the cause of my straits problem

I do have a paypal accound like most people I know, but I think posting it here would break a forum rule or 2, and I never intended to receive money for this project.


one of my cultures' baronies not getting names despite having more than enough being designated randomly.
I haven't encountered that, but it's possibly a bug. Is there anything that sets this province / barony apart from the rest ? Does it have fixed names assigned for some of its titles maybe ?
Provinces are numbered north to south then west to east, and provinces are assigned names in order of ascending province id, so if you ran out of names, it would start showing as you go east.


Only issue I've run into so far is a lot of characters spawning with absolutely no traits or anything https://steamuserimages-a.akamaihd....377/254AD348E1A880D459C95E9DEA260C387F63714E/

Would that just be a side-effect of there being no random events and such firing?

Yes, it's the lack of events. Starting characters and characters generated by the game should have an education and 4 random personality traits, but characters born in-game will have no traits (except the genetic ones maybe). Gaining traits is always driven by events or decisions and all of them are disabled in the test mod to prevent crashes (from non-existing titles and provinces) and also to make the game load much faster. It's not really meant to be played this way. The only characters that gain traits through the tool are dynasty founders (the great-grandfathers of all starting rulers), and even that might be a problem (the game will log errors, but not crash) if your mod removes some vanilla traits.


Interesting video: it's pretty much how I use it, except I made an in-house name generator. It seems to give very similar results to that site though. :p
It would really make more sense to use excel or office calc to edit a csv file, but hey notepad++ works so why fix it, right?...
 
Last edited:
Thanks for the huge response there, really appreciate it! Definitely like some of the ideas for possible future additions and changes. I'm more than happy with the tools how they are at the moment but any additions and improvements are always appreciated :)

Sorry for asking about the paypal thing, I didn't realise it was against any kind of rules. I know that you made these tools for your own needs and to help out others and expect no money in return, it's just an offer in case you were interested. Feel free to PM about it anyways if you wish.

It was actually all non-capital baronies in the only feudal culture I had on the map. I did double check spelling and tried adding a couple hundred more random names but it didn't fix it. On the next map I tried it worked fine though. Unfortunately I was stupid and have deleted the old one so no chance of uploaded for you to bug-check sorry :/

I thought it was the lack of events, though I wasn't sure as I thought there may be a few hereditary traits. Although I've had CK2 for a long time I barely ever 'play' it, I usually just enjoy modding things and watching in observe mode, taking note of interesting characters and events.

And yes excel is definitely easier if you own it, or the open office version, but I never bother and prefer doing things notepad style haha.

Thanks again for the response and can't wait to see what else comes from the tools when/if they get some updates in the future!

EDIT: Sorry I did just think of a couple things that I personally think could be improved a little, and that's the scale and strength of the noise on the terrain. It looks great now, though it would look even better with a little more as a lot of areas can look quite flat at the moment. It may also make mountain ranges a little more interesting as currently they all seem to be pretty uniform, though I'm not sure how best to change that without adding more shades to affect mountain height, which would defeat the ease-of-use and simplicity of the current design. perhaps noise could help there too.
Anyways that's just my opinion though and it's amazing as it is right now, that's seriously the only thing I can think of that I think could use a touch of improvements :)
 
Last edited:
Getting started : Terrain
A very quick question in regards to this section here, since I'm not seeing it - is there a way to set up terrain to be marsh? That's one of the only terrains I notice not mentioned here. Thanks in advance :)
 
I came up with a couple terrain/climate ideas:
-Alpic/Himalayan mountains; Sharp and high mountains. Represent young mountains.
-Jungle; Used for Junge terrain. Could be a climate instead.
-Forest/Plains/Desert hills; Makes the height map like it would do to hills but sets the terrain to something else.
 
Sorry I did just think of a couple things that I personally think could be improved a little, and that's the scale and strength of the noise on the terrain.
Yes that's something that could be parametered. Right now every 4²-pixel square of terrain on the map gets its height altered by adding a random number between 0 and
0 + (current height - sea level) * 0.8
Then it all gets smoothed again.
So plains are very flat, while higher mountains have more noise.
But I could easily make those highlighted numbers changeable by the user.
The problem with having too much noise is eventually you hit the engine's "ceiling" height of 255, and you end up with flat mountain tops, the opposite of what you want generally.

A very quick question in regards to this section here, since I'm not seeing it - is there a way to set up terrain to be marsh? That's one of the only terrains I notice not mentioned here. Thanks in advance :)
Not currently, no, because it's not used in vanilla.
But I could make input.bmp colors that map to unused colors 13 and 14 in terrains.bmp. Setting up the rest would be up to you.

I came up with a couple terrain/climate ideas:
-Alpic/Himalayan mountains; Sharp and high mountains. Represent young mountains.
-Jungle; Used for Junge terrain. Could be a climate instead.
-Forest/Plains/Desert hills; Makes the height map like it would do to hills but sets the terrain to something else.
I think you already have quite some control over how steep you want your mountains to be if you experiment a bit with the width of the various terrain types, and like I said, there will be parameters to adjust that on a global scale too.
Jungle, desert hills and desert mountain are already in, but not directly. They're just forests, hills and mountains under the hot climate.

Now, Forest/jungle hills could be a thing. Right now forest terrain gets a slight height boost that puts it between plains and hills, but I could separate that into 2 different terrains. CK2 trees don't look very good on uneven ground though, which is why I cull trees from high hills and mountains during terrain generation.
 
Not currently, no, because it's not used in vanilla.
Oh. I swore it was. Maybe I'm thinking of EU4. Sorry for that!
But I could make input.bmp colors that map to unused colors 13 and 14 in terrains.bmp. Setting up the rest would be up to you.
It'd be kind! Admittedly, I'm... not fully sure what setting up the rest would fully include. Coding is very much not my thing, hah.

Anyhow, since I see I neglected to mention this in my last post, it's quite the incredible effort you've made in making this tool. I greatly appreciate it :)
 
New version here : https://www.dropbox.com/s/04ny74iab0m4bpl/CK2MapTools-v1.1.0.zip?dl=0
I'm going to retroactively call the previous one 1.0, this is 1.1.

Changes :
  • All files used in the "tutorial" are included in this release.
  • Wastelands are no longer color-based, instead they require a new type of "settlement" to be identified as wastelands : a pure green dot.
  • info.csv has been divided into 3 different files : config.csv contains the generic properties, which have been greatly expanded. cultures.csv and religions.csv contain the color definitions for cultures and religions. For those 2 files, the first column has been dropped.
  • It is no longer necessary to have a culture map before you can launch make province setup.
  • You can now define the following properties in config.csv : hills_height, mountains_height, snow_height, peak_height, input_map_scale, tree_map_scale, noise_patch_size, noise_factor_max, noise_baseline, smooth_radius.
  • Added a new input terrain : forested hills. It combines the height of the plateau type and the trees of the forest type. Color 0;64;64.
  • Added support for the 2 unused terrain types in vanilla. Added properties in config.csv to customize them.
  • Added a reverse engineering batch : takes the terrain.bmp, topology.bmp and provinces.bmp and tries to create an input.bmp, climate.bmp and settlements.bmp in a new folder. The input and climate don't work very well, but the settlements should be mostly usable as is. As it is it can only distinguish btween land provinces and sea provinces, not rivers and wastelands.
  • Fixed straits not appearing in-game. Unfortunately this just shows the tools generate far too many, so some manual editting is required to make it look good.
  • Merchant republics start with a trade post in the capital province, owned by the doge. (This was to make up for the fact that tool-generated doges don't start the game with a large amount of gold like other patricians. I don't know why that is)
 
Last edited:
Admittedly, I'm... not fully sure what setting up the rest would fully include. Coding is very much not my thing, hah.
No coding required. There is one file in the map folder that the tools don't overwrite, terrain.txt. It defines every terrain type for gameplay purposes, incuding marsh. Maybe you can even define some of your own, I'm not sure.
After that block there are some more line, each one mapping a gameplay terrain type to a color in the terrain.bmp's palette. You could just change one line, for example :
text_13 = { type = coastal_desert color = { 13 } priority = 13 }
becomes
text_13 = { type = marsh color = { 13 } priority = 13 }
See the article on the wiki :
https://ck2.paradoxwikis.com/Map_modding#Terrain

could this be used as a scenario editor as well? I think I could boot up the vanilla map but how much could I do?
I don't think that could quite work yet, I mean you could RE settlements from the vanilla map, and work from there, but it's a lot of work.
 
Thank your works. It is wonderful!
When I run "6 - Make Provinces Setup.bat", it always tell me "ERROR: Culture not found for province Pronvince [coord=[x=34, y=873], provinceName=Province0001]: 125,125,125
0124548057143.jpg

There are cultures.csv and cultures.bmp in input, and both their RGB are same. I don't know what is wrong. Can you help me?