Whether you're a beginner or experienced creator of KCD2 mods, you won't need to look far to come across the term Patched Table Files, often abbreviated as (PTF). In this guide we'll be taking a look at this concept in more detail, understanding what it means and why it is crucial for both mod users and mod creators. In later guides, we'll also look at exactly how you can ensure that any mod you create is PTF-compliant.
Originally introduced in Kingdom Come: Deliverance mods using the official tools, PTF allows targeted file modifications instead of overwriting entire files. This method enhances compatibility, enabling multiple mods to alter the same file provided they don’t modify the same lines. [Rubbermonkey - KCD Modding Community]
That's probably enough of a definition for most mod users. They simply need to heed the following:
1 → Installing only PTF mods ensures maximum compatibility between those mods
2 → Look for "PTF" (Patched Table File) in the mod name / description, like so: STAY CLEAN FOR LONGER - PTF
3 → Avoid any mods which modify tables that do not use Patched Table Files, as it will quickly become impossible to manage yourself.
Read on if you want to learn more about PTF.
In Kingdom Come Deliverance 2, gameplay-controlling properties are found and defined in Table Files. These are XML files that are stored in PAK archives inside the game's Data directory (You can learn more about PAK files Here). The properties within these files control and influence a plethora of game behaviour and functionality, such as:
And much, much more.
While KCD2 ships with predefined vanilla properties, anyone has the ability to change these by either:
When the game is loading up, it processes all Table files including those of any mods. The mod Table Files will take precedence over the built-in ones, which enables us to override any number of vanilla properties.
It is at this point that incompatibilities can occur if these overrides are not performed correctly using Patched Table Files.
Let's say that we as a mod author decide that we want to change a specific gameplay property, and then release this change as a mod. We've copied the relevant Table file, placed it into our mod folder, changed the property we're interested in and released the mod to the world.
Simple, right? Well... there's a problem here.
What if another mod author wants to change a different property inside that same Table File? These two mods will be incompatible if either one doesn't use Patched Table Files, as the Table File configuration from one mod will completely replace that of any other mod.
With a Patched Table File, we tell the game that we're only defining and overriding a specific part of an existing Table File, and that we want to leave all other configuration within that file as-is. This allows multiple mods to change properties in the same Table File(s), because the changes from each mod will be overlayed and merged together.
As long as two mods don't change the same lines, no conflicts or incompatibilities will occur.
The following diagram demonstrates the differences between using vs. not using Patched Table Files:
In the next guide we'll look at a very simple mod to demonstrate exactly how you can ensure that any Table File changes you make are PTF compliant. (TBD - link here)
I would like to thank the KCD Modding Community as a whole for their knowledge and information on this topic, which helped greatly in the production of this guide. Special thanks however go out to the following individuals for their insight, explanations and/or assistance: