Difference between revisions of "KCD Before You Start"

From Nexus Mods Wiki
Jump to: navigation, search
Line 5: Line 5:
| typecategory = Getting Started
| typecategory = Getting Started
| icon = Mods.png
| icon = Mods.png
| hidenav = true
| toc = true
Before You Start
Before You Start
Line 177: Line 178:
Some info about how diffs are loaded and possible data clashes
Some info about how diffs are loaded and possible data clashes

Revision as of 14:52, 17 September 2019

Kingdom Come: Deliverance

Kingdom Come: Deliverance is an action role-playing video game developed by Warhorse Studios and published by Deep Silver for Microsoft Windows, PlayStation 4 and Xbox One. It is set in the medieval Kingdom of Bohemia, an Imperial State of the Holy Roman Empire, with a focus on historically accurate content.

Released: 2018

Genre: RPG


Nexus Mods

KCD Before You Start

Before you start for Kingdom Come: Deliverance

To have your wiki page appear here, tag it with the following categories: Kingdom Come Deliverance, Getting Started.


Before You Start

Download the official modding toolset. All the info about the tools included can be found here.

PC and DB Setup

Some of the tools (CryEngine Sandbox Editor) are recommended for use with at least a 2-monitor setup.

You should have at least 100GB free space on your target storage drive.

Download the modding tool pack and install it in your KCD game folder (the package mirrors somewhat the directory structure of the game folder).


Game database contains all the game data, such as items, dialogues, perks etc... The modding pack contains a dump of the game database in SQL format. You are going to need to run a postgreSQL server on your computer, which the modding tools will connect to.

First download and install postgresql from their website (link), then install it. During install, a “database cluster” will be created on your local computer, and you will be prompted for the locale of the new database cluster. You should choose “Czech, Czechia” (or “Czech, Czech republic 1250”). Ověřit, jestli je to potřeba - možná půjde dump udělat v angličtině??

Then start your server, connect to it using pgAdmin, and restore the database from the provided dump (Data_reference/database.sql).


Some tables use autoincrement to generate IDs for new entries. If you are going to create new dialogues, you are going to need to adjust the initial value for this autoincrement to a value unique for your mod. If you don’t, your mod will clash with any other mods that also failed to set a unique value. Do this by running following SQL query:

Dopsat query, která zavolá nějakou funkci v DB, kde už bude všechno udělaný

Working with database

Any changes made to the database will be visible in the Sandbox editor (with the exception of Localization). The game, however, reads the database from XML files inside Tables.pak or mod PAK files. To create such PAKs, use the editor’s modding window.

Asset creation

If you want to create graphical assets, you need to install plugins for exporting them in KCD asset formats. Those are slightly modified versions of CryEngine asset formats, so some of the standard CryEngine plugins might not work.

The Tools folder contains plugins for 3dsmax, Autodesk Maya and Motion Builder. We used Maya for creating all armour and clothing in the game and 3dsmax for the other 3d assets. Motion builder was used for all the game’s animations.

3dsmax plugin

Modding_public\Tools\3dsmax\plugins\maxcryexport2018.dlu copy to 3ds max directory/plugins.

Modding_public\tools\WHMaxTools\LoadWHMaxTools.ms copy 3ds max directory/scripts/startup


Maya plugin

Motion builder


Other stuff you should do with your computer/OS before you can create mods.

Many editor setup options can be preset by inserting into user.cfg file and placing in the root folder. Recommended settings follow.

External links

Modding discussion forum extLink

Modding Q&A systems extLink https://gamedev.stackexchange.com/ s tagem kcd-modding

CryEngine3 documentation extLink https://docs.cryengine.com/display/SDKDOC2/Home

Game files

Celé bych to přesunul někam jinam

Most of the raw game data is processed by builders and exported into compressed .pak files. However, you should never edit this data. You should instead create so-called diffs - additional data that override the vanilla game data. These must be placed in the proper folders so that the builders can find them. This is the basic structure:


└---Win64                                                                                                                                                 Engine/Executables



|   └---rataje                                                                                                                                    the main “Henry’s” level

|   |   |---LayerExportProfiles                                                                                                definition of layer profiles

|   |   └---Layers                                                                                                                                                    All level data

|   |       |---Design                                                                                                                                   All script level data

|   |       |---Main

|   |       |---<several layers named after locations>                                                             All graphical level data

|   └---rataje_dlc4                                                                                                           Level in DLC4, “Theresa’s” level


|   └---AI

|   |   |---final                                                                                                               all script trees except quest trees

|   |   └---quests                                                                                                                                                       quest trees

|   |---Haste                                                                                                                                  definition of Haste cheats

|   |---Storm                                                                                                                                  definitions of Storm rules

|   └---UI





|---Scripts                                                                                                                                                                   LUA scripts

|   |---Entities

|   |---Script                                                       various functions and data definitions used by script elsewhere

|   └---Utils                                                                                           useful LUA functions used by script elsewhere




Outputs                                                                                         Tree recordings and snapshots are exported here


└---saves                                                   storage of saves created in game mode in Cryengine Sandbox Editor

Modding toolkit

In the modding toolkit you will find Levels and Prefabs in the Data folder, and the rest in Data_reference folder.


The Data_reference folder contains files that can be found in the game PAKs, but they are already unpacked for your convenience. Also, some scripts in PAKs have comments or debug functions stripped; here you have their original versions.


Levels and Prefabs in the Data folder are not directly used by the game (Level has to be exported, which bakes in all the prefabs). Therefore, the Data folder is technically empty. Every other asset, configuration or script file in Data folder or any of its subfolders will now be considered part of the mod.

The Sandbox editor will try to use all files within the Data folder before any files in paks. If your new file has the same name and it’s on the same path, the editor will use this new file instead of the old one.


Mod creation procedure

A finished mod is a folder, placed in the Mods folder, containing the following files:

  • Mods/mod_name/Mod.manifest
  • Mods/mod_name/Mod.cfg
  • Any number of .pak files

You have to create the folder and mod.manifest file by yourself. For the contents of mod.manifest file, see http://wiki.tesnexus.com/index.php/Modding_guide_for_KCD

Then you can create your mod by placing new files in the Data folder, thereby replacing the original files in the game folder. For most files, you must replace the entire file, even if you only want to change a single line. When you have all the files you need in the Data folder, you can use the editor tool to pack all of them into a single PAK file. Once you do this, the game will start using your files.

The database is, in the end, exported as XML files in the Data folder, and you could use the above method for replacing files to replace one of these XML files. However, that would make your mod incompatible with any mod that changes the same file. Instead, you can use the editor tool to export only the differences between the original tables and your new tables, ensuring compatibility with any other mod. The editor tool can create these difference files and place them in a new PAK file, alongside the PAK for modified files. As before, once you create this PAK file, the game will start using your modifications to the database.

During the development of your mod, you will probably export the mod several times. The editor uses local changes, so you can partially test your mod’s functionality, but you are going to need to test it in the game as well. The game ignores your SQL database and your local files, and only uses PAKs in Data/ and Mods/mod_name/ folders. This behaviour can be overridden with sys_PakPriority cvar, but it is not recommended to do that. If your game only runs from PAKs, and you never modify the original PAKs (which you shouldn't), then you will be testing the “public” version of the mod. In other words, you are testing the exact same game state that any user of your mod will have.

After you are satisfied with your mod, you can simply just pack the entire mod folder into a single archive and distribute it.

Mod loading order

Some info about how diffs are loaded and possible data clashes

Kingdom Come: Deliverance: Forum | Before you start | Tutorials & Instructions | Modding Basics | Tools | Documentation | Glossary