• 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.

Keizer Harm

Swamp German
46 Badges
Jan 28, 2013
2.785
4.401
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Sunset Invasion
  • Victoria 2
Tired of generated titles that look like a neon rainbow and make your eyes bleed? Too lazy to go over 5500 counties and give them all aesthetically pleasing colours manually? This tool is there for you!

I made this in one inspired evening. Here's a preview, using the Bronze Age map (which, for the record, is a great mod with what I consider a very pretty map - except for the rainbow titles :)).
BronzeAgeBeforeAfter.png


In summary, the colours for the top-level titles (usually empires) are kept, then every title under those is given shades of the liege title. The lower the tier, the subtler the differences become. There's also ways to make specific titles keep their colour, and there's settings that you can tweak to determine exactly how different the shades at each level should be.

When you run the tool, the titles file is parsed and all the titles included are collected into the program memory. Then most of the titles are selected to be assigned new colours. Two categories of titles are skipped: top-level titles, and titles which you specify should be skipped using the following key word "#KEEPTHISCOLOUR". Put that behind the colour entry in the title definition, like here:

Code:
k_anahuac = {
    color = { 43 255 230 } #KEEPTHISCOLOUR
    ...
}

The titles that need be recoloured are organised under their parent (liege) title, by tier. The highest titles (that need recolouring) should be maximally distinct from each other, the lowest titles should be subtly different shades (but still perceptibly different). The standard settings reflect that.

For example, a title structure for the tool to parse could look like this:

Code:
e_cemanahuac (green)
├k_anahuac (red)
│├d_texcoco (pink)
││├c_tenochtitlan (bright blue)
││└c_iztapalapa (violet)
│└d_xaltocan (vermillion)
│ ├c_xaltocan (maroon)
│ └c_otompan (cyan)
└k_tlaxcala (red)
├d_tepeticpac (navy blue)
│├c_tepeticpac (off-white)
│└c_tizatlan (beige)
└d_ocotelolco (carnation)
   ├c_ocotelolco (chestnut)
   └c_quiahuiztlan (sky blue)

The empire has a defined colour, green. The others also have colours but those will be ignored by the tool. After running, the titles will look like this:

Code:
e_cemanahuac (green)
├k_anahuac (lime)
│├d_texcoco (french lime)
││├c_tenochtitlan (french lime but slightly darker)
││└c_iztapalapa (french lime but slightly yellower)
│└d_xaltocan (electric lime)
│ ├c_xaltocan (electric/lemon lime)
│ └c_otompan (electric lime but slightly whiter)
└k_tlaxcala (teal)
├d_tepeticpac (british racing green)
│├c_tepeticpac (brunshwick green)
│└c_tizatlan (british racing green but slightly bluer)
└d_ocotelolco (dark spring green)
   ├c_ocotelolco (medium-dark spring green)
   └c_quiahuiztlan (regular spring green)

So every vassal title will be a shade of the liege title, and the higher the tier, the more drastically different it can be. You can change the settings to determine just how great the colours differences should be at each level.

Now, but what if you want to force the Tlaxcala kingdom to remain red? Fine, enter this title structure instead:
Code:
e_cemanahuac (green)
├k_anahuac (red)
│├d_texcoco (pink)
││├c_tenochtitlan (bright blue)
││└c_iztapalapa (violet)
│└d_xaltocan (vermillion)
│ ├c_xaltocan (maroon)
│ └c_otompan (cyan)
└k_tlaxcala (red) #KEEPTHISCOLOUR
├d_tepeticpac (navy blue)
│├c_tepeticpac (off-white)
│└c_tizatlan (beige)
└d_ocotelolco (carnation)
   ├c_ocotelolco (chestnut)
   └c_quiahuiztlan (sky blue)

And you will get:

Code:
e_cemanahuac (green)
├k_anahuac (lime)
│├d_texcoco (french lime)
││├c_tenochtitlan (french lime but slightly darker)
││└c_iztapalapa (french lime but slightly yellower)
│└d_xaltocan (electric lime)
│ ├c_xaltocan (electric/lemon lime)
│ └c_otompan (electric lime but slightly whiter)
└k_tlaxcala (red)
├d_tepeticpac (maroon)
│├c_tepeticpac (dark maroon)
│└c_tizatlan (bright maroon)
└d_ocotelolco (hot pink)
   ├c_ocotelolco (light hot pink)
   └c_quiahuiztlan (carnation pink)

The concept should be clear. Because the top-level colour is never adjusted, you can enter your entire 00_landed_titles.txt file without an issue. Some unlanded titles may be defined outside the structure, like k_papal_state in vanilla, but because they are at the root level their colours are never altered. On the other side, the tool is just fine with the input of a single empire structure, or even a single kingdom or duchy; it will similarly keep the root title(s) the same colour as before, and recolour the others in accordance with their rank (as determined by the e_, k_, etc. prefix).

New colours are generated using random values in the CIE L*a*b* 1976 colour space, which claims to be perceptually uniform. Colour difference is determined with the CIE Delta-E 2000 formula.

The tool is attached to this post, with detailed instructions inside. It should run on any Windows 64-bits environment; I don't think that installing .NET is required, but I am not that skilled in deployment so this will be a learning experience for both of us. Let me know if it works, and what you think of it!

SOURCE (so you can stare at my ugly code): https://github.com/KeizerHarm/CK3-Map-Title-Colouriser

Changelog:

1.1: added support for the named colours in the game, and added an error message when a title in your tree has no pre-existing colour.
 

Attachments

  • MapTitleColouriser1.1.zip
    11,3 MB · Views: 0
Last edited:
  • 6Love
  • 4Like
Reactions:
So this all seems really useful. Except of course I have no idea how to actually run the thing. The detailed explanation is definitely good to have. But perhaps it should include info on how to run the program, because right now I have no idea whether I should use a certain program to do so or not. I just know that it doesn't work similarly to .exe files. I tried googling how to do it but that just makes me more confused.

Any help with that would be appreciated.
 
Last edited:
So this all seems really useful. Except of course I have no idea how to actually run the thing. The detailed explanation is definitely good to have. But perhaps it should include info on how to run the program, because right now I have no idea whether I should use a certain program to do so or not. I just know that it doesn't work similarly to .exe files. I tried googling how to do it but that just makes me more confused.

Any help with that would be appreciated.
What info do you need? There is an exe file in the attachment to the post: you should be able to run it on a Windows computer
 
What info do you need? There is an exe file in the attachment to the post: you should be able to run it on a Windows computer
Ah whoops I see now what went wrong. I clicked on the link to the github thinking that was what I was supposed to do. And then got all confused when there was no .exe file :). I didn't consider to also check the attachment because I thought it would get me to the same point.
Anyway thanks for pointing that out.
 
  • 1Like
Reactions:
Hey KH, thanks for this tool, it's perfect! I have an odd, self-imposed use case where it'd be nice to set a seed for color generation. Is that possible?

I'm asking in case it's really easy. If not, it's not at all worth sorting out, as my use case really is an odd one I can get around.

Thanks!
 
Hey KH, thanks for this tool, it's perfect! I have an odd, self-imposed use case where it'd be nice to set a seed for color generation. Is that possible?

I'm asking in case it's really easy. If not, it's not at all worth sorting out, as my use case really is an odd one I can get around.

Thanks!
Not that hard, but I am a bit pressed for time at this moment. It's a good feature suggestion and I'll definitely include it when I get around to making the next version but don't count on that happening tomorrow or this weekend necessarily
 
  • 1Like
Reactions: