• 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.
Hey! I've been playing around a lot with the map tool since you've helped me and am working on a bigger project. Unfortunately I now get a weird error in the province set up phase. I didn't get this before and I am not sure why it appeared now.

It is a weird Out of bounds exception eror. 2816 to be exact. I am sending my input file along with this as well. So far the only thing I can link this 2816 number to is the size of my maps. If it is linked to that then I find it weird because I have made larger maps.

I hope you can help me out again! Thank you in advance.

Hi. Found your problem. It's an edge case I should have ironned out, but in the meantime : You have a port at 368;2815 on the very edge of the map. It's placed here automatically because that is the nearest coast from your settlement at 390;2807, the nearby water body is not a sea zone so it cannot generate a port, but the ocean on the west can. When the program tries to figure out which way the port should be facing it peeks at all surrounding pixels to determine if they're water or land, unfortunately in this case, some of those pixels are outside the map boundaries, so it crashes.

To fix that you have a few options : move that settlement a bit west and north so that the port isn't so far to the south, or extend the map south so that your land provinces don't directly border the edge, or add some impassable terrain or a wasteland in provinces.bmp where your land provinces are touching the edge of the map.
 
Hi. Found your problem. It's an edge case I should have ironned out, but in the meantime : You have a port at 368;2815 on the very edge of the map. It's placed here automatically because that is the nearest coast from your settlement at 390;2807, the nearby water body is not a sea zone so it cannot generate a port, but the ocean on the west can. When the program tries to figure out which way the port should be facing it peeks at all surrounding pixels to determine if they're water or land, unfortunately in this case, some of those pixels are outside the map boundaries, so it crashes.

To fix that you have a few options : move that settlement a bit west and north so that the port isn't so far to the south, or extend the map south so that your land provinces don't directly border the edge, or add some impassable terrain or a wasteland in provinces.bmp where your land provinces are touching the edge of the map.
Respect modder, can i use 2 pixels instead of 1 pixel to draw a river? Because using a single pixel to draw a river often makes it impossible to connect the rivers together, and there will be disconnections, or ignore these disconnections?

In addition, when setting up provincial settlements, I sometimes point more than one point because of trembling hands. Is this negligible or should I try to avoid it as much as possible?
 
can i use 2 pixels instead of 1 pixel to draw a river?
Because using a single pixel to draw a river often makes it impossible to connect the rivers together, and there will be disconnections, or ignore these disconnections?
For major rivers (vikings can sail on), yes can be as wide as you want.
For minor rivers no, must be 1-pixel wide or the game will not draw them, because it's impossible to tell which way it is flowing.
I am not sure what you mean by disconnections. For minor rivers use a red pixel to merge rivers (merged river should not have a source !). If you have many rivers merging into each other, it's probably best to use a major river instead.

In addition, when setting up provincial settlements, I sometimes point more than one point because of trembling hands. Is this negligible or should I try to avoid it as much as possible?
It must be just one pixel or it will count as 2 or more provinces. You can use the "Fill Settlements Map" to make things faster and avoid manual errors like this. It will add settlements in empty areas, but will not move or remove the ones you place manually.
 
For major rivers (vikings can sail on), yes can be as wide as you want.
For minor rivers no, must be 1-pixel wide or the game will not draw them, because it's impossible to tell which way it is flowing.
I am not sure what you mean by disconnections. For minor rivers use a red pixel to merge rivers (merged river should not have a source !). If you have many rivers merging into each other, it's probably best to use a major river instead.


It must be just one pixel or it will count as 2 or more provinces. You can use the "Fill Settlements Map" to make things faster and avoid manual errors like this. It will add settlements in empty areas, but will not move or remove the ones you place manually.

Thank you for your puzzles. I have five new ones next.

1. I call the main river in the red circle "disconnection". Is it okay?
70313edda3cc7cd98c107e903701213fb90e91dc.jpg


2. I found that in your illustration, the mainland coastline also has the color of the major rivers. Is this necessary?
3. Similarly, in your illustration, why are the faint shadows on both sides of the major river and what topography do I need to add?
b7fe1c338744ebf8d7cad476d7f9d72a6159a75b.jpg


4. Can major rivers flow from one sea to the Mediterranean? For example, in the figure.
c3aef924b899a901d36ceb7f13950a7b0308f5b9.jpg


5. What RGB should the lake be filled with? Major rivers or water?
 
Thank you for your puzzles. I have five new ones next.

1. I call the main river in the red circle "disconnection". Is it okay?
70313edda3cc7cd98c107e903701213fb90e91dc.jpg
Okay I see. The tool will try to detect and correct these automatically (for both minor and major rivers). But you can fill them up manually if you don't like the results.

