• 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.
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?
Well, if you've checked that this one pixel is definitely of the same color as what you put in the csv (125,125,125), then it's probably a format error. Did you save cultures.bmp as a 32-bit image maybe ?
If you still can't find the problem, you can send me your 2 cultures files and I will take a look.
 
Well, if you've checked that this one pixel is definitely of the same color as what you put in the csv (125,125,125), then it's probably a format error. Did you save cultures.bmp as a 32-bit image maybe ?
If you still can't find the problem, you can send me your 2 cultures files and I will take a look.
Thank you! I have checked the files,but the files are fine, and the fault is still the same. Can you help me to see what is wrong?
 

Attachments

  • input.zip
    281,9 KB · Views: 6
Ok I think I have an idea, your map is fine, but it's not parsing the cultures correctly, this is what it looks like on my end :
6SCzpA1.png

Is your 00_cultures.txt file (from the game) modified somehow ? or maybe it's using a different encoding ?
 
Last edited:
I'm excited about this, I've been creating a mod for quite a while now, but although I wanted to, I never could create a map for it. Now maybe I can with these tools by you.
I have one problem though: If I use "6 - make province setup", cmd.exe tells me the following:
problem1.JPG problem2.JPG
I don't know what to do about this. I might add that this is happening during try-out using your original input files, following thread step by step.
Edit: Just realized that this seems to be about the same problem as above. My apologies for the redundancy. Although I still think it's noteworthy that I'm using your original files.
 
Last edited:
Hey Loc, thanks for your map tool.
One question: is there a limit to the number of provinces the tool can handle?
On your older original version of the tool (around march?), it had no problems handling a massive map with thousands of provinces.
This current iteration of your tool is throwing me an 'out of memory' error at the '6 - Make Provinces Setup' mark.
But I'm not entirely sure whether the number of provinces is actually the cause of the problem.
screen.png
 
I'm excited about this, I've been creating a mod for quite a while now, but although I wanted to, I never could create a map for it. Now maybe I can with these tools by you.
I have one problem though: If I use "6 - make province setup", cmd.exe tells me the following:
I don't know what to do about this. I might add that this is happening during try-out using your original input files, following thread step by step.
Edit: Just realized that this seems to be about the same problem as above. My apologies for the redundancy. Although I still think it's noteworthy that I'm using your original files.

Not sure if this will help, but I had the same problem and fixed it by changing the mod_folder line in the config.csv to be on C: instead of D:.
 
For some reason, at first it didn't help, and then, without changing anything, it worked.
 
Hey Loc, thanks for your map tool.
One question: is there a limit to the number of provinces the tool can handle?
On your older original version of the tool (around march?), it had no problems handling a massive map with thousands of provinces.
This current iteration of your tool is throwing me an 'out of memory' error at the '6 - Make Provinces Setup' mark.
But I'm not entirely sure whether the number of provinces is actually the cause of the problem.

Hi, I'm sorry to hear that. There is no coded limit, except for the limitations of the language (which you won't meet) and the limits of the hardware.
I always envisionned this as being used for maps -at most- the size of the vanilla map, so that's what I tested for.
Judging by where it failed, I think your problem is not the number of provinces but possibly the total size of the map, or the size of one province in particular. Can you tell me your map size and a rough estimation of the number of pixels in your largest province ?

EDIT : While it's not a great solution, if you have enough RAM, you can use the nuclear option. Edit the 6 - Make Provinces Setup.bat with a text editor and change the first line to this :
java -Xmx8g -classpath "./bin" ck2maptools/main/CK2MakeProvinceSetup
This tells Java it can use up to 8GB of memory.
 
Last edited:
Welp, had the same problem as the last guy. Found out I was using 32bit java. Once I installed the 64bit version and used that command, everything worked wonders, thanks a lot !

Something I want to ask is, why does europe appear as the sea ? Here's an image
 

Attachments

  • CK2game_2018-10-25_01-31-15.jpg
    CK2game_2018-10-25_01-31-15.jpg
    531 KB · Views: 66
Last edited:
Welp, had the same problem as the last guy. Found out I was using 32bit java. Once I installed the 64bit version and used that command, everything worked wonders, thanks a lot !

Something I want to ask is, why does europe appear as the sea ? Here's an image

It looks like it's still using the default colormap_water.dds file, the new one should have been made with the #2 bat file (Make Terrain Color Maps)
 
Gonna need a lot more testing with different options ticked but at the moment I' getting a crash when I try generate a random world. Even turning off stuff like the HRE and making dejure kingdom and empire sizes smaller doesn't seem to help. I'll let you know if I find any settings that seem to work though
 
How would I go about on adding provinces to an existing map? Would making blank areas for the OG provinces and the exporting the new provinces on top of the map be the way to go?
 
How would I go about on adding provinces to an existing map? Would making blank areas for the OG provinces and the exporting the new provinces on top of the map be the way to go?

Is the original map made with the tool or not ?

If not, put the map folder of the mod into the output folder of the tool, use the reverse-engineering batch, and grab the settlements.bmp, and put it into input folder.

Add red dots to settlements.bmp where you want to add provinces.

Run the Make Provinces batch.

Now you can merge your old provinces.bmp and the new one with gimp. I would do it by overlaying the old map over the new one, adding transparency to the old map, and erasing the areas where provinces have been added. Merge all layers and export to bmp (24-bits, no color index).
 
Is the original map made with the tool or not ?

If not, put the map folder of the mod into the output folder of the tool, use the reverse-engineering batch, and grab the settlements.bmp, and put it into input folder.

Add red dots to settlements.bmp where you want to add provinces.

Run the Make Provinces batch.

Now you can merge your old provinces.bmp and the new one with gimp. I would do it by overlaying the old map over the new one, adding transparency to the old map, and erasing the areas where provinces have been added. Merge all layers and export to bmp (24-bits, no color index).
What about the definition.csv file though? Will I have to reset the values?
 
Anyone managed to get a custom map working with the new random map feature yet?
Tries looking at the logs and there's a lot of notes about referencing events and such which don't exist, but it's hard to tell if they are the cause of the crashes or not. I'm going to keep poking around anyway to see if I can get one running. It would make the random games a lot more immersive having a new map too :)

EDIT:
Going to do some tests over the next day or two, seems like there's been some fundamental changes. common/province_setup is no longer used, the terrain types are now defined in the province history files.
Also the new common/alternate_start seems to be a likely cause for crashes. The 01_spread.txt file has vanilla province numbers for adjacencies and other province numbers to control the spread of random cultures and such. Seems like it's going to be a bit of a pain sorting that out for custom maps.

If anyone else finds any other large changes that might be causing issues be sure to post them too!
 
Last edited:
Okay, that wasn't as hard as I thought. Got random and shattered worlds working with the example map by loc-n-lol!

71777055492B289C3904284C1B6A051488B09FC6


Here's the basic instructions though:
  1. Delete the common/province_setup folder - it's no longer needed/used by the game.
  2. Create a folder called alternate_start in the common folder
  3. Copy 01_spread from the vanilla game's alternate_start folder into your mod's alternate_start folder
  4. Remove all entries in the adjacencies section
  5. search for any references of 'province = ' and delete those secitons of code
  6. Boot up the game with the mod and have some random fun!
To make things a little easier, here is the 01_spread.txt with everything done for you already, just delete everyhing in your txt and copy this over instead


Code:
adjacencies = {
}

