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

LordPeter

Marjoram
49 Badges
Mar 5, 2012
2.249
382
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
Greetings fellow modders,

so after a long time of learning to code, publishing compatches and trying myself at my very own (sub)mods, finally has come the time where I have gotten something done that I can give back to the community.
Thus I now present to you:

FAKE MAPMODES

Why fake you ask? Let me explain in a bit of detail:
As we all know, it is not possible to mod in new mapmodes in CK2 as it is in e.g. Stellaris. And in contrast to EU4 which has almost every mapmode imaginable, CK2 has relatively few.
Thus, I experimented a while ago with "abducting" the revolt risk mapmode and using it to display other information. Problem was that I actually had to edit revolt risk which would have made this version unusable in multiplayer. Plus, I was limited to shades of red and green, as the revolt mapmode allows.

But recently, the awesome people at Paradox have introduced the option to have custom colorization of the map for councilor jobs. I sensed another method that could work far better then the "revolt risk" version, but until a few weeks ago I was busy with other stuff and couldn't give it a try.
But now I got it to work: It's still somewhat "fake" because you need a councilor to see it, but it is an incredibly powerful tool for modders to visualize stuff on the map.

HOW IT WORKS

I created a new job action for the steward (someone remind me that I create a "councilor modding" page on the wiki...). Shout-out to the awesome people who helped me figure out how to do this, @Thezezeal & @jursamaj!
This action can only be used by a player, and really it is not even designed to be used, just clicked on. That means you can even use it while your Steward is on another job: As long as you are just "considering" the job, so to say, it will display the custom map colorization anyway.
If you accidentally sent your councilor on such a job though (which is entirely useless), fear not, for I have included a MTTH event that after a few days will cancel the job and sent him home.
20180103143805_1.jpg
(I even did a fancy new icon based on the "Administer Realm" vanilla one)

However, maybe we would want to have two different custom mapmodes. How can we solve this? Solution (technical): Make the colors change both depending on the information on the map and a character flag that can be changed. Thus, the single councilor action can in fact produce an almost unlimited amount of different mapmodes, depending on which flag has been set (and by making it dependent on the character instead of global, in multiplayer two players could use different mapmodes).
To change which mapmode is active, the player can take a decision on the player character itself that fires and event (or potentially, an event chain) that allows the choice of a mapmode:
20180103143823_1.jpg

(I even tried to make it as little immersion-breaking as possible ^^)
20180103143828_1.jpg
In this example or proof-of-concept mod I have chosen to include just three potentially useful mapmodes I could think of right away, but of course there might be numerous more.
The ones included are:
  • SIMPLE TERRAIN - displays a color-overlay on the map that makes it easier to identify terrain (like the mapmode in EU4).
  • PROSPERITY & DEPOPULATION - displays provinces that are affected by either depopulation or are prospering (in hindsight the colors I chose here are sub-optimal, but that can be changed easily).
  • NUMBER OF HOLDINGS - displays how many holdings are currently constructed in a province.
I packed these into an example mod that works with the vanilla game. Note that I had to modify a .gui interface file to make the new councilor action look good, so the mod will produce graphical glitches with interface mods such as the one by @Arko (but compatibility can easily be achieved).
So, I hope that you are as excited as me about this new possibility, and a big thanks goes to the awesome CK2 dev team that continuously is making modding easier and more powerful!

Now, I will finish with some screens you are probably most interested of: The "fake" mapmodes in action:
20180103155301_1.jpg

Prosperity & Depopulation
20180103153957_1.jpg

Number of Holdings
20180103153812_1.jpg

Simple Terrain

Edit: Forgot to add, another cool thing about is that the game actually considers this to be sort of a mapmode. Because if you hit F10 (or whatever your button for map screenshot is), it will actually produce a .bmp screenshot of the fake mapmode! So you can have a proper image without all the interface noise ingame, if you want to evaluate data later.
ck2_map_31.png (changed to .png because not allowed to upload .bmp)

Credit:
This mod is thought as a resource, and I hope it will be helpful for other mods that want to display information on the map. You can use it as standalone, but it will not be updated.
You may use it in other mods freely, but of course I'd like to be credited. However, this really is as much a technical demonstration, so unless you use my code directly you need not credit me, as I don't owe the "idea" of this mod.
 

Attachments

  • Fake Mapmodes.zip
    16,1 KB · Views: 61
Last edited:
This is pretty cool. Good work!
 
Congratulations, that's one clever way to solve one of the (in my opinion) major QoL problem !
One mapmode that I'd like to see is the Hospital level (pretty self-explaining)

Other ideas :
- Religious conversion chances
- Culture conversion chances (for tribals)
- Powerful vassals
- Stat (diplo, stewardship, martial, intrigue, learning) level
 
This is extremely cool, and a clever workaround. Well done!
 
Bravo for the idea of using a single job action and events with flags for switching mapmodes. A couple thoughts from my private pokings on the idea:

-Create a "fake" cartographer councillor position, all the actions of this councillor would be mapmodes with no actual effects, so there's no risk to misuse the treasurer.

-Do we have an on-action for just when a job action is chosen? (that'd be far more convenient than a mtth. Or maybe a self-repeating event that onlt fires for the councillor of the player forst when hired. Events tested on a single xharacter every day must be cheaper than events tested every 20 days in a 1/20 of all characters, right?

-Have you considered having a set of (maybe targeted) decisions to pixk mapmode instead of options in an event? Cyxling through event options can get cumbersome when you have a handful of mapmodes.

But like I said, great job?

Edit: I'd recommend that you ask this to be added to the stickied list of mods/resources
 
Congratulations, that's one clever way to solve one of the (in my opinion) major QoL problem !
One mapmode that I'd like to see is the Hospital level (pretty self-explaining)

Other ideas :
- Religious conversion chances
- Culture conversion chances (for tribals)
- Powerful vassals
- Stat (diplo, stewardship, martial, intrigue, learning) level
Conversion chances are tricky, as they are not actually "on the map", so to say. Afaik, the conversion events are just MTTH events, and I am not sure how one would deviate percentage chances from them.
Powerful vassals should be possible, as should province/realm owner stats.
Sadly, I won't be adding these, as this mod here developed mostly as a "side effect" of my greater modding effort, and I just found it useful enough to publish it as a "proof of concept", so that others might be aware of the possibility.

Bravo for the idea of using a single job action and events with flags for switching mapmodes. A couple thoughts from my private pokings on the idea:

-Create a "fake" cartographer councillor position, all the actions of this councillor would be mapmodes with no actual effects, so there's no risk to misuse the treasurer.

-Do we have an on-action for just when a job action is chosen? (that'd be far more convenient than a mtth. Or maybe a self-repeating event that onlt fires for the councillor of the player forst when hired. Events tested on a single xharacter every day must be cheaper than events tested every 20 days in a 1/20 of all characters, right?

-Have you considered having a set of (maybe targeted) decisions to pixk mapmode instead of options in an event? Cyxling through event options can get cumbersome when you have a handful of mapmodes.

But like I said, great job?

Edit: I'd recommend that you ask this to be added to the stickied list of mods/resources
Yeah a new councilor could work, but I don't know how to set one up, and frankly it's not important to me. I feel like the risk from accidentally having your steward occupied with nonsense is worth it compared to the information gained.

Nope, no on_action that I am aware of. Might be a worthy suggestion though.

Yeah, but personally I am not a big friend of multiple decisions because imo they bloat the interface too much. I agree cycling could be cumbersome, but another approach could be a tree-like structure, where you first pick a category (e.g. nature, diplomacy etc.), and then subcategories and then a mapmode. Thus you would only have to do a few clicks, and misclicking is not a problem because you can change it again right away.


To make myself clear: I do not intend to update this mod. It is thought as a "proof of concept", and contains example code to visualize the method. It should not contain any bugs, but it won't receive any new features.
If you want to code your own mapmodes, it's easier than you think!
Just open the mod and take a peak at the files, they should be pretty self-explanatory. If you still have questions, those I can answer here :)
 
That is *very* cool, and I'm glad to have contributed in my small way. :)

Now that you've done it, I can think of a mode I might code up. Scanning multiple maps for different techs gets really annoying, so I have a system that uses a text editor on a save file, feed info from that to a Python script, and drops the output of that into a spreadsheet. All to find the best province to send my spy to research tech in! By coding my tech preferences into a map mode, I can have this system do it all for me. :D
 
This is one super neat workaround ! I would actually be happy with my Council being stuck fabricating maps or whatever because IRL it would actually take time to oversea this, but I should point out that I play with a personal mod that lowers Councilor reassignment time down to 3 months rather than 6.

Now if only we could somehow edit it so that we could create a map of where all the Geniuses, Attractive people or Lunatics live this would be truly awesome !
 
This is one super neat workaround ! I would actually be happy with my Council being stuck fabricating maps or whatever because IRL it would actually take time to oversea this, but I should point out that I play with a personal mod that lowers Councilor reassignment time down to 3 months rather than 6.

Now if only we could somehow edit it so that we could create a map of where all the Geniuses, Attractive people or Lunatics live this would be truly awesome !
You can use the character search function to search by trait.
 
You can use the character search function to search by trait.

I know that but I have always wanted to be able to create a "heat map" showing where all characters with a certain trait lived. I have long suspected that due to the intricacies of CK2's inheritance and marriage systems certain areas would naturally become populated with certain traited characters by default - a couple of geniuses would create more geniuses, who would grow up and stay in the general vicinity making more geniuses and so on.

Traits are not linked to culture or religion but thanks to the marriage dynamics (ie most marriages outside your religion are usually forbidden, culture maluses can reduce attractiveness of outsiders) I fully expect that certain areas would naturally gain a preponderance of certain traits. I would love to see if CK2 naturally created Diligent Germans, Gregarious Italians, Hedonist Frenchmen, Dull Englishmen or Drunkard Russians !
 
I posted an expanded version to the Steam workshop:

https://steamcommunity.com/sharedfiles/filedetails/?id=1702251704

I incorporated some of the suggestions in this thread: added the tree-like structure to the “Ponder Cartography” decision, changed the colors used in the Prosperity and Depopulation map mode, and added a Powerful Vassals map mode.

I’m very thankful for the new Supply Limit condition described here:

- Added supply_limit trigger. Used in a province scope, it compares the supply in the province for a given character and their leader against a value. The leader defaults to the given character unless specified. eg: supply_limit = { for = scope <leader> = scope value > 10 }

The mod currently has 18 fake map modes:
Simple Terrain
Climate
Supply Limit
Number of Holdings
Number of Holding Slots
Number of Empty Holding Slots
Prosperity and Depopulation
Hospital Level
Disease Resistance
Succession Laws of Direct Vassals
Direct Vassal Power Relative to Liege
Powerful Vassals
Succession Laws of Independent Realms
Relative Power as a Defender
Relative Power as an Attacker
Regions
Provinces Not Completely Controlled by Top Liege
Provinces Not Completely Controlled by Local Count
 
I posted an expanded version to the Steam workshop:

https://steamcommunity.com/sharedfiles/filedetails/?id=1702251704

I incorporated some of the suggestions in this thread: added the tree-like structure to the “Ponder Cartography” decision, changed the colors used in the Prosperity and Depopulation map mode, and added a Powerful Vassals map mode.

I’m very thankful for the new Supply Limit condition described here:



The mod currently has 18 fake map modes:
Simple Terrain
Climate
Supply Limit
Number of Holdings
Number of Holding Slots
Number of Empty Holding Slots
Prosperity and Depopulation
Hospital Level
Disease Resistance
Succession Laws of Direct Vassals
Direct Vassal Power Relative to Liege
Powerful Vassals
Succession Laws of Independent Realms
Relative Power as a Defender
Relative Power as an Attacker
Regions
Provinces Not Completely Controlled by Top Liege
Provinces Not Completely Controlled by Local Count

This is just a gorgeous work! Just my two cents, but could you change the mod image on Steam? I don’t know, maybe add a bit of maps screenshots or something like that. Currently it’s hard to understand what the mod really does (I’ve noticed one before this post and I didn’t subscribe because the main image was kinda out of place)
 
I will add some screenshots sometime. For anyone who's interested, the image is from Erwin Raisz's General Cartography. It's his interpretation of the Beatus map:

"Completely dominated by Christian supernaturalism, the medieval map maker made no serious attempt to show the world as it actually is. Instead, he followed an ideal pattern in his own mind, concentrating on artistic and symbolical expression. For the geographic content of his map he relied almost exclusively on the circular world map, the Orbis Terrarum of the Romans. Even this, however, had already undergone modifications, which had diminished its geographical accuracy. As early as the fourth century it had been Christianized by the great church father, St. Jerome, who made a map in which he exaggerated the Holy Land beyond all real proportions. In the eighth century a Spanish monk named Beatus prepared an interesting version of the old Roman map...St. Beatus in 776 patterned the Roman map to fit Christian theology. Note the enormous Holy Land and the Paradise with its four rivers. The outlines of the lands were simplified for more regular and decorative aspect."
 
Scanning multiple maps for different techs gets really annoying
I added a map mode for each of the technologies. I'm not sure how happy I am with it because having 18 different technology map modes does feel a bit cumbersome. It seems that there isn't a condition that checks for the overall progress of a tech group. I also revised the event tree to make it more treelike.
 
I added a map mode for each of the technologies. I'm not sure how happy I am with it because having 18 different technology map modes does feel a bit cumbersome. It seems that there isn't a condition that checks for the overall progress of a tech group. I also revised the event tree to make it more treelike.
There are already mapmodes for each of the technologies in the tech screen :p
 
I hope this is not considered necroing, but given the mod author is still around, and it doesn't make sense to make a new thread about someone else's mod, I hope I will be forgiven.

I just wanted to say that I saw this when it was first posted over a year ago, and at first hadn't thought too much about it, but this is extremely useful. It is really impressive that you came up with this idea.

Would you mind if I include this in one of my mods? The councillor action icon also looks really nice and if you don't mind, I would like to use it in my mod rather than repeating the work you have already done.

It seems you can basically use any normal trigger in the code that decides the map colour, and I used this to give a visual display of the variables used in my mod. It makes new mechanics added by mods much easier to integrate seamlessly into the base game.

Thanks for the great work!