Thank you for your puzzles. I have five new ones next.
2. I found that in your illustration, the mainland coastline also has the color of the major rivers. Is this necessary?
3. Similarly, in your illustration, why are the faint shadows on both sides of the major river and what topography do I need to add?
b7fe1c338744ebf8d7cad476d7f9d72a6159a75b.jpg
No it's not necessary. In fact you should probably avoid it with newer versions (or it will not generate beaches)
This light green terrain is for farmlands, you do not need to add it, unless you want some farmlands.

Thank you for your puzzles. I have five new ones next.
4. Can major rivers flow from one sea to the Mediterranean? For example, in the figure.
c3aef924b899a901d36ceb7f13950a7b0308f5b9.jpg
Yes you can connect seas with rivers no problem. That might cause some issues for the AI if it cannot sail rivers, because they might believe they can sail from A to B, but in reality they can't. It's probably not very important right now.

5. What RGB should the lake be filled with? Major rivers or water?
Either is fine. It only changes the depth of the sea on topology.bmp. Also major rivers will not create 1-pixel sandy beaches near the shore.
 
Okay I see. The tool will try to detect and correct these automatically (for both minor and major rivers). But you can fill them up manually if you don't like the results.


No it's not necessary. In fact you should probably avoid it with newer versions (or it will not generate beaches)
This light green terrain is for farmlands, you do not need to add it, unless you want some farmlands.


Yes you can connect seas with rivers no problem. That might cause some issues for the AI if it cannot sail rivers, because they might believe they can sail from A to B, but in reality they can't. It's probably not very important right now.


Either is fine. It only changes the depth of the sea on topology.bmp. Also major rivers will not create 1-pixel sandy beaches near the shore.

Thank you very much for your answer.
 
Hi. Found your problem. It's an edge case I should have ironned out, but in the meantime : You have a port at 368;2815 on the very edge of the map. It's placed here automatically because that is the nearest coast from your settlement at 390;2807, the nearby water body is not a sea zone so it cannot generate a port, but the ocean on the west can. When the program tries to figure out which way the port should be facing it peeks at all surrounding pixels to determine if they're water or land, unfortunately in this case, some of those pixels are outside the map boundaries, so it crashes.

To fix that you have a few options : move that settlement a bit west and north so that the port isn't so far to the south, or extend the map south so that your land provinces don't directly border the edge, or add some impassable terrain or a wasteland in provinces.bmp where your land provinces are touching the edge of the map.

Thank you for helping again. I got it to work again though I find it odd it broke. I don't believe I changed anything down there and it worked fine before.
 
Okay I see. The tool will try to detect and correct these automatically (for both minor and major rivers). But you can fill them up manually if you don't like the results.


No it's not necessary. In fact you should probably avoid it with newer versions (or it will not generate beaches)
This light green terrain is for farmlands, you do not need to add it, unless you want some farmlands.


Yes you can connect seas with rivers no problem. That might cause some issues for the AI if it cannot sail rivers, because they might believe they can sail from A to B, but in reality they can't. It's probably not very important right now.


Either is fine. It only changes the depth of the sea on topology.bmp. Also major rivers will not create 1-pixel sandy beaches near the shore.

Respect modder, new problems have arisen in my map making, namely:"completed with minor error in 18s, error in rives. check the logs for more detail.:"

When i go to see logs, I find "River error at coordinates 1005;1601 : found multiple possible paths".

How can I find a target and prevent this from happening?In addition, how much impact does this issue have on map making?

2d7b0cdda3cc7cd96d73e8953701213fb90e9171.jpg

Besides, can settlements be above rivers?

What's the difference between GREEN and BLACK? Aren't they all impassable?

I also want to know one thing, if the inner sea can use CYAN, then through what function, let the tool distinguish between this is the main river or inner sea?

It's not a problem, it's a feeling. I find that this tool tends to fill settlements automatically, that is, to put settlements in places with rivers and never keep away from.
 
Last edited:
Respect modder, new problems have arisen in my map making, namely:"completed with minor error in 18s, error in rives. check the logs for more detail.:"

When i go to see logs, I find "River error at coordinates 1005;1601 : found multiple possible paths".

How can I find a target and prevent this from happening?In addition, how much impact does this issue have on map making?

Hi, the program goes from the sources of the rivers and tries to move along the path formed by the river. If it meets river merges or river splits, those are then followed as well. If there is more than one path possible then it does not know which way to go and raises a warning.
usually it looks like this (blue 2x2 pixel square) :
PO1CNLh.png


2d7b0cdda3cc7cd96d73e8953701213fb90e9171.jpg

Besides, can settlements be above rivers?

What's the difference between GREEN and BLACK? Aren't they all impassable?

I also want to know one thing, if the inner sea can use CYAN, then through what function, let the tool distinguish between this is the main river or inner sea?

It's not a problem, it's a feeling. I find that this tool tends to fill settlements automatically, that is, to put settlements in places with rivers and never keep away from.

Settlements can be placed on minor rivers no problem.
Green is for wastelands, like siberia or the sahara. They're normal provinces that don't have a ruler and can never have one.
Black on provinces.bmp is a special engine-hardcoded "province" for unpassable mountains. It looks slightly different in-game. there is also a special white province for seas (mare incognitum).

There is functionally no difference between a major river and an inner sea. It's a body of water that does not generate ports and cannot be navigated by fleets, except by vikings.

Yes, the settlement filling tool tneds to put settlements on rivers and coasts first, then fill the rest randomly. Historially, that's where human settlements tend to be more common, but maybe it shouldn't be exactly on the river, just next to it.
 
Hi, the program goes from the sources of the rivers and tries to move along the path formed by the river. If it meets river merges or river splits, those are then followed as well. If there is more than one path possible then it does not know which way to go and raises a warning.
usually it looks like this (blue 2x2 pixel square) :
PO1CNLh.png




Settlements can be placed on minor rivers no problem.
Green is for wastelands, like siberia or the sahara. They're normal provinces that don't have a ruler and can never have one.
Black on provinces.bmp is a special engine-hardcoded "province" for unpassable mountains. It looks slightly different in-game. there is also a special white province for seas (mare incognitum).

There is functionally no difference between a major river and an inner sea. It's a body of water that does not generate ports and cannot be navigated by fleets, except by vikings.

Yes, the settlement filling tool tneds to put settlements on rivers and coasts first, then fill the rest randomly. Historially, that's where human settlements tend to be more common, but maybe it shouldn't be exactly on the river, just next to it.

Well, after revisiting the example, I understand the error, but river.bmp is so huge, is there any quick way to find the wrong river? If not, can i ingore them? Does this have any impact on the game?
 
Last edited:
Well, after revisiting the example, I understand the error, but river.bmp is so huge, is there any quick way to find the wrong river? If not, can i ingore them? Does this have any impact on the game?

Sorry I didn't reply to that part.
It's actually (relatively) easy to find, it gives you the coordinates : River error at coordinates 1005;1601
that's the (x;y) coordinates of where it stopped. I assume your image editor can display coordinates ? MSPaint can do it.

If you don't fix it, your river will not display correctly in-game and will not give penalties for land battles. That's a minor problem.
 
Sorry I didn't reply to that part.
It's actually (relatively) easy to find, it gives you the coordinates : River error at coordinates 1005;1601
that's the (x;y) coordinates of where it stopped. I assume your image editor can display coordinates ? MSPaint can do it.

If you don't fix it, your river will not display correctly in-game and will not give penalties for land battles. That's a minor problem.

e, I use PS to edit rivers. The coordinates I found seem to be different from those described in logs, so do I must to download MSPaint ?
 
e, I use PS to edit rivers. The coordinates I found seem to be different from those described in logs, so do I must to download MSPaint ?
The coordinates that CK2 uses is based off of the bottom left corner. Most image editors base their coordinates off of the top left corner. So you have to do a little math to get the height.
 
The coordinates that CK2 uses is based off of the bottom left corner. Most image editors base their coordinates off of the top left corner. So you have to do a little math to get the height.
That's a good point but my program uses top left for origin as well (at least internally), so it should match with photoshop.
 
The coordinates that CK2 uses is based off of the bottom left corner. Most image editors base their coordinates off of the top left corner. So you have to do a little math to get the height.
That's a good point but my program uses top left for origin as well (at least internally), so it should match with photoshop.
I found this in the information of PS. From this picture, I think his unit is centimeter, while the unit in logs is millimeter, so just convert it.
001f1bdbb6fd5266855adea4a518972bd5073665.jpg


(
But I found a wrong River in the logs, which shows coordinates of "311;619". If I look at it in the way I mentioned above, it's the ocean, there's no river at all.

So can I only download MSPaint?)

wait, I've solved it. I found that the 画图 that comes with the Window provides coordinates in logs, so I can use the 画图 to find where he is, and then adjust it with PS.
 
Last edited:
Settlements and Provinces

The next step is probably the second most important, and one I should probably have partially automated. Open up the settlements.bmp that is found in the input folder. It looks like input.bmp with the size of the real map, and now it also has minor rivers painted on it (gray). The purpose of this file is to mark the location of every major settlement in your world.
1 pixel = 1 settlement = 1 province
The goal is to fill the map with just the right amount of dots to make as large or small province as you want.

There are a few hard color codes used here as well, they are :
RED (255, 0, 0) : Marks a settlement spot. A (land) province will be created around here.
YELLOW (255, 255, 0) : Marks a MAJOR settlement spot. This is identical to a red spot for now, but it will receive certain bonuses in later steps. Typically there should be zero or one in each dejure kingdom.
BLUE (0, 0, 255) : Marks a water node. A (sea) province will be created around it.
CYAN (0, 255, 255) : Marks a river node. A (major river / inner sea) province will be created around it.
GREEN (0, 255, 0) ; Marks a wasteland node. A regular land province will be created around it, but it will be ignored by most steps, and will not generate a ruler.
BLACK (0,0,0) : Completely optional a this stage. Will be marked as impassable terrain.

Just like for rivers, these colors need to be exact, and anything that doesn't fit is ignored.

Since the map terrain and rivers are already painted on the settlements.bmp, that makes it rather easy to determine where yoy think a settlement should grow. Typically alongside rivers, coastlines, and mountain passes. It takes a lot of trial and error, and a lot of rework to get it right and I doubt an automated tool would do much better than a human here.

Here is an example of WIP :
syjUGxV.png



Once I'm done I can run "4 - Make Provinces Map.bat"
Near the end there might be some warning messages like "X pixels could not be assigned". This generally means you have forgotten to put some settlements on an island, or you have some weird geography that makes some bit of land unreachable by any of your settlements. So the program doesn't know which province to assign to these land pixels to. You can either go back in settlements.bmp and add some settlements, or edit provinces.bmp directly to attach them to a province yourself. This might be prefereable if you want a province to be made of several small islands, something the tools do not manage well currently.

Common mistakes include forgetting to add any water nodes, placing water nodes on land, or settlements in the sea.

At the end I get this provinces.bmp
NzZ6v7g.png

Not too bad !

But it needs a few manual corrections.

First, the point where major rivers and seas merge almost always looks wrong. Usually the river "spills" into the sea, like here.

Secondly, the provinces in the south, near the desert look kind of wrong, because I didn't put any settlements in the middle of the desert. What I want to do here is put a wasteland province.

Making a wasteland and calling it peace

To create a wasteland province, you simply add a pixel in settlements.bmp, just like for a regular province, but with a pure green color instead of red.
This can be done retroactively, just be sure your pixel is inside the province and that there isn't another.

Lastly, it could be a good idea to add impassable mountains and mare incognitum manually at this point, although it can be hard to know exactly where they would make the most sense. I find it is better to open the map in-game to take note of which province borders look like they should not be passable.

For now I will forget about impassable mountains and just add a wasteland to the south. I picked the color yellow, because, like, sand.
It looks like this :
o4coKIy.png



Final Notes

You might notice that the MakeProvinces creates a provinces.bmp both in input and output folders. I made the tool make a copy in the input folder because I found myself overlaying it constantly when editting other files.
If you run it multiple times you might also notice two things :
  • First it creates a backup of the previous file in the input directory. This is because with manual editting being nearly mandatory, it would be a shame if those changes were tragically lost to a misclick... (that absolutely did not happen to me).
  • Secondly you'll notice that even though they are randomly generated, the provinces do not change color when the tool is re-run. This is rather important because it makes it easier to just add a settlement or 2, rerun the batch, and merge the provinces.bmp manually. If the colors were completely changed you would have to throw everything away from that point, which was how the old version of the tools worked.

Another thing to note is that after you are finished with rivers.bmp and settlements.bmp, you should probably run "1 - Make Terrain Maps.bat" again. This program actually uses info from those 2 files in a few cases.
  • Rivers running through the desert will automatically create patches of grassland around them
  • Rivers running through mountains will lower and flatten the terrain immediately beneath them, so it looks more natural and they are less likely to flow upwards
  • Settlements in deserts will create patches of grass and palm trees around them, to make it look like there's an oasis of sorts at that place.
  • Settlements in mountains will also lower and flatten the ground around them so the little houses look less distorted in-game.

Getting it into the game already

There are still many steps to go, but at this point we can skip them and witness the glory of our map running into the game.
Let's run "6 - Make Provinces Setup.bat"

It will generate a ton of new files. Just copy the whole content of the output folder into this empty mod : https://www.dropbox.com/s/yuce8oknw0doqqe/LNL TestMap mod.zip?dl=0
Launch the game with this mod active.

And it's aliiiive :
gzZaKOs.jpg

