What we know about modding (so far)

Hi everyone,

After enjoying the game for several hours I decided to crack open the files and have a look. This thread is for serious modders looking for specific modding information for KC:D using CryEngine, or any future tools that may be released.

A few quick observations:

  • Game data is stored within .pak files, located in your /data directory. These are similar to .zip or .rar files (in fact, you can use WinZip or WinRar to open them!)
  • These .pak files separate game data into self-explanatory categories (e.g. “characters.pak”)
  • Although you can open the .pak files themselves, the individual files contained within are encrypted. I’ve had no luck viewing simple files like .dds images, as external software and readers can’t open them.
  • It’s likely that tools or keys would need to be released in order to allow editing/replacing these files, or adding new ones to the .pak files. This is a form of encryption many game developers use to prevent people from simply stealing their work and reusing it without permission. I’m not 100% sure, but this is the most likely possibility.

Here are a few of the file types you’re likely to come across exploring the .pak files:

- .cgf (Crytek Geometry Format)
The .cgf file is created in the 3D application and contain geometry data (grouped triangles, vertex attributes like tangent space or vertex color, optional physics data, and optional spherical harmonics data).
- .chr (Character)
The .chr file is created in the 3D application and contains the skeleton data and physics proxies used for hit detection and ragdoll simulation which is driven by animations.
- .skin (Skinned Render mesh)
The .skin file is created in the 3D application and contains skinned character data. It can be any asset that is animated with bone-weighted vertices like humans, aliens, ropes, lamps, heads, and parachutes. The .skin file includes the mesh, vertex weighting, vertex colors, and morph targets.
- .dds (DirectDraw Surface)
The .dds files are texture files created by the resource compiler from Tif Source files, specifically optimized for the target platform. This is the optimal format for PC Graphic cards. It can contain compressed and uncompressed data.
- .mtl (Material)
The .mtl file is created within the Material Editor in Sandbox and material description (internally an xml file). It contains settings for shaders, surface types, and references to textures. The.mtl file is a text file which holds all the information for the in-game material library. The material library is a collection of sub materials which can be assigned to each face of a geometry. You can have for example different surfaces like metal, plastic, humanskin within different IDs of the asset. Each of these sub materials can use different shaders and different textures.
- .cdf (Character Definition File)
The character definition file is created in the Character Editor in Sandbox. It contains the reference to a .chr file and its attachments (can be .chr or .cgf).
- .chrparams (Character Parameters File)
For a (skeletal) character in the game, there are certain definitions that have to be made in a single unified XML file-structure called a .chrparams file. The .chrparams file has the same name as the character file to which it refers. Please see The AnimEvents and Tracks Database Files document for more information.

Ok, so we can’t view or edit the files with external programs. Has anything good or useful been learned so far?

Plugging an extracted .pak file into a sample CryEngine project, I was able to find a base mesh to determine the skeleton position, which can then be used to create an avatar for modeling programs like Marvelous Designer. It should also serve as a rough template for the default model position in other programs.

I plan on diving a bit deeper into the game data (after enjoying the game some more, of course!) and will continue to post updates in this thread.

Good luck!

BM

16 Likes

Nice to see someone doing some digging.
I was digging into the scripts directory and such, trying to see how to change something like the animal AI or the lockpicking tolerances values.
For the animal and AI in general there are a lot of directories in the .paks called AI, but there are few .lua scripts or xml files that seem to have any real impact on AI behavior. Also, I found some really out of place files in there. I don’t know if it’s remants of a sample project or what but I was seeing a ton of .lua scripts and xml files references things like missile tanks, M15 rifles, things you’d read in a FPS like CoD or the like. Bizzare these didn’t get cleaned out for launch.

As for lockpicking, I found the parameters in the Tables.pak in the rpg folder. However, the XML files are editable - and I could replace them in the archive, I don’t think the game reads from them in any way - a intermediate build step seems to be needed, to convert the xml file to the adjacent, similarly named .tbl (table?) files.
I looked in a HEX editor at them, and they are indeed linked to the XML, but I wasn’t sure how to go about editing them with just the HEX values visible.
Anyways, I hope the devs are really supporting with modding, both with the tools and with the documentation. I’d love to take a crack at fixing the pitiful animal AI. As of right now, hunting kills my immersion (!) as the rabbits only react if you get in their face.

4 Likes

Good stuff, thanks for the info!

EDIT: It looks like it’s possible to get .cgf files in the editor. Here are some of the extracted map objects in the CryEngine SDK (simply pull the CGF files from the game data .paks into your own project, insert as brush):

1 Like

Please return beautiful graphics with detailed forest, volumetric lighting and thick grass for powerful computers, as it was in the beta version. Is it possible to do in mods? Which files are responsible for fog and lighting? Look at the screenshots of the beta version as beautiful.

If it’s possible to edit the map, theoretically anything is possible – adding detail, removing detail, changing plants, etc. So far we’ve been able to get CGF (mesh) files in-game and haven’t experimented much with the map itself.

Here are some armor pieces. What’s interesting is that they aren’t in skeleton positioning, which could mean other files (perhaps .skin files?) contain the weighted meshes. For size approximation, still helpful though.

A closer look at the geometry:

You can export these objects as .obj files by inserting them into the Cry editor as a Brush (NOT entity). Then click on “Level” on the toolbar and “Export selected objects”. Boom!

For saving option fix…

I explored the Tables.pak a bit and believe I found a way to change armor types, uniforms, and change what NPCs actually wear in the game. For example, you can make Rattay guards wear Skalice guard uniforms, or even dresses! This should also allow you to get custom armor pieces in-game and assigned to NPCs or groups of NPCs.

I created a guide on Google Docs, which you can view here: https://docs.google.com/document/d/1_m_zhrX_2Q65AFEzLU4dZhFtzLRSvKKOVcYBDVUwXY8/edit?usp=sharing

Once we figure out how to rig and compile our own models (may or may not be possible without an SDK), it should theoretically be possible to create the definitions, presets, and assign the armor pieces to characters.

I did a read through of the document. The data does seem to be very easily changed with or without a tool (in the worst case, we could generate a tool that modifies the xml).
At least we know the understanding part will be easy, we just have to either wait for them to release the tool that generates the associated .tbl file or reverse engineer it and make the tool ourselves. There is a lot of info in that Table.pak though, it might take a lot of time to digest all of it.

You can actually just modify the .xml in Notepad, I had success doing it that way. For example, I made small adjustments that changed the comfort level sleeping on the ground or a bed.

The matching .tbl files aren’t necessary at all. I deleted them from the .pak files and the game worked just fine. The game references .xml data.

EDIT: I noticed modifying the clothing only works during character initialization. I’m able to replace Henry’s father’s clothing after starting a new game, but not when he’s already loaded into it.

1 Like

Hmm, I see, interesting. My mistake for not being so thorough.
The reason I made that deduction was I tried modifying the rpg_param.xml (SteamLibrary\steamapps\common\KingdomComeDeliverance\Data\Tables.pak\Libs\Tables\rpg)
I tried changing the stamina cost for jumping, the xp gain for jumping, along with the lockpicking parmaters (tolerance values, etc)

I loaded the game after every change and could not detect any sort of difference. Perhaps you could try as well, maybe I am doing something wrong?

At any rate, it’s good to know they reference the files directly for at least some cases!

1 Like

You need to delete the .tbl file and the game will instead load the .xml instead. I’ve used this to modify the games combat so that the MaxDmgR value is reduced by 20% which makes enemy damage realistic at max skills (harder combat).

Adding items to shops seems a bit tricky as there is multiple shop item types, shop type and shop ids. If anyone has figure out how to add items would be interested.

Just adding them to “shop_type2item.xml” seems to do the trick. Look in the “shopkeeper.xml” to see what the vendor ID is. I don’t know what the “item_category_id” is for at this moment. Maybe somebody else knows?

1 Like

First of all, I’d reccomend you take a look into the GameData.pak\Libs it contains quite a list of categorized systems.

Secondly “item_category_id” if you go to Tables.pak\Libs\Tables\item you can find the “Alchemy_material_type.xml”, “alchemy_material_subtype.xml”, “armor_type.xml”, “armor_subtype.xml” etc same for weapons, the “item_category_id” is a quicklook link as to what category the item’s id is stored in to save up on querrying the game files one by one instead it querries a specific item category for a specific item.

the example is the “armor_type.xml” which contains the following in the .xml

<row armor_type_id="1" armor_type_name="default cloth" equip_buff_id="" />
      <row armor_type_id="2" armor_type_name="light leather" equip_buff_id="" />
      <row armor_type_id="3" armor_type_name="heavy leather" equip_buff_id="" />
      <row armor_type_id="4" armor_type_name="chain" equip_buff_id="" />
      <row armor_type_id="5" armor_type_name="plate" equip_buff_id="" />
      <row armor_type_id="6" armor_type_name="decorated" equip_buff_id="" />
      <row armor_type_id="7" armor_type_name="cloth" equip_buff_id="" />
      <row armor_type_id="8" armor_type_name="spur" equip_buff_id="62ae725e-56d9-46fa-a09a-794480b757a5" />
      <row armor_type_id="9" armor_type_name="shoe" equip_buff_id="" />
      <row armor_type_id="10" armor_type_name="horse_saddle" equip_buff_id="e2f2e0c7-b1d0-4ec5-8f1f-9f412f547f2d" />
      <row armor_type_id="11" armor_type_name="horse_shoe" equip_buff_id="41e625ec-7783-46fd-8409-e2f05d93d023" />
      <row armor_type_id="12" armor_type_name="horse_bridle" equip_buff_id="061d9f55-6652-461f-bb64-471a631f2d21" />

same goes for weapons although those are stored under “melee_weapon.xml” and “melee_weapons_type.xml” here is where ti gets a bit more complicated, “melee_weapon.xml” contains the list of all melee weapons in the game with their item ID’s for instance

" <row attack="3.7" item_id="196be21b-6d21-4dd6-84e4-c95ecd2092a7" slash_att_mod="0.05" smash_att_mod="1" stab_att_mod="0.05" />

“”`

Now look at the item_ids “196be21b-6d21-4dd6-84e4-c95ecd2092a7” and “3ef71c79-57c2-4f28-8f31-a091d9b78798” you can notice that the starting numbers are different, if you reference yourself back to the “melee_weapon_type.xml” you will see that the weapon type is defined by the first number in the items ID tag, meaning that the first one is a Sword (short) and the second one is a Axe, keep in mind that for some items there are Arch-types and Sub-types so this is something to be mindful of.

2 Likes

You can already extract the terrain data, models both of the places, characters and items and import them into Cryengine 5 for placement, I’m still trying to figure out how to generate the entire level map of KDC without hand-placing every single tree on the map but the information for it should be in there as well but might be buried deeper. However the dds files seem to have been encoded in some form as I’m unable to open them across a assortment of programs with native dds support and with dds plugins.

image: https://imgur.com/i2AIfgX

In the beta version was a more detailed and dense forest, the range of drawing, fog volume and better lighting. Is it possible to return the graphics to the beta version for a powerful PC? Screenshots of beta version

Could you post the screenshots of how your pc renders it alongside the screenshots you just posted so that we can see the difference, it might be a change in settings, and as far as I saw the wh_pl_fog is set to 0 but I havent tried switching it since the console seems to be pretty much on lockdown aside from a few things.

Another thing to try would be to change the --near fog culling setting in the system.cfg in your main KCD folder

You need screenshots of the beta version (2016) and the release version 2018?

We may need a DDS Unsplit tool, I’ve had no luck with textures either - I’ll do some digging today.

e_VolumetricFog does look similar. It’s set to 0 by default.

A lot of stuff was cut from the Beta 2016 to now, plus console commands where you could most probably edit all of these things are on lockdown to the point of not even being able to spawn weapons. I’d say it’s one of the fog settings most probably the config one or located deeper in the weather system, possibly a weather type that they removed due to consoles.

1 Like