A random AI will (assuming a normal distribution) make the worst decision at the same rate as the optimal decision. A better than average AI will make a better decision than average on average. If we include randomness in the AI behavior, it will still occasionally make an optimal decision, so you are not correct in saying the AI would be static (you don't need to implement it statically). You are making the comparison between fully random and fully static, neither is how one builds proper AI. Ideally we have different fixed AI (basically have different AI strategies which can be selected randomly) with some randomness, but if I had to choose between the two, fully static would be far better than fully random. So yes, randomness isn't necessarily a bad thing, but randomness should always be a very small component to any AI.
There are plenty of games where there in no optimal static strategy, because if you use a static strategy your opponent can counter that strategy with the proper response. As
@Tiax mentions, rock-paper-scissors is a great example of this as the optimal strategy is to randomly pick between rock-paper-scissors with one third probability for each (note strategies that incorporate randomness don't use a normal distribution, they use a distribution tailored to the game at hand). The problem you are having is assuming there is an optimal static strategy regardless of what your opponent does, which if that was true you would be right, but lots of games are built with rock-paper-scissors elements in them such that the optimal thing to do depends on what your opponent does. It is these styles of games where randomness is generally a part of the optimal strategy. And Ck3 has many rock-paper-scissor style elements (the MaA being a pretty on the nose example).
Also I never said that the options are only randomness or only static, I specifically mention randomness as "having a place" or being "incorporated" in to a strategy, which I feel all suggest it being a mixture of the two as would probably be the result for any strategy from such a complex game. I even give suggestion of when would be good to hardcode in static strategies and why a logical CK3 strategy would have some randomness, so I don't know where this accusation of me being black-or-white on this topic is coming from, when I'm giving suggestion for how both can play a role. I also never cover how much randomness is a good or bad thing in an AI (just that it is a balancing act). In fact I mainly talk about randomness in it's relation to building an optimal strategy, which as I pointed out doesn't apply to CK3.
To your point there is an issue with predictability of hardcoded AI, but even static AI is not frequently a bad thing, because it can create a logical AI that players understand if behavior is based on personalities. Good examples of this are already in Paradox and Creative Assembly games. The diplomacy/interaction system is a great example of a hardcoded system that takes personalities into account. Different personalities affect the evaluation. AI behavior (acceptance/decline) is based on a fixed set of parameters that get evaluated. Overall this leads to good AI behavior **if** those decisions are implemented logically.
I point out that there is a balancing act when using randomness and if used too much it can lead to the exact problem you are giving back to me, so I don't think you understood what I was saying, which could be my bad as maybe I should have been more clear.
But I do want to point out there is a difference between understandable what is understandable to the player and what is logical. As the a logical thing for an AI to do in a game where the player could counter their strategy is to be unpredictable (optimally if using a random strategy that is mixed in such a way that the player can't exploit it), but that doesn't always make for good AI behaviour as we have both pointed out that it can make the AI feel as it is not acting understandably.
Of course, every game you can learn to beat the AI by looking at their tendencies. Of course, if you hardcode a bad AI, then it will be worse than random options (eg see the discussion by the devs about Victoria 2 Capitalist AI build priority).
Not with many two player games, many of which are solved and so the computer can be taught the optimal strategy (which might be static or random depending on the game) and this optimal strategy can't be exploited as it beats all other strategies. In fact such games the AI is usually programmed to not play optimally such that the player stands a fighting chance and can actually have fun.
Creative Assembly AI developers have actually talked about the difference between hardcoded AI strategies and more modern AI algorithms, and from their lessons, hardcoded strategies, when done correctly, lead to better AI results than using trees or neural nets. (Eg Rome, Shogun, and Midieval 2 they implemented AI strategies by coding in Art of War/known military strategies, Empire, Rome 2, and later they used Neural Nets to train, turns out the AI performs far better using simpler more logical based strategies). This is primarily due to 1) resource restriction available in a video game to process neural nets vs simplicity of evaluating a FSM, and 2) complexity of translating a video game into a neutral net/learning algorithm state space vs FSM simplicity of representing the game state.
Sounds interesting and I'd love to read about it, but this has nothing to do with randomness versus static. Both random and static strategies can be hardcoded, just means that the AI isn't changing or updating it's strategy in response to how the player responds (a hardcoded AI might be following a decision tree as you mention, which can include both random or static decisions, but unlike what is possible with modern AI it won't be changing the actual structure of the decision tree based on what the player is doing). Plus a AI that is capable of learning new strategies can learn both static or random strategies. So again this tells us nothing about random versus static strategies.
2) Your assumption that the game state is very complex and thus would be hard to create an AI is not true. In all AI algorithms, you have to properly define what the relevant variables are. Even state of the art algorithms do so. For example, face identification and tracking algorithms frequently look for the existence of eyes and a nose via the darker appearance of the eyes (due to depth) and brighter appearance of the nose (due to depth). It's a very very seemingly stupid and brain dead principle. But surprisingly it works very well (also explains why the algorithms perform poorly on people of color but that's a separate topic). We aren't looking to create an AI that can perform the optimal decision in 100% of the cases, we're looking to make an AI that performs a good decision in 90% of the cases, versus the complete randomness right now.
To give you a sense of how complex CK3 is from a making good strategic decisions point of view. Normal 3 player poker is currently considered too complex to solve, currently the version of poker game theorist are solving involves 3 or 4 types of cards and even those generally come with some type of restriction (like only one hand). Compare this to the two player version which is easily solved for a full deck and full game. The reason adding a player makes it so hard to solve a game is that you can get king making situation and/or ganging up which warp the meta. This gets compounded the more and more players you add to a game. CK3 if trying to program the AI to act logically you have essentially thousands of players, each with thousands upon thousands of possible decisions to choose from at any given moment. This is so far from the field of what is calculable for what is a good strategy that it would be impossible to even quantify if they are making a good decision in 90% of cases.
To given you a sense of the scope, imagine playing the game where every landed character in CK3, count or higher is played by a player. And for this game you need to convince them that your decision tree will lead them to the "good" decision in 90% of cases. I doubt many will sign up as they can probably see things they can logically exploit and if they do your strategy will definitely lead to a worse outcome as players are specifically playing strategies that counter it. So even if your 90% good decisions was somehow true theoretically, it wouldn't be in actuality.
But I agree with your sentiment that Paradox doesn't need to build an optimal AI, hence why I suggested that.
In CK3, at least the way I view things, there **are** optimal decisions you can make that are braindead. When building buildings for example, you really don't need to care about what your neighbors are building 70% of the time. There are limited slots in each province. Some buildings are just far far better than others **in the long term**. Sure the buildings might not be great **in the short term**, but if the buildings are built in the long term, then whichever AI character takes over said holding would have a better chance of opposing you the player, so it doesn't really matter from the perspective of creating a challenge for the player. You can usually fill up 2/3 slots with just the far better buildings. Then the last slot it does depend, but you can either code it based on "what would a real person do" (personality) or you can code it based on a "playing to win strategy" (challenge). Or even if you had the AI pick randomly in the last spot, that would be **far far better** than pure random.
So I think this is where some of the confusion come from. So I agree as a player playing a regular game of CK3 you don't really need to care what your neighbours are up to decide what building you need to build. But that because we as players are playing against a hardcoded AI who we have some understanding of how they will act. So we as the actual human players of CK3 are playing a single player game against an environment which is populated by AI players. To go back to a rock-paper-scissors, if you decide to go hard on one or two types of MaA, the AI in CK3 is not programmed to respond to that. And you as the player can learn that and exploit that. So you have more freedom in how to craft your optimal strategy.
But when programming the AI to play more optimally, this is more like the version where every landed character is a human player and you are having to come up with the optimal strategy or even okay strategy that works for every player in the game and isn't thwarted by the very strategy you are crafting. So it's no longer a player playing in an environment, it's now hundreds of players playing off each other.
If you were in a game with thousands of human players, never the less what you build, when would it be optimal or a good idea to build? Because remember if you build with not enough money your human player vassals and/or neighbours could sense weakness and attack while the number of mercenaries you can buy is low and gang up on you (but who knows maybe they'll leave you alone as they fight amongst themselves). But if you wait til you have too much money, then your vassals and neighbours might build before you potentially getting a leg up on you. This is all before we consider what building you build, because if you build ones that favour certain MaA then your vassal and neighbours could counter by getting MaA that negate your MaA (or again maybe they are interested in countering a different player's MaA). So what and when would be considered good to build depend on your belief about the strategies of the people playing your vassal and your neighbours. But unless you've played against them before (and they don't learn from past circumstances) then there is no way to know whether you belief is correct until it is too late. This is the crux of why the AI can't be programmed with a good or optimal strategy in such an involved game like CK3. What is considered good depends on what everyone else is doing. And again hence why we the player can actually figure out good strategies for CK3 as we can get a sense for what the AI generally does.
Also should mention again that CK3 has false or trap choices in it. Ones where there is only one right answer or there are definite wrong answers. But these a considered bad game design especially for a strategy game as they are problems you need to solve once and then never think about again (or more likely just look up the answer on the wiki or on the forums). And so while the AI should be hardcoded to respond to these correctly, they are better dealt with by removing them or fixing them to actually require strategic thought (which then might best be dealt with by the AI using some combination of randomness and static strategies).
3) Some points I brought up about AI isn't even related to the AI making decisions, but the fact that the AI does not even have the ability to interact with many of CK3's systems.
Let's take a look at a suggestion much earlier in the thread about slowing down lifestyle perk gain rate making the game harder. Well, 99% of the AI in the game simply do not have access to the lifestyle system at all. It is simply disabled. So yes, of course, if you slow down lifestyle gain rate, then of course the game would be harder, because now you've just delayed an advantage the player has over the AI. However that's just addressing a symptom and not the cause. The cause is, most AI simply can't use the system. So if we fix that then this solution will also result in a more difficult game.
Similarly, if we consider late game vs early game, why is the game difficult in the early game but not late game? Well in the early game, you, as a small player, have less resources available then nearby AI. Sure, the AI will be making incompetent decisions, or making no decisions, but if you forced it into a war, you will have to play optimally.
However in late game, this challenge vanishes. Why? Because **there is no agent with the credible resources to counter you, and no agent working to accumulate said resources**. Unless you are playing multiplayer, there is simply no other great house in the game that has marriage alliances that can challenge you, because **the AI frequently does not marry**, and there is no AI actively working to expand their lineage due to the game generating lowborns not of any major house. The AI does not economically develop properly, so their holdings fall behind. The AI does not prioritize good military bonuses (like a player would) that offer a bonus, so their military falls behind. There are so many other factors that I haven't even listed, but they all combine together to create this imbalance.
The playing field is simply tilted too much in the favor of the player by end game because the player has so many tools the AI is either forbidden or incorrectly using. I'm fairly confident that if there was at least a competent (not optimal) AI, the game will be much harder without any need for balance changes. Or if there is still a need, it will be much more clear what those needs actually are. For example, if the AI was coded to win, then the AI would be abusing various exploits, and there would be balance pressure to fix those exploits. (Also fun AI generally isn't optimal but suboptimal as this is a game, so there's no real conflict between just coding a believable, logical, competent AI vs design goals).
I don't know why you are bringing this up. I haven't said the AI shouldn't interact with more systems, I haven't said the game can't be made more difficult, I haven't said the AI can't be improved (to the contrary I have said it can be improved). I've just said that trying to create an optimal AI is not something that Paradox can or should try to do (and you seem to indicated you don't even want optimal AI). So again I think you misunderstand what I was saying).
Though I do want to add that just because the AI has access to more abilities doesn't necessarily mean it will make them more of a challenge for the player in the late game. Remember the AI can use those new abilities to tear each other down rather than build stronger realms. Now many of the ones you have mentioned, if I had to wager would probably lead to more of a challenge for the player (especially if implemented well) but it's not a guarantee. The AI are also playing against each other.
Now with all that said I still think the AI should be given access to more parts of the game (assuming it doesn't tank performance), if for nothing else than to make them more interesting and dynamic.
One thing final thing I would like to say, is that while the AI in CK3 can't be made to play optimally (or near optimally, as there is not optimal to be near), the AI definitely can be made better. Specifically better in terms of creating a more entertaining environment for us, the human player, to play in. And that can involve making the AI more challenging, having more personality, and being more understandable. But it does still have a place in there for some randomness, but again it's a matter of striking the right balance with all of these (which definitely has some degree of personal preference, but that's a whole other can of worms).