2 months ago - PDX-Trinexx - Direct link
Hello there! We’ve got some new stuff available for you to tinker with and I’m happy to have the honor of presenting it for you! I’m Jens, the programmer behind the Barbershop upgrade and Message Settings. But first I want to talk about Domiciles, the system behind Estates & Camps.

Discuss Dev Diary #156 on our forums![pdxint.at]



Domiciles When building the feature, I made it in close collaboration with artists, designers and UX. Nobody wanted to work with another activity locale window again. So gathering the learnings and feedback, I wanted to make it as easy as possible for anyone to set the amount of building slots, their positioning or size and appearance based on triggers, all while having it updated by hot reloading in real time.


Domicile Slots To get some terminology out of the way, we decided on 3 different domicile building slot types:

  • Main: The building slot of your home building. It differs from the external slot in that its building is auto-constructed at start for free and is indestructible. Otherwise it’s handled just like any other external building slot. We decided on one main slot per domicile type, but there is no cap so technically you can add as many as you want.
  • External: The visual building slot you see as you open the window. It has 4 states: locked, unlocked, under construction and constructed. Clicking an unlocked slot opens the building panel where you select what building you want to construct in the slot. There’s a new character modifier domicile_external_slots_capacity_add which sum determines how many extra slots are unlocked.
  • Internal: For Estates we added internal building slots for its main building and for Camps we put them in the external buildings, but it's not enforced so any external building can host internal slots. They share the same 4 states as external slots even though it's visually presented in another way.



[Highlighted external building slot states of the Camp]



[Highlighted internal building slots of the Estate]


Domicile Types With Roads to Power we add Camps and Estates as two new domicile types. What domicile type to use is set per government type. Each domicile has base_external_slots which sets how many slots always are unlocked before the domicile_external_slots_capacity_add modifier is applied.

In the domicile_building_slots array you define the amount of external building slots the domicile type has. Because it’s an array you’re free to add as many or as few building slots as you like. Camps have fewer building slots than Estates so we made its artwork slightly bigger to get the zoomed in feeling. For each slot you can define if its main or external, its position and size and what image to select for the empty and under construction slot states (meaning each slot can look unique if you so wish).


[Database of domicile type displaying how the array of domicile building slots is defined]

The order of definition is only relevant when drawing the slots on the screen as the first items will appear behind the last items of the array. In the above example you can see we have several empty_slot_asset defined where slot appearance is selected by a trigger depending on current location. Make sure to have at least one empty_slot_asset and one construction_slot_asset per slot to cover the states.

The background of the window is selected in the same manner by defining domicile_asset that will pick the first triggered match starting from the top.


[Database of domicile type showing how window background is selected using triggered domicile assets]

If a domicile type uses provisions or not while moving is determined by a bool. Whether the domicile type will have a followers window and handle follower temperament will automatically be enabled if you start adding domicile_temperament_low_modifier or domicile_temperament_high_modifier.


Domicile Buildings

[Example building of the domicile building database]

Some things in the above example are self explanatory but other parts are not that straightforward.

  • allowed_domicile_types: This is an array defining what domicile types this building will be available for. If not specified this building won’t show up anywhere.
  • previous_building: Is arguably the most complex as setting what building comes before this is what the upgrade tree structure will be based on. It is fully dynamic so you can make the tree as simple or as complex as you wish regardless what slot type the building is.
  • slot_type: This determines in what slot you may construct the building. Note that setting the previous building of an internal building requires its predecessor to either also be an internal building or being the base building of an external or main building track. Internal buildings cannot be base buildings so all internal buildings require a previous_building.
  • internal_slots: Defines how many internal slots this building hosts regardless if it’s an external or main building. (Please don’t add internal slots to internal buildings as that would start getting silly).
  • asset: Works just like assets for the domicile types and may be selected by triggers as well.

Not shown above we also have can_construct trigger and on_start/on_cancelled/on_complete effects.


[Picture of a more complex tree structure. Note you won’t find this particular building in the game]


Decision Groups As you might have noticed in some screenshots we have structured the decisions window into collapsible groups. What decision belongs to which collapsible group and in what sort order is fully moddable.


[Displaying decisions sorted into collapsible groups]

The only thing you have to do is to set decision_group_type = on the decision to have it show up within a specific collapsible group. The keys are defined in the decision group types database.


[Displaying decisions sorted into collapsible groups]

We use gui_tags as an arbitrary string to check for within gui files changing how they should be presented and you can easily append with your own in the same manner if you want a unique look.

Message Settings To talk about this I also have to reveal some updates to Message Settings we will ship later with the patch.


[Picture of the Message Setting window in the patch version]

Message Filters Each message can define its own message_filter_type to be handled as. These filters are defined in a separate database.

In the filters database you can set the default behavior of messages of the filter. You can set its display type, always_show if it never can be hidden, auto_pause by default and finally the collapsible group it will belong to. All but the always_show would get overridden as a player’s starts changing their own settings.


[Example of the Message Setting Filter database]

Message Groups Works exactly like decision groups mentioned above, but without the gui_tag functionality.

Message Settings Patch Updates Added shortcut on each message, quickly locating their respective filter.


[Image of shortcut icon on a toast message to its message settings filter]

This one is from Joror: Added text field to search through your message filter list.


[Text search field for message filters]


And as a parting gift requested by Mindel in a previous dev diary[forum.paradoxplaza.com] I present to you: Custom Messages! Giving you the ability to write messages to your future self reminding you about things of importance.


[Screenshot displaying the Custom Message feature]




Development Tool Improvements Hiya, this is Joror - programmer on CK3 - I have been a modder myself before my Paradox days, and was also part of our central GSG Tools team before I joined CK3. So you can say that I have experienced our dev-tools from many different angles!

Developing or modding any grand strategy game can be an overwhelming task, given the sheer amount of systems and visualization layers that work together to create a believable world.

But we can help ourselves by improving the weapons that we have to wrangle this beast - our development tools. The modding community knows this all too well. (And often it has created better tools than the dev teams themselves. You do outdo us often, but you do outnumber us as well.)

We have improved a number of the in-game dev-tools during the development of this expansion. And as a modding-friendly game, you get to use them too! Here is a probably-not-complete overview.

Object Explorer A tool often used to check out what is going on in the simulated world while it is running; we tweaked its UX a bit. To access this tool you can run ‘explorer’ console command. You can also open the ‘Inspector’ part of it by ctrl-alt mouse clicking any portrait.

Improvements:

  • Made the edit input box bigger
  • Added provider name to title of dockable
  • 'Save as Default' also remembers size and position of the object browser window
  • Object Browsers 'stack' when opened on top of eachother
  • Object Inspector will now always open to the right of the Browser window instead of on top of it
  • Hitting ctrl-enter while typing in the text box will auto-apply it
  • Bugfix - Alt-Tab no longer kills half your typed text in the text box


[The Object Browser with more information and bigger input fields]


[Picture of several stacked Object Browser window, also demonstrating it remembers a Default size and position]

Script Debug Logs That honker of a text file called `errors.log` - it is usually filled with messages of shame from a strict and mysterious machine overlord. We have cautiously convinced it to perhaps tell us a bit more than “Error on line 0”.

Improvements:

  • Scripted effects/triggers state their actual line-number instead of the 'relative' line-number
  • Scripted effects/triggers state their full file name
  • Multi-line script errors go "last-to-first" instead of "last, first-to-last" (they're now in an order like most stack traces)
  • Script file lines mention extra context in (...) behind them - the name of the object they were in, with potentially their sub-part
  • Mean-time-to-happen script calls now actually put their script location in the logs too
  • A bit of extra indenting for visual clarity


[The same error reported in the old log style and the new]

We also now follow script-execution-chains through more layers. More verbose, but ultimately easier to track down where things went wrong. For example with events triggering other events:


[A long chain of script calls, from a ‘hold_court_decision’ initial call, all the way through a series of triggered events]


Localization Syntax Checker Almost all of the text of our game lives in a large amount of .yml (sort-of YAML) text files. We call these files and their entries “loc” - after “localization” - but they’re also responsible for our text-formatting, and they can call Data script functions as well. A complex database, where it is easy to make a small mistake that goes unseen. Until spotted by our talented translators, or our very observant player base.

Improvements:

  • Added a high-level localization syntax checker at game startup on all localization keys of the current language (when in debug mode)
  • Checks for extra / unterminated loc symbols `[...] (...) $...$ '...'`
  • Checks for invalid usage of Text replacement within Data functions
  • Other loc-key replacements via `$...$` can now also apply formatters via `$...|u$`
  • Escaping single quotes in `$...$` can be done via a new formatter `q` : `$...|q$` - you’ll see a bunch of our localization has been tweaked to add this.

Various improvements
  • The map debug menu buttons work again in our release version (they still worked in our internal development builds, but modders brought this to our attention)

[Map debug menu - all these button now again do things, nice for streamers and modder that want to enable/disable visuals]

  • The Script Profiler (originally from Victoria 3 ) has been ported to CK3!

[The script profiler at work, showing us how much time was spent on various script statements]


Various AI Watch Window Changes One of the tools at our, and modder’s, disposal is the Watch Windows. Some of these are receiving some minor improvements.

First improvement to speak of is the AIWatch window, which contains various information regarding some of the AI logic and how the AI considers things like marriage, activities and relevant to this entry: available casus belli. One of the improvements we’ve made to the AI is that they will now consider a ruler’s military power rather than their military strength. Allow me to clarify the distinction: strength is the raw numbers a ruler has, no matter what troops they are. All military calculations up until now have been based on this. Power is a more accurate representation, in that it combines a regiment’s combined damage and toughness and multiplies that with the strength of the regiment. The short of it is: the AI now knows that levies are much weaker than MAAs and Knights when both declaring wars and picking battles.

To make it easier for ourselves when investigating how the AI picks available casus belli, we are exposing the AI’s power calculation, and the power they estimate other rulers to have. It is important to note that this calculation is affected by the ruler’s personality when targeting administrative realms, such that a craven ruler will overestimate a target’s power, while a bold ruler will underestimate a target’s power; a craven ruler will assume all governors operate at peak efficiency, while a bold ruler will assume them all to be useless administrators barely fit for office. These calculations can now be seen in the AIWatch Window in the Casus Belli section.


[AIWatch Window with military power in the CB tab]

Furthermore, while in debug mode, the military strength tooltip in the character window will also show an entry for the ruler’s military power.

Next is an improvement to the AI War Coordinator Watch Window. While this is not a window that helps modders too much, as the items shown within are more relevant to us who have access to the source code, it can be of worth for those who modify the strength of levies and knights.


[AI War Coordinator Watch Window]

While rarely relevant for modders, the ai war coordinator watch window can be of value when modders change the calculus of war by modifying the strength of levies, men at arms and knights, to see if their tweaks have the desired effect on strength on the sides of war.

The military power information is also available in the character window when in debug mode.


[Character Window showing “Our Military Strength” tooltip with debug mode enabled]


Warfare Modding Retiring some of !warfaremodding New modders often ask the question: can I mod armies and regiments? For the longest time we have not allowed any sort of warfare modding to the point where our modding community has had this little command on their Discord server, first proposed in 2022.


[CK3 Mod Co-op !warfaremodding command proposal and first use]

Now we retire some of these points. We are adding a whole suite of effects and triggers that affects regiments. Yes, we are making regiments a scope and various ways to access them. You’ll now be able to create, destroy, change size of, and add troops to regiments from script.

Let’s look at the refill_maa_with_provisions_effect as an example where one of them is used.


[Warfare modding example with change_maa_troops_count]

Another thing we’re adding with Roads to Power is dynamically changing commanders in battles. While not directly moddable, this does mean that one can add temporary modifiers to commanders to swap them around.

Starting wars never was easier! The ‘start_war’ script effect has some downsides because you have to specify exactly which war you want to start, and you might not know which Casus Belli and targets might be available to a character. Troublesome. You will have to wait for the general AI war background process to kick off a war you want to start.

So to give our script a bit more power, we have added a new ‘complex’ effect called ‘ai_start_best_war’, which can be used only for AI characters. It will go through all the valid wars a character can start at this moment, and gives you the opportunity to ‘select’ them via the ‘is_valid’ trigger.

Out of all the wars selected this way, the effect will start the one with the highest AI score. (as determined by the regular AI scoring mechanism for wars, which is a combination of a code-based score and script-based ‘ai_score’ calculation on Casus Belli)

The outcome of the effect can be further acted on by its two sub-effects: ‘on_success’ and ‘on_failure’.

It is a key component of how we made characters with our new Conqueror trait extra aggressive!



Music Player The contents of the music player are moddable. For those who're already modding music into the game, there's just a few more steps you have to do in order to have the songs show in the music player.

We add the Music tracks we wish to put into the Music Player into categories. To do this they must be implemented with the following files structure:


[Music Player Modding directories]

The music.txt files contain information on the tracks themselves, and in order to have them localized they all must have a name = loc_key field. Example:


[music.txt entry example for music player modding]

The music_category.txt files will then contain information on the categories and tracks contained within:


[music_category.txt example for music player modding]

It is important to note that the id field in these categories must be unique. Finally, here’s where you can add illustrations for the music player. Using the above category as an example:


[Directory structure to add illustration for music player]

Of course all the audio banks and all that must also be added into it.

Flavourization Some changes are coming to the Flavourization system. For the uninitiated, this is what separates the Petty-King from the Duke, the Emperor from Basileus, and the Divine Empress from Empress-Bishop. The big thing of note from before is that we’re encapsulating previous true/false flags in a container to collect them all. This is to improve legibility when new rules are added. Let’s look at the full structure of supported members.


[Complete structure of the flavourization, minus the detailing documentation]

This entire structure was undocumented previously, so all modders had to go on was how we had previously used it. An up to date .info file on the structures will be coming with Roads to Power so you can make your own, flavourful modifications to titles, names and the like. As of Roads to Power, naming conventions of characters with their titles (Emperor Chad to Holy Emperor Chad), title tier names (duchy to petty-kingdom) and domicile names (Estate to Family Holding) are supported.

As an example:


[Example flavourization entry for Badass Queen]

An interesting thing we discovered while adding features to the Flavourization system was: we already supported looking for character flags. It was just never documented. Our designers were enthusiastic about this revelation. Our programmers were… not so enthusiastic about the designer’s enthusiasm:


[Slack thread on Flavourization changes and discoveries]

Fair warning to our modders: the Flavourization system can get very expensive to do in terms of execution, so as much as I know better than to say this but – use it responsibly.




Achievements Hello! Rageair here with a preview of the Achievements coming with Roads to Power! I’ll start off with the easy ones, getting harder as we go down the list…


As mentioned in a previous Dev Diary we have Historical Characters such as Dante or Fibonacci spawning across the map. If you get one of them to appear in your realm while owning Roads to Power, you will have the option to set out on an adventure as them!


Take care of the people in your camp and this one should come rather easily! It’s not entirely trivial to get people to join your camp in the first place, though…


A callback to an old way to play the game, harkening back to the CK2 days (there were several YouTube series with this gimmick!) - switching which character you played every time you died. Now this is supported by the game, making it easier than ever!


Now we’re getting into the intermediate difficulty achievements. This one can happen naturally, but a fun thing to try is by playing Harold in the 1066 invasion of England, and then returning to reclaim the crown from William!


Quite straightforward - create a large realm, then adopt the new government form!


Deceptively hard seeing as there are a lot of buildings to construct in your Estate!


Buddy up with the emperor and then smite your enemies with his permission! You will probably find a lot of enemies while playing in Byzantium, so you should be motivated to pursue this.


If you’re really chummy with the emperor you might be named co-emperor, and as a co-emperor you can demand a larger share of the realm to rule as your own…


This achievement is based on history; the Palaiologos dynasty became the longest-ruling dynasty in Byzantine history after having served faithfully for a long time.


A fun challenge! Save up a lot of gold in order to weasel your way into becoming a noble family (hint: this is easier to do if you adopt Byzantium's State Faith), and then use your influence to claim the throne, good luck!


Time for the harder achievements - if you follow the story of the historical founder of the assassins it will culminate with the dissolution of an empire (historically the seljuks, but you can take him anywhere!)


Playing as El Cid you will have plenty of choice; this achievement is unlocked by following his historical path.


Saladin starts out as a Conqueror, so this is a tall feat to pull off. You have a few years to prepare for his invasion as he tends to go for central arabia before holy warring Jerusalem.


If it’s not broken, don’t fix it! Having a turkic-dominated islamic administrative empire is a fun challenge to pursue, especially seeing how Byzantium still can pack quite a punch despite having lost a lot of territories to you in the 1178 bookmark.


A natural continuation of the venerable ‘Rags to Riches’ achievement from the base game!


Georgia had plans on holy warring for these territories, but in history this plan didn’t come to fruition - an interesting and plausible alternative history scenario to pursue!


You have to work hard in climbing the political ladder to achieve the position of dominant family! Try putting as many family members on important positions as you can!


In 1178 Byzantium is at a low point, making it a fun challenge to not only survive, but thrive!


Perfect achievement to pursue in combination with Chaos is a Ladder.


If you wish to pursue this I recommend the 1178 bookmark, as it’s very likely for this to happen around that time.




That's all we have for this week; come back next Tuesday as we dive into the details behind the new Scheme rework coming in Roads to Power!




Write glorious new sagas of military conquest and romantic adventures with Chapter III.
This Chapter includes two expansions, one event pack, and one cosmetic enhancement. Enjoy new mechanics, new events, and new historical flavor to add greater depth to Crusader Kings III!

https://store.steampowered.com/bundle/38036

Join the conversation and connect with other Paradox fans on our social media channels! Official Forums[forum.paradoxplaza.com] Official Discord[discord.gg] Steam Discussions[steamcommunity.com] Twitter[twitter.com] Facebook[www.facebook.com] Instagram[www.instagram.com] Youtube[www.youtube.com]