• 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.
One person does not make a consensus, but here are a few things off the top of my head:
  • AI is bad at naval invasions (both defence and offence) onto large islands that are not connected by land. Eg: British Isles is bad, Malta is fine.
  • AI is better at reacting to attrition management than the player (because it notices instantly), but it's worse at planning for it (eg. knowing that supply will go down to 1k in the winter, so you either get a Winter Soldier or don't go there).
  • The AI seems to use a completely different strategy for marriages than the player. Players try to use strategic marriages to forge alliances with people who can actually help them in a war (independent or vassal of same liege), or they breed for good traits/bloodlines, or to put their dynasty on a foreign throne, or whatever. The AI can sometimes do all of those things, but only by chance - it's very much a scattergun approach. Relating this back to your question: If you want to have epic marriage alliances, you'll need to script them.
  • Following on from the previous point, everything the AI does is weighted random. IE: It very rarely makes the best possible choice, whereas an experienced player will probably always make a good choice. If you increase the power level too much (too many large stacking buffs) then the randomness of the AI's choices may lead to some crazy results. On the other hand, you could make it so only players are likely to stack those buffs (eg. going on a tour of warrior lodges for 5-6 special commander traits), which might give players a fun feeling of being powerful.

The AI isn't good at the game; there's certainly mechanics it is worse at dealing with (e.g. if it can't blob like crazy, it'll easily enter a Decadence death spiral it never recovers from), but it isn't particularly good at anything (e.g. it'll build buildings when it feels it can afford it (better than doing it when it thinks it can't), but it has no plan and simply picks something using a weighted ai_creation_factor for each building and whatever goes into its budgeting (not necessarily good)). It is also often not given what it needs to play rationally; there's a large amount of events that are just coin flips/die tosses without any AI weights (or with very limited weights), which can make a supposedly smart and sane AI character act completely against both its best interests and its personality if it gets such an event.

I feel it'd be easier to answer more specific questions regarding specific mechanics and how feasible (and time-consuming) it'd be to make the AI play better there than to try to answer it for the whole game, particularly as playstyles and personal preferences will affect what is "Good AI gameplay" (e.g. whether you feel the AI should play a character first or should try to provide a challenge for the player first, whether you feel it should be allowed to cheat with gameplay mechanics because it can't be made to understand them, and whether you feel certain things are fun to deal with).
Thanks for your answers, this is already very informative!

Knowing what the AI is particularly bad at is certainly useful. If it can't really handle naval invasions well, for example, then I'll probably avoid having large islands. I guess I also just had some very frustrating experiences trying to mod EU4, where I realized that the AI literally doesn't use most of the new features introduced in the last couple of years, which gives players even more of an advantage than they already have. I'm not a big fan of including all kinds of features and playstyles just for the sake of variety, especially if they don't really tie into the core mechanics and if the AI can't properly interact with them; I'd much rather focus on a few robust systems and build something narrow but in-depth, instead of wide and shallow.

If I had to narrow it down when it comes to CK2, one of the first things that comes to mind are the different government types. I don't have much experience playing non-feudal characters, but know that they have some unique mechanics (manpower for nomads, patricians for republics etc). If I knew that the AI doesn't do well with playing either as or against non-feudal characters, I would probably not bother creating an equivalent for my mod.
 
If I had to narrow it down when it comes to CK2, one of the first things that comes to mind are the different government types. I don't have much experience playing non-feudal characters, but know that they have some unique mechanics (manpower for nomads, patricians for republics etc). If I knew that the AI doesn't do well with playing either as or against non-feudal characters, I would probably not bother creating an equivalent for my mod.

MRs and nomads are largely hardcoded messes, so trying to reuse the relevant mechanics in other contexts is not advised, and there are limits to how much they can be tweaked (especially on a non-global level).

I'd personally say the AI does some questionable things with nomads as implemented (e.g. the "Clans need more land" thing combined with clan limit makes it engage in vassalgore rather than portioning out the realm sensibly and any vassalgore arising naturally through inheritance, and it seems to very easily end up in a ton of blood feuds), that those are horrible from a balance standpoint (they literally have a CB for taking over entire empires, never mind that that most nomadic realms in history didn't blob all over the place), and that the inherent mechanics work poorly in various regards (every independent nomadic ruler is an emperor (rank and prestige inflation), the limit on clan vassals and those being king tier at all times (rank inflation, effectively no ability to weaken vassals beyond a certain point), other AIs being perfectly happy to intermarry with nomads because the nomads don't care, the steppes generally ending up with very few cultures surviving because nomadic land flips if another nomad takes over, custom titles being impossible to reference explicitly when adding flavour/mechanics, etc., etc.).

It is better at MRs, but it isn't great at handling their succession law (and switching them to something else isn't really doable), and I wouldn't say that I'm particularly fond of how they're implemented in general (e.g. the "Build TP -> seize city -> seize county -> repeat" cycle is repetitive and makes them expand ahistorically quickly, particularly as the footholds and money can be used for later holy wars with tons of mercs).
 
  • 3
Reactions:
I guess I also just had some very frustrating experiences trying to mod EU4, where I realized that the AI literally doesn't use most of the new features introduced in the last couple of years, which gives players even more of an advantage than they already have.
I know what you mean, and I think there is an important interface difference between CK2 and EU4.

In EU4, new features tend to be implemented as a new button "somewhere", and the AI is usually unaware of this button's existence. Or, in the few cases where it's aware of the button's existence (eg. mission trees), it doesn't understand it, so it'll simply press it as soon as it's available. (Also, it doesn't engage in any planning to set up a really good situation to press the button, but that's the same in CK2.)

However, in CK2, almost every important interaction is either picking an option in an event or taking a decision (intrigue/targeted/offmap/etc). The ai_will_do block in all of these means the AI can be given quite granular instructions about which choice is best for them. (And, in the case of decisions, how often to check them, who to target, etc.) The exceptions are anything that's hardcoded into the engine (eg. arrange marriage, send gift, buy favor).

This means that, as a general rule, the AI is aware of pretty much everything it can do in CK2 - which is a sharp contrast to EU4. However, in some cases, the CK2 devs didn't write any particularly-useful logic in their weightings, meaning the base game AI often acts randomly ("pressing a button as soon as it's available"). But modders can correct that, usually by editing the ai_will_do clause. I believe that this is not possible in most cases in EU4.
 
  • 1
Reactions:
I would also note that matriarchal/enatic stuff is something the AI is absolutely not good at dealing with.

Also, the AI likely handles feudal stuff better than any other government (at least by comparison) due to that being the core governmental mechanic from the game's beginning.
 
  • 1
  • 1
Reactions:
Is there a way to distinguish between secret and publicly-known lovers? (IE: Whether the lover relationship is visible to a third party looking at their character sheets.)

Everything I can see for lovers in commands, conditions and scopes seems to be general across both types of lover, but maybe I'm missing something?
 
I've asked about raiding as a mechanic before, and I know that it's almost entirely hardcoded, but is there any way to change the restriction of only being able to raid neighbouring or coastal provinces? Because considering how far the Magyars raided into Europe, that restriction seems especially silly to me.
 
I've asked about raiding as a mechanic before, and I know that it's almost entirely hardcoded, but is there any way to change the restriction of only being able to raid neighbouring or coastal provinces? Because considering how far the Magyars raided into Europe, that restriction seems especially silly to me.
No, there's no way to do that.

That said, I believe that the long-distance raids are modelled in-game by raiding adventurers (regularly spawned by Altaic & Magyar cultures).
 
Is there a way to distinguish between secret and publicly-known lovers? (IE: Whether the lover relationship is visible to a third party looking at their character sheets.)

Everything I can see for lovers in commands, conditions and scopes seems to be general across both types of lover, but maybe I'm missing something?

I know of no way to distinguish between them in script, sadly.

I've asked about raiding as a mechanic before, and I know that it's almost entirely hardcoded, but is there any way to change the restriction of only being able to raid neighbouring or coastal provinces? Because considering how far the Magyars raided into Europe, that restriction seems especially silly to me.

Not a chance.
 
  • 1
Reactions:
I'm new to modding. So far I've only added common (which only has booksmarks and cultures), history (which only has characters) and localisation. It works just fine, except there are no special characters.

For Example:
 

Attachments

  • Screenshot 2024-05-21 165211.png
    Screenshot 2024-05-21 165211.png
    23,7 KB · Views: 0
I'm new to modding. So far I've only added common (which only has booksmarks and cultures), history (which only has characters) and localisation. It works just fine, except there are no special characters.

For Example:
These kinds of display errors are usually caused by saving your localisation files using an incorrect text encoding system.

You MUST use Win-1252 encoding, and I find the easiest way to do this is by editing the localisation file with an advanced text editor like Notepad++ (select the desired encoding from the "Encoding" menu before saving).

(EDIT: While it's fine to view text files in a spreadsheet, I think it's a pretty bad idea to edit text files using a spreadsheet, because in my experience all spreadsheets have an annoying habit of mangling the format of the entire text file, because they usually don't remember the settings they used to open a file when they go to save it again. US vs ROW date formats make for particularly fun times, although that's not really applicable to CK2.)
 
Last edited:
While it's fine to view text files in a spreadsheet, I think it's a pretty bad idea to edit text files using a spreadsheet, because in my experience all spreadsheets have an annoying habit of mangling the format of the entire text file, because they usually don't remember the settings they used to open a file when they go to save it again. US vs ROW date formats make for particularly fun times, although that's not really applicable to CK2.
No end of problems in this thread have stemmed from someone using excel to edit the localization files and ending up with it saved wrong. That could be an extra column or a missing column or commas instead of semicolons. I don't think I have seen missing special characters before, but excel is spectacularly bad at special characters. At work we have serial numbers that include a special character, but putting it in is annoying because excel doesn't do alto codes right.
 
  • 1
Reactions:
No end of problems in this thread have stemmed from someone using excel to edit the localization files and ending up with it saved wrong. That could be an extra column or a missing column or commas instead of semicolons. I don't think I have seen missing special characters before, but excel is spectacularly bad at special characters. At work we have serial numbers that include a special character, but putting it in is annoying because excel doesn't do alto codes right.
Oh, believe me, my rant was a LOT longer before I deleted it and wrote something more concise and productive. I guess we've been similarly scarred...
 
Hi everyone, i need some help. I want to learn how to mod religious icons but i'm having trouble especially with the channel creation in photoshop. Does anybody know some easy guide that can help me? I use photoshop, but can also try with GIMP.
 
Hi everyone, i need some help. I want to learn how to mod religious icons but i'm having trouble especially with the channel creation in photoshop. Does anybody know some easy guide that can help me? I use photoshop, but can also try with GIMP.
I don't know any guides, but are you trying to edit an existing religious icon, or add a brand new religion icon? Due to how the game has all religious icons stored in a single strip, the latter is trickier than the former.
 
Unfortunately, the second
Have you tried creating your new religion sprite by editing an existing one? (Eg. By deleting everything in the existing icon, adding the new icon as a new layer, and then saving.) It's possible that, if you do it this way, then the existing format might serve as some kind of template for the new file. I personally use Paint.Net (not GIMP or Photoshop), and this approach has always worked for me - although I'm not an artist and I don't tend to make major changes, so YMMV.

Otherwise, the best I can suggest is that you try to get in touch with the developers of major overhaul mods, as they tend to have tons of new religions, each with their own special icons, and they must've created them somehow.
 
Unfortunately, the second
Alright, I added a religious icon once myself, but it was quite a while ago, so I may be forgetting some things. These instructions assume you're using Photoshop, though things may be slightly different depending on which version you're using.

You'll need to tinker with the following files, all found in \gfx\interface\

religion_icon_strip.dds
religion_icon_strip_big.dds
religion_icon_strip_small.dds

For each one, you'll have to add additional length to the canvas of the strip.

For religion_icon_strip.dds, you'll need to add 32 pixels of length per icon you want to add. For _big, you need 46 pixels of length per added icon. For _small, you need to add 20 pixels of length per.

In Photoshop, you can do this with the shortcut Ctrl + Alt + C, or by going to Image menu > Canvas Size. Change the units it's using to pixels if it's not already. (For me it default to millimeters, so I click on the dropdown menu and select Pixels.) To width you will add the appropriate number of pixels. If you're adding one new icon to religion_icon_strip, then change 1888 (pixels) to 1920, if you're adding two new icons, change 1888 to 1952, etc.

Important! In the Anchor diagram thing at the bottom of the Canvas Size screen, you want to click the middle left tile. This will make it so that the extra length is added on to the right end, instead of being added half to the left end and half on the right end.

Then click OK, and the extra pixels of length will be added to the canvas.

At this point just copy one of the existing icons to get the right shape and size, and drag the copy over to one of the new empty spots on your longer canvas, then edit the icon how you see fit to make your custom icon. You will have to use some trial-and-error to get the icon lined up correctly - i.e. go into the game, make a character with your new religion and see how centered the icon is in the spot that a character's religion icon is displayed.

However! Before you can get the icons to show up properly in game, you will need to edit all three of the strips appropriately, and edit the generalstuff.gfx file in \interface\ (not \gfx\interface\, just \interface\), in the spriteTypes for GFX_religion_icon_strip, GFX_religion_icon_strip_small, and GFX_religion_icon_strip_big. The noOfFrames entry in each of those spriteTypes must be exactly equal to the number of religious icons that are in the strips. By default, with all religions in the base game, it's 59. So if you add one new religious icon in your mod, you'll need to change the noOfFrames entry to 60 for all three, or 61 if you add two new religious icons, etc.

https://ck2.paradoxwikis.com/Religion_modding#Adding_icons This page helped me out a lot when I was first doing this, but it is at least partially outdated, as it doesn't mention religion_strip_big and indicates that the default number of religion icons (i.e. noOfFrames) is 10 rather than 59.

I hope this helps. Let me know if you have any questions.
 
Last edited:
  • 1
Reactions:
Alright, I added a religious icon once myself, but it was quite a while ago, so I may be forgetting some things. These instructions assume you're using Photoshop, though things may be slightly different depending on which version you're using.

You'll need to tinker with the following files, all found in \gfx\interface\

religion_icon_strip.dds
religion_icon_strip_big.dds
religion_icon_strip_small.dds

For each one, you'll have to add additional length to the canvas of the strip.

For religion_icon_strip.dds, you'll need to add 32 pixels of length per icon you want to add. For _big, you need 46 pixels of length per added icon. For _small, you need to add 20 pixels of length per.

In Photoshop, you can do this with the shortcut Ctrl + Alt + C, or by going to Image menu > Canvas Size. Change the units it's using to pixels if it's not already. (For me it default to millimeters, so I click on the dropdown menu and select Pixels.) To width you will add the appropriate number of pixels. If you're adding one new icon to religion_icon_strip, then change 1888 (pixels) to 1920, if you're adding two new icons, change 1888 to 1952, etc.

Important! In the Anchor diagram thing at the bottom of the Canvas Size screen, you want to click the middle left tile. This will make it so that the extra length is added on to the right end, instead of being added half to the left end and half on the right end.

Then click OK, and the extra pixels of length will be added to the canvas.

At this point just copy one of the existing icons to get the right shape and size, and drag the copy over to one of the new empty spots on your longer canvas, then edit the icon how you see fit to make your custom icon. You will have to use some trial-and-error to get the icon lined up correctly - i.e. go into the game, make a character with your new religion and see how centered the icon is in the spot that a character's religion icon is displayed.

However! Before you can get the icons to show up properly in game, you will need to edit all three of the strips appropriately, and edit the generalstuff.gfx file in \interface\ (not \gfx\interface\, just \interface\), in the spriteTypes for GFX_religion_icon_strip, GFX_religion_icon_strip_small, and GFX_religion_icon_strip_big. The noOfFrames entry in each of those spriteTypes must be exactly equal to the number of religious icons that are in the strips. By default, with all religions in the base game, it's 59. So if you add one new religious icon in your mod, you'll need to change the noOfFrames entry to 60 for all three, or 61 if you add two new religious icons, etc.

https://ck2.paradoxwikis.com/Religion_modding#Adding_icons This page helped me out a lot when I was doing this, but it is at least partially outdated, as it doesn't mention religion_strip_big and indicates that the default number of religion icons (i.e. noOfFrames) is 10 rather than 59.

I hope this helps. Let me know if you have any questions.
Wow, that's really helpful, thanks you. Do you know in what specific format i must save those files?DXT3, DXT5 or else?
 
Wow, that's really helpful, thanks you. Do you know in what specific format i must save those files?DXT3, DXT5 or else?
It has to be the exact same format as the original file in the base game, which is .dds unless I'm very much mistaken.

I can't recall for sure, but I think GIMP and PS don't natively work with .dds, so you have to Google and install a plugin maybe?