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

CK3 Dev Diary #87: Royal Modding

Hello everyone and welcome to the 87th CK3 Dev Diary!

I’m Matthew, one of the Programmers on the CK3 team, and today I am going to talk to you about a variety of improvements and changes we’ve done to modding for the 1.5 patch which will be accompanying the Royal Court Expansion.

We’ve added a variety of mod support in 1.5 so I’m not gonna cover everything, but I will give a few big ticket items that will let mods do a lot more fun custom things as well a few smaller fun ones. I’ve also attached the output of script_docs on 1.5 at the end so modders curious about the new triggers and effects in game can get a bit of a sneak peek for the release.

The Royal Court​

Of course the Royal Court itself is open to mods, it is all defined in the gfx/court_scene folder though the majority of the complex scene_settings itself is best built using the in-game editor that we are shipping with the court scene. It lets you position and change objects and switch between different settings much faster than trying to edit them all by hand.

Trust me, cause I remember the time whilst the editor was work in progress and doing changes by hand crushed my soul.
The in-game editor tool for the royal court 3d scene

I am not going to go into a huge amount of detail on the royal court modding because it is actually pretty straightforward with the editor, you position things and pick the assets you need for a configuration and then it just puts things there.

One aspect I will go into a bit more info on quickly is the character positioning, because the rest of the positioning is set within the editor but the characters are not positioned individually because of course not every court has the King of England to reference.

Instead the character positions are given a set of valid roles, and you pick a position where someone who has one of those roles may go. For example the two guards you see in the back are two positioned instances of the guard and knight role, which has a variety of rules of who it should pick.

If you have a bodyguard or champion court position appointed for example then it tries to use them as a special guard, but if you do not then it will fallback to picking any of your knights instead. You can also have some more special roles such as if you have a court jester or poet appointed then they can show up in your court too.
The script for the poet court scene role


Characters can not show up in multiple different roles and it is a “greedy” picking of first come first served in who is taken up, but you can write some fairly complex rules to decide who can go where as well as what animations they can choose from!

Same-Sex Marriage​

Coming with 1.5 is support for same-sex marriage, not only just in mods either but as a new game rule alongside the Same-Sex relations game rule so you can use it in un-modded games too. We've updated a variety of AI logic and interactions and content to take that into account when playing.
Same-sex marriage between the Duke of Brittany and his husband

Mods are of course able to implement this into their different worlds without it having to be a game rule, it can be based on different cultures or anything in the game world at all.

This is something that we’re very happy to be able to put into the game and have support in the game rules for unmodded games too, it is something that a lot of the team and community wanted and we are glad it is finally going to be shipped in 1.5.

Scripted Widgets​

CK3 is one of our most moddable games yet, not just in terms of the content that can be added but the system's mods can script. And our new UI system is the most open we’ve had in terms of what custom UIs mods can add and edit, but one issue it had was letting you add brand new things entirely and keeping compatibility nicely.

In 1.5 there is a new system called “scripted widgets”, what they allow for in essence is a mod to define their own brand new windows in the gui files and then add an entry into the gui/scripted_widgets folder with the name of their gui file and the main window.

For example:
gui/test_custom_widget.gui = my_first_cool_test_widget
gui/test_custom_widget.gui = my_second_cool_test_widget

Then with that simple line of script their window will appear in the game in the same way any of the windows we support in code do. Now of course there are some limitations, the windows do not have any special data context like a code one does but it can access anything that is set globally or on the local player character which covers more than enough cases normally.
A scripted widget making a new example window with a testing button

This may not sound hugely impactful, but it means that mods going forward can easily create large systems which can then more easily be compatible with other mods that add systems or if they feel brave enough even with larger Total Conversions if they do not cross over in incompatible design choices.

I am really excited to see the new UIs that mods end up making for their gameplay systems and getting to try a few different mods together. Hopefully their windows have a bit more functionality and effort put into it than my testing one…

Value Breakdowns​

Another bit of UI functionality that mods could not nicely mimic is getting breakdowns of their numbers in the same way we break down a value like your prestige income or how much piety it’s gonna cost to start that war in their own UI.
In 1.5 we’ve added the GetScriptValueBreakdown UI function which lets you specify the name of the script_value you want to break down and the scope context to do it on and it gives you the exact same data as if we’d natively done it from code.

For example in my custom widget I’ve made the button tooltip give a breakdown of the cost if I were to increase my crown authority entirely separate from the usually needed button to evaluate that cost in the realms UI.
Example of custom value break downs in custom UIs