culture_group_spread = {
    factor = 100
    
    modifier = {
        factor = 10
        num_culture_provinces < 20
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 30
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 40
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 50
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 60
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 70
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 80
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 90
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 100
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 110
    }
    modifier = {
        factor = 8
        culture_group = altaic
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }       
    modifier = {
        factor = 0.05
        culture_group = chinese_group
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = {
        factor = 3
        culture_group = latin
        year = 1000
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = { # Boost groups with many individual cultures somewhat
        factor = 1.5
        OR = {
            culture_group = byzantine
            culture_group = celtic
            culture_group = baltic
            culture_group = arabic
            culture_group = dravidian_group
        }
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = { # Boost groups with very many individual cultures even more
        factor = 3
        OR = {
            culture_group = byzantine
            culture_group = finno_ugric
            culture_group = iranian
            culture_group = indo_aryan_group
        }
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = {
        factor = 14
        OR = {
            culture_group = horse_group
            culture_group = cat_group
            culture_group = bear_group
            culture_group = hedgehog_group
            culture_group = duck_group
            culture_group = dog_group
            culture_group = dragon_group
            culture_group = elephant_group
        }
        has_alternate_start_parameter = { key = special_culture value = animal_kingdoms }
    }
    modifier = {
        factor = 0.5
        NOR = {
            culture_group = horse_group
            culture_group = cat_group
            culture_group = bear_group
            culture_group = hedgehog_group
            culture_group = duck_group
            culture_group = dog_group
            culture_group = dragon_group
            culture_group = elephant_group
        }
        has_alternate_start_parameter = { key = special_culture value = animal_kingdoms }
    }
}

culture_spread = {
    factor = 100
    
    modifier = {
        factor = 10
        num_culture_provinces < 3
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 5
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 10
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 15
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 20
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 25
    }
    modifier = {
        factor = 0.8
        num_culture_provinces > 30
    }
    modifier = {
        factor = 0.1
        culture = crimean_gothic
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.3
        culture = dalmatian
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.3
        culture = khitan
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.3
        culture = norman
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.6
        culture = occitan
        NOT = {
            has_alternate_start_setting = {
                setting = culture
                option = full_random
            }
        }
    }
}

religion_group_spawn = {
    factor = 100
    modifier = {
        factor = 0.001
        any_religion_distance < 200
    }
    modifier = {
        factor = 0.1
        any_religion_distance < 350
    }
    modifier = { # No starting on islands, except the British Isles
        factor = 0
        is_island = yes
        NOT = { region = world_europe_west_brittania }
    }
}

religion_group_spread = {
    factor = 100
    
    modifier = {
        factor = 10
        num_religion_provinces < 5
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 20
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 40
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 60
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 80
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 100
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 120
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 140
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 160
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 180
    }
    modifier = {
        factor = 0.035
        religion_group = jewish_group
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.25
        religion_group = zoroastrian_group
        year = 1000
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 5
        religion_group = pagan_group
        NOT = { year = 1000 }
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
        NOT = {
            has_alternate_start_setting = {
                setting = random_scenario_more_pagans
                option = checked
            }
        }
    }
    modifier = {
        factor = 2.25
        religion_group = muslim
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 2.75
        religion_group = christian
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 1.75
        religion_group = indian_group
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 25
        religion_group = pagan_group
        has_alternate_start_setting = {
            setting = random_scenario_more_pagans
            option = checked
        }
    }
}

religion_spread = {
    factor = 100
    
    modifier = {
        factor = 10
        num_religion_provinces < 2
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 10
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 20
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 30
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 40
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 50
    }
    modifier = {
        factor = 0.8
        num_religion_provinces > 60
    }
    modifier = {
        factor = 0.6
        religion = jain
        year = 1000
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.3
        religion = shiite
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.2
        religion = ibadi
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.65
        religion = orthodox
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.2
        religion = miaphysite
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.15
        religion = nestorian
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.05
        religion = taoist
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.2
        religion = manichean
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
    }
    modifier = {
        factor = 0.2
        religion = zun_pagan
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
        NOT = {
            has_alternate_start_setting = {
                setting = random_scenario_more_pagans
                option = checked
            }
        }
    }
    modifier = {
        factor = 0.5
        religion = bon
        NOT = {
            has_alternate_start_setting = {
                setting = religion
                option = full_random
            }
        }
        NOT = {
            has_alternate_start_setting = {
                setting = random_scenario_more_pagans
                option = checked
            }
        }
    }
}

dejure_kingdom_spread = {
    factor = 100
    modifier = {
        factor = 5
        distance = { where = FROM value < 100 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 200 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 300 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 400 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 500 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 600 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 700 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 800 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 900 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 1000 }
    }
}

dejure_empire_spread = {
    factor = 100
    modifier = {
        factor = 5
        distance = { where = FROM value < 100 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 200 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 300 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 400 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 500 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 600 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 700 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 800 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 900 }
    }
    modifier = {
        factor = 0.6
        distance = { where = FROM value > 1000 }
    }
}

holy_site_spread = {
    factor = 100
    # We want three holy sites within the religion's borders, and two outside
    modifier = {
        factor = 0
        NOT = { religion = FROM }
        FROM = { num_holy_sites_generated < 1 }
    }
    modifier = {
        factor = 0.01
        NOT = { religion = FROM }
        NOT = { parent_religion = { religion = FROM } }
        FROM = { num_holy_sites_generated < 3 }
    }
    modifier = {
        factor = 0.001
        NOT = { religion_group = FROM }
        FROM = { num_holy_sites_generated < 3 }
    }
    modifier = {
        factor = 0.001
        FROM = { num_holy_sites_generated >= 3 }
        religion = FROM
    }
    # Stay near our borders
    modifier = {
        factor = 2
        religion_group = FROM
    }
    # Avoid clustering
    modifier = {
        factor = 0 # We simply never want to be adjacent to a holy site
        any_neighbor_province = {
            is_holy_site = FROM
        }
    }
    modifier = {
        factor = 0
        holy_site_distance = { target = FROM value < 100 }
    }
    modifier = {
        factor = 0.01
        holy_site_distance = { target = FROM value < 200 }
    }
    modifier = {
        factor = 0.1
        holy_site_distance = { target = FROM value < 300 }
        FROM = { NOT = { religion_group = pagan_group } }
    }
    modifier = {
        factor = 20
        holy_site_distance = { target = FROM value > 500 }
        FROM = { num_holy_sites_generated > 0 }
    }
    modifier = { # Pagan sites tend to be closer
        factor = 30
        holy_site_distance = { target = FROM value < 350 }
        FROM = { religion_group = pagan_group }
    }
    modifier = {
        factor = 0 # We use this as a proxy for religion distance, because religion distance is expensive to calculate
        NOT = { religion = FROM }
        NAND = {
            parent_religion = { religion = FROM }
            FROM = { num_holy_sites_generated >= 3 } # Heresies can put their 3rd holy site in their parent religion
        }
        FROM = { num_holy_sites_generated > 0 }
        holy_site_distance = { target = FROM value > 400 }
    }
    # Sharing some holy sites with parent religion is neat
    modifier = {
        factor = 100
        FROM = {
            parent_religion = {
                ROOT = {
                    is_holy_site = PREV
                }
            }
        }
    }
}

Hope this helps loc_n_lol as well as the users of his amazing tool
 

Attachments

  • LnL mod.7z
    1,2 MB · Views: 13
It should be... I'll double check though.

Looks good on my end. Maybe the upload messed up though. Did you extract it into your documents/paradox interactive/crusader kings 2/mod folder?