35HsvES.jpg

9MMMBCV.jpg

poMJSug.jpg

RipkMTx.jpg

1.
Respect modder, I set up wasteland at the beginning, but I found that the geographical scope of wasteland was not satisfactory to me. Can I adjust it directly in the provincial interface?

Or should I not put wasteland in the first place, but wait for the first map of the province to come out before putting it in? If so, is there any way to remedy it?

2.
I also found a problem. If I first clicked on "1 - Make Terrain Maps. bat", I could make a 3 map in about a minute, but if I clicked on "1 - Make Terrain Maps. bat" again without deleting all the files in input, it would be stuck in "something heights (1)".

What happened?
 
Last edited:
1.
Respect modder, I set up wasteland at the beginning, but I found that the geographical scope of wasteland was not satisfactory to me. Can I adjust it directly in the provincial interface?

Or should I not put wasteland in the first place, but wait for the first map of the province to come out before putting it in? If so, is there any way to remedy it?

Yes, you can and should modify the province.bmp yourself. Just make sure it is the one in input (it will overwrite the one in output).


2.
I also found a problem. If I first clicked on "1 - Make Terrain Maps. bat", I could make a 3 map in about a minute, but if I clicked on "1 - Make Terrain Maps. bat" again without deleting all the files in input, it would be stuck in "something heights (1)".

What happened?

No idea. You should not delete anything in input. If anything maybe relaunch the ui to clear memory, but that has never been necessary in my experience. OF course my maps are always smaller than vanilla.
 
Yes, you can and should modify the province.bmp yourself. Just make sure it is the one in input (it will overwrite the one in output).




No idea. You should not delete anything in input. If anything maybe relaunch the ui to clear memory, but that has never been necessary in my experience. OF course my maps are always smaller than vanilla.


1.
Well, is that because my map is too big? That's all right. Anyway, the terrain also exists. It's a pity that secondary adjustment can't be used, but it's still tolerable.

Then I typed "smoothing height (1)" into "something height (1)" in front of me. And I tried to delete logs to use tool, but I still couldn't use “1 - Make Terrain Maps.bat” - I'm still not satisfied. I'll try another new method.

After checking logs, I found this item in logs, "ERROR parsing config. CSV file: mod_folder does not exist." Is this the reason why my map failed?

2.
Then the black dots on the map seem to be invisible to the generated provinces. Can you see them when you enter the game?

3.
I made beta with the original map. It was exciting to see my mod successfully in the game, but there were also some minor problems. What happened?
60a0a13533fa828b5ebb1750f31f4134960a5a0c.jpg

ea4f3f2eb9389b5084f215e18b35e5dde6116e97.jpg
 
Last edited:
After checking logs, I found this item in logs, "ERROR parsing config. CSV file: mod_folder does not exist." Is this the reason why my map failed?
No I don't think that's a problem, it's only really used for cultures. You should probably fix that (just make it point to the base game if you don't have a custom mod yet), but it's not going to crash the tool nor the game.

Then the black dots on the map seem to be invisible to the generated provinces. Can you see them when you enter the game?
I am not sure what you mean ?

I made beta with the original map. It was exciting to see my mod successfully in the game, but there were also some minor problems. What happened?
60a0a13533fa828b5ebb1750f31f4134960a5a0c.jpg

ea4f3f2eb9389b5084f215e18b35e5dde6116e97.jpg
Huh... interesting... Your messed up straits make it look like your adjacencies is out of date with the rest of the files and your province ids have shifted.
Go in Make Provinces, uncheck Make Provinces (you don't want to overwrite your changes), check Make Adjacencies and GO. Then Make Setup and GO.
 
No I don't think that's a problem, it's only really used for cultures. You should probably fix that (just make it point to the base game if you don't have a custom mod yet), but it's not going to crash the tool nor the game.


Okay, so I can rest assured.

I am not sure what you mean ?

Shouldn't BLACK (0, 0, 0) be an inaccessible area in place? But black on my map doesn't seem to work. It's not impassable.But there is a landscape like the Alps in the original edition, but I think it's not a mountain landscape, it's not about black, right?

Huh... interesting... Your messed up straits make it look like your adjacencies is out of date with the rest of the files and your province ids have shifted.
Go in Make Provinces, uncheck Make Provinces (you don't want to overwrite your changes), check Make Adjacencies and GO. Then Make Setup and GO.

Oh, well, since there is a bug that can be solved, I'm relieved. Now I'm still focusing on adjusting the settlement.

Now I found the problem of settlement. When I redrawn the province, it seemed to cover the settlement outside the wilderness, which led to errors in operation.