We hope this will let mods better explain their own custom values in a more clear way, be that something like your mana in a fantasy mod or custom score for a special event chain.

Events and Localization​

To make life easier for our modders and designers to work with events we’ve added and reworked a few debug buttons in the event window.
Now every event has these five icons in the top right corner.
The 5 debug icons in the event window

In order they let you:
  • Regenerate the event contents, useful if you’ve changed something that cannot hot reload.
  • Toggle the data system globally, this makes most everything in square brackets show exactly what you typed instead of localizing to some output, this is available via the console commands too
  • Copy the event text to your clipboard
  • Shows you the trigger evaluation that had to be true for you to get this event
  • Debug info about the current scope context and how keys used to build the description
We’ve found that having easy access to these makes it a lot simpler to debug events and iterate on content.

Though do be warned that toggling off the data system can give you some truly cursed looking windows since now instead of seeing the number 4 you see the joyous underlying constructs such as this monstrosity of a window:
The character window with the localization data system disabled showing the raw function calls

In a more mechanical improvement we’ve also added a boilerplate reduction for having events on a cooldown, instead of needing to manually check and juggle flags and variables yourself you can now specify a cooldown on the event in days/weeks/months/years as some value and it will automatically handle applying a flag that will clear after that time blocking the event from being fired on a character.

Console Commands​

We have added a variety of new console commands in 1.5 to help make creating and testing mods a bit easier, and instead of explaining them myself I am just gonna cheat and rip their change log entries out!
  • Added console command "bypass_requirements" (alias "bypass") that lets you do decisions, interactions, schemes, laws, and title creation despite the requirements not being met
  • Added console command "instasiege"
  • Added console command "save_every" and startup parameter "-save_every=x". These will make a save every x years, and ensure they do not get overwritten by normal autosaves
  • Added console command AI.try_send_decision
  • Added console command AI.try_send_interaction
  • Added console command Ironman.ToggleIgnore. When ignored, saves will act as if they're not ironman, including that when you hit save it'll result in a non-ironman save. This can be toggled during gameplay
  • Added console command ToggleShowAllKillers
  • Added console command complete_schemes, guaranteed_scheme_success/failure, and guaranteed_scheme_secrecy_success/failure. The success/secrecy ones only affect the player
  • Added console command set_date
  • Added console command show_regions_in_tooltip
  • Added console command toggle_keys_on_map
  • Added console commands "yesmen_instant" (AKA "ymi") and "instant_responses". The yesmen button in the console can now be right-clicked to run "yesmen_instant"
The bypass and save_every commands have been especially helpful in setting up scenarios to test scripts and make sure it works exactly as you had intended in your mods. As are the forcing the AI to try out an interaction instead of waiting for them to do it of their own free will.

Modifiers Everywhere​

In 1.5 we’ve made some improvements to modifiers so if you use an invalid modifier type somewhere it will error and let you know its not going to work.

Which has been very useful as in 1.5 we’ve greatly expanded upon modifier support in buildings, now buildings can not only apply modifiers to you in general but they can also apply specific modifiers based on culture parameters which are applied by traditions. These can be used in the modifiers affecting the character, province, county and duchy_capital_county modifiers.

In addition there is a province_terrain_modifier which can apply a modifier based optionally on: terrain type, being coastal, being by a river, and by culture parameter. So traditions can really matter in your mods and let cultures play in vastly different ways.
The script for various culture tradition based modifiers on buildings

Clock’s a ticking​

Release day is coming soon and we’re very excited to see what mods are going to do with Royal Court, especially with the court scene itself which we hope in the future to see some fantastic 3D scenes especially from fantasy mods.

I’m gonna get back to the last minute release period scramble, thank you for reading and I hope you’re looking forward to Royal Court’s release and the great mods we’re gonna be able to see in the future too!
 

Attachments

  • effects.log
    288,5 KB · Views: 0
  • event_scopes.log
    302 bytes · Views: 0
  • event_targets.log
    22,2 KB · Views: 0
  • modifiers.log
    58,9 KB · Views: 0
  • on_actions.log
    35,7 KB · Views: 0
  • triggers.log
    195,8 KB · Views: 0
  • 104Like
  • 60Love
  • 27
  • 5Haha
  • 5
  • 1
Reactions:
Not likely to happen, once someone is dead we delete large amounts of data about them which putting back together would be rather complicated. And likely introduce bugs into the base game of unintended necromancy.

Its true you cant keep all data and you cant put it back together. But you could add a selective variant even if it is only for modders.

Meaning you only keep the data of characters flagged for this. Like a dead.2 state, they dont die and run through the death handler clearing them from the game instead they are keep but considered dead.

This could be used for example to add prerequisites like a ritual to add not immortality but an unliving state (necromancy, vampires etc.) to characters by player action or to create events that ask the players in chase of an important persons death if they want to try to ressurect them (if they have the means to do so). It can of course also be used as a cheat or a failsave to events. There could also be a state on how long this data will be keept to futher customize amount and usage of ressources depending on what you are trying to do. For example keeping the data of dead characters for 1 ingame month should not cause massive trouble or keeping the data of a small group for a longer time.
 
  • 5
  • 1
Reactions:
Is it possible to implement an graphic option to turn off Animation specifically for the Court scenes? Sadly I am in a position where my potato pc can render the animations in map mode sufficiently but it will certainly not be capable to render the court scenes.
Yes, they've said you have the option to disable animations for the court such that the scene is rendered once and then is a static scene allowing you to limit graphic usage if you find your computer doesn't handle it well.
 
  • 1Like
Reactions:
I'd have wanted Paradox Development studio to spend their (clearly) limited dev time on actual content for the game, or at least balancing it in such a way that major AI powers could actually pose any sort of challenge to the player past the first 10-20 years of the game as OPM rather than modding in gay marriage, but whatever floats their boat I guess.
 
  • 24
  • 14
Reactions:
I'd have wanted Paradox Development studio to spend their (clearly) limited dev time on actual content for the game, or at least balancing it in such a way that major AI powers could actually pose any sort of challenge to the player past the first 10-20 years of the game as OPM rather than modding in gay marriage, but whatever floats their boat I guess.
Well thankfully for all of us you aren't in charge of how we spend our time!
 
  • 37Love
  • 20
  • 10
  • 7Like
  • 2
  • 1Haha
Reactions:
Well thankfully for all of us you aren't in charge of how we spend our time!
Apologies, but the user you replied to has brought up a rather important point, despite being rather uncouth about it.
While I see the advantages of the gay marriage mechanic for modding and do not have any problems with it, I do question whether it was something the game needs at the moment.

Does this highly optional mechanic really help with the various problems this game has at the moment, which Royal Court doesn't seem to really fix?
Warfare being rather terrible, Peacetreaties being very binary and uninteractible, Factions being completely out of control for the AI yet still boring to the player, your dynasty not actually really mattering and a general lack of flavour, which after thinking about the dev diaries a bit more, isn't really going to be fixed if the events are all that are shown.
It kinda feels like Homosexual Marriage would have been better put aside until later, when the main gameplay functions properly.

Honestly, the only part I really am interested in in this DLC is the new Culture system, but even there I am afraid that this will merely cause the remaining cultures to get even blander, with how the assignment of events to the new cultures seems rather unclear.

And honestly, seeing this reaction:"Well thankfully for all of us you aren't in charge of how we spend our time!" being used really leaves a bad taste in my mouth, even if it was to that post.
 
  • 21
  • 13
  • 4Like
Reactions:
Well thankfully for all of us you aren't in charge of how we spend our time!

I'm not sure what's worse, the audacity of a developer talking down to a player that expressed his opinion without being rude or the crowd cheering the Dev statement as if it was proper behavior.
 
  • 23
  • 21
  • 3Like
  • 1Haha
Reactions:
Apologies, but the user you replied to has brought up a rather important point, despite being rather uncouth about it.
While I see the advantages of the gay marriage mechanic for modding and do not have any problems with it, I do question whether it was something the game needs at the moment.

Does this highly optional mechanic really help with the various problems this game has at the moment, which Royal Court doesn't seem to really fix?
Warfare being rather terrible, Peacetreaties being very binary and uninteractible, Factions being completely out of control for the AI yet still boring to the player, your dynasty not actually really mattering and a general lack of flavour, which after thinking about the dev diaries a bit more, isn't really going to be fixed if the events are all that are shown.
It kinda feels like Homosexual Marriage would have been better put aside until later, when the main gameplay functions properly.

Honestly, the only part I really am interested in in this DLC is the new Culture system, but even there I am afraid that this will merely cause the remaining cultures to get even blander, with how the assignment of events to the new cultures seems rather unclear.

And honestly, seeing this reaction:"Well thankfully for all of us you aren't in charge of how we spend our time!" being used really leaves a bad taste in my mouth, even if it was to that post.
Your comment actually is in good faith unlike the initial user, hence why they get sass and you get genuine answer.

You're not thinking about scale, reworking some code and script to enable gay marriage is infinitely less time than any of the reworks you proposed. They require new designs, overhauling UIs, new art, plenty of new code and content. Spreading over the course of likely weeks for any larger rework.

Adding in a fairly highly requested modding feature that only needs two disciplines and in very focused areas? Much less time.

And I'm gonna be incredibly blunt here, nobody is complaining we added scripted widgets as mod support. Or made a court scene editor that mods can use too. Or any of the other bits of mod support we added. Or about any other of the myriad of reworks and changes coming in 1.5 and Royal Court of which plenty enable incredibly ahistorical behaviour on top of the options already provided.

But gay marriage gets singled out for complaints? Lets not pretend that is for any remotely genuine reason or concern in where we spend our time developing the game, because we all know it isn't.
 
  • 50
  • 14Like
  • 14Love
  • 12
  • 4
Reactions:
I'm not sure what's worse, the audacity of a developer talking down to a player that expressed his opinion without being rude or the crowd cheering the Dev statement as if it was proper behavior.
Implementing same sex marriage was a requested feature and there are many people further up in this thread happy it will be in the game options soon. That poster said "how dare you work on stuff I don't like, you should only be focusing on what's important to ME". You don't think this is rude behavior?
 
  • 24
  • 3
Reactions:
Implementing same sex marriage was a requested feature and there are many people further up in this thread happy it will be in the game options soon. That poster said "how dare you work on stuff I don't like, you should only be focusing on what's important to ME". You don't think this is rude behavior?
I can take or leave Gay marriage. But it's there for those who want it, and as a Game Rule, I believe, so those who don't want it don't have to have it. More freedom of choice is always better than less freedom of choice...
 
  • 5
  • 2Like
  • 1
  • 1
Reactions:
Your comment actually is in good faith unlike the initial user, hence why they get sass and you get genuine answer.

You're not thinking about scale, reworking some code and script to enable gay marriage is infinitely less time than any of the reworks you proposed. They require new designs, overhauling UIs, new art, plenty of new code and content. Spreading over the course of likely weeks for any larger rework.

Adding in a fairly highly requested modding feature that only needs two disciplines and in very focused areas? Much less time.

And I'm gonna be incredibly blunt here, nobody is complaining we added scripted widgets as mod support. Or made a court scene editor that mods can use too. or any of the other bits of mod support we added. Or made any other of the myriad of reworks and changes coming in 1.5 and Royal Court of which plenty enable incredibly ahistorical behaviour on top of the options already provided.

But gay marriage gets singled out for complaints? Lets not pretend that is for any remotely genuine reason or concern in where we spend our time developing the game, because we all know it isn't.
Good to hear that. Wasn't exactly sure how much code would have needed to be changed for it to work, but it seemed to really not be comparable to the large reworks I thought about. Thanks for the clarification.
 
  • 7Like
  • 1
  • 1
Reactions:
Your comment actually is in good faith unlike the initial user, hence why they get sass and you get genuine answer.

You're not thinking about scale, reworking some code and script to enable gay marriage is infinitely less time than any of the reworks you proposed. They require new designs, overhauling UIs, new art, plenty of new code and content. Spreading over the course of likely weeks for any larger rework.

Adding in a fairly highly requested modding feature that only needs two disciplines and in very focused areas? Much less time.

And I'm gonna be incredibly blunt here, nobody is complaining we added scripted widgets as mod support. Or made a court scene editor that mods can use too. Or any of the other bits of mod support we added. Or about any other of the myriad of reworks and changes coming in 1.5 and Royal Court of which plenty enable incredibly ahistorical behaviour on top of the options already provided.

But gay marriage gets singled out for complaints? Lets not pretend that is for any remotely genuine reason or concern in where we spend our time developing the game, because we all know it isn't.
When you were introducing same-sex concubinage in Azure, you made it very clear that same-sex marriage had to be delivered at a later date due to "larger technical risks" and overall resource-related infeasibility to release something of that scope in 1.3.X (and that remained the case even after Azure itself grew in scope and changed from patch 1.3.X to full 1.4).

Now, maybe it's still smaller in scope than literally every single example that both @Draky and @chelvo talked about. Which, for the record, I find doubtful in and of itself because things like "make warfare less terrible" are rather vague and open-ended. And as such leave room for starting with smaller changes. Kinda why even small mods like those lowering replenishment rate were already met with positive response in the recent thread on the state of warfare. Either way, it still feels like you're downplaying the scope of this change compared to your previous statements on the issue.

The third paragraph is where you jump the shark though. The comparison to court window is rather missed, because it's directly related to the DLC, so I'm not sure why it would be met with complaints. Even scripted widgets, which essentially add custom windows for custom systems in and expansion that adds new systems with their windows is still somewhat related. Yet when it comes to same-sex marriage, because you went with a game rule option instead of unlocking it with a cultural perk of the cultural rework, it doesn't really connect to this specific DLC in the same your other examples do. So yeah, not the best comparison

Yet that part of your third paragraph is still monumentally better than its second half, because that's where your remark about good faith posting dives head first into the realm of irony. First of all, the bit about ahistorical nature of this particular modding tool is a misrepresentation of the post you found worthy of your sass, as it didn't mention anything of the sort. Secondly, the argument that no one is complaining about the non-modding changes to "any other of the myriad of reworks and changes" coming in 1.5 and the DLC makes no sense in the context of a dev diary related to modding. What, do you want people to post off-topic here? Given how that's against forum rules, that would be a rather weird thing for PDX employee to do.

Thirdly, to cover all bases here, since you didn't actually limit your claim of how there's no criticism of other parts of 1.5 and Royal Court to this thread alone, it also warrants pointing out that people had most certainly been complaining about other aspects of 1.5 and Royal Court in their relevant Dev diaries. Even though, weirdly enough, none of the previous dev diaries had anything to do with same-sex anything. Hell, people complained about not being able to change aspects of a culture without using divergence or hybridisation so much you devs changed your mind about it. And on top of that we have a whole plethora of user-made threads critical about various aspects of the incoming update, starting with the court itself. Some are right on the first forum page right now.

And before you project your questionable "everyone that questions our priorities on this is a bigot" at me as well, let me point out that I didn't question it myself. Because I have no problem with this change myself. Nor do I have a problem with gay people themselves, as you'd may like to insinuate. Instead I attended pride parades in support of their rights (in a country that doesn't really respect them) and while I'm not gay myself I fall on another part of the LGBTA spectrum.

But hey, maybe questioning the devs in any capacity is also bigotry and I didn't know it.

Implementing same sex marriage was a requested feature and there are many people further up in this thread happy it will be in the game options soon. That poster said "how dare you work on stuff I don't like, you should only be focusing on what's important to ME". You don't think this is rude behavior?
Except that's not what happened? At no point did they phrase their complaint in "how dare they" manner. And they literally ended their post with "but whatever floats their boat", which is attitude pretty much opposite to "you should only be focusing on what's important to ME". Maybe their behavior was rude anyway. But you having to completely twist what they said around makes a rather poor case for that argument.
 
Last edited:
  • 18
  • 9
  • 5Like
  • 1Haha
Reactions:
At no point did they phrase their complaint in "how dare they" manner.
I don't know how you usually carry yourself, but
actual content [...] rather than modding in gay marriage
sounds pretty "how dare they" to me, pretending gay marriage isn't actual content, and belittling it further by calling the development process "modding [it] in".

That's disrespectful to both those who want such a feature, and the devs.

You might have other priorities when it comes to the direction the game should take; there are many aspects where CK3 could (or maybe should) be improved, expanded or even revamped; the reaction you get depends on how you say it.
 
  • 29
  • 6
  • 1Like
Reactions:
I don't know how you usually carry yourself, but

sounds pretty "how dare they" to me, pretending gay marriage isn't actual content, and belittling it further by calling the development process "modding [it] in".

That's disrespectful to both those who want such a feature, and the devs.

You might have other priorities when it comes to the direction the game should take; there are many aspects where CK3 could (or maybe should) be improved, expanded or even revamped; the reaction you get depends on how you say it.
Being dismissive of a feature you don't like is not equal to accusing the devs of "daring" to introduce it to me, no. It's just a rather weak way to phrase an argument about different priorities (which was the whole gist of the post at hand), which is a different thing.

And, for the record, that itself could be construed as rude behavior, as it could be argued such argumentation is reductive and intellectually dishonest. Like I said, I'm not ruling out the possibility of that post being rude (and rude or not, I agree with your overall premise that it could have been worded better), but the other reply I quoted is still a misrepresentation in my eyes.

But all of this is getting kinda off-topic. Personally I'd still like to know if we'll be able to have culture group (heritage) wide opinion modifiers on traits etc. like we could in CK2 instead of just culture-wide ones. Because the work-around for that is rather annoying.
 
Last edited:
  • 11
  • 9
  • 5Like
Reactions: