[WIP/Pre-RLS] Un-Official Install Guide v1 - Modding Tools 1.9.3 & PostgreSQL 11

First let me say, i’ve investigated two days within around 13 hrs to write that guide and reproduce my failures and removing everything which i’ve created to configure and start the editor.I will update it the next few days or weeks. (actually i’m trying to find a new job in real life)
So please beware that everything is without guarantee. It is by a person (most lifetime a modder) who spends most of his free time with learning, studying and creating changes for games, creating tutorials for games, drawing art, collecting many physical things and digital data about his beloved games. I do not want to say anything wrong or that could not help anyone. So please consider mistakes. This isnt the kind of Sandbox (most in handling and configuartion) which i have expected! I am doing that for free and everyone can post other or new solutions or pm them me for adding. Thank you and i hope it will help. And if you’re already done before that Guide was posted. Good Luck with creating your dream of Kingdom Come Deliverance!

1 Install Kingdom Come Deliverance (Steam/GOG)
2 Download The Official Modding Tools 1.9.3 from nexus
Folder_Tools
------ Prepare Of User.cfg -------
You should merge your own previous used User.cfg with that one from Official Tools!
Here you can see my own config with the necessary lines for PostgreSQL start and access.

3 Extract the Tools into your Kingdom Come Install directory

4 Start the game and set your preferred game settings, exit the game after all

5 Download PostgreSQL Software, only up to version 11

ATTENTION !!!
-Version 12 is not recommend due of some reported problems by developer
install0

6 THE SETUP PROCESS

install1
install2
install3
install4
install5
Use a free Port instead of the default one if you know one!
install6
install7

After the installation a message will ask you for using another program called,
StackBuilder to download attional content, drivers, etc.
Use it because we need the ODBC driver as plugin for the PostgreSQL Software!
And it is easier for newcomers to get the correct one. (Myself used it from first day)
install11
Open the “Database Drivers” Tab and mark the “psqlODBC (32bit)/(64 bit) v11.01.0000.2” driver
install13
install14
install15

Now press “Next >” button and the setup for the ODBC driver will execute,

install16
install17
install18
install20

7 PostgreSQL start & Troubleshooting

This can be a little bit tricky, depending on your system win7 or win10
The process can have several different problems due of Admistrative rights and maybe Port selection.
On Windows 7, (my prefered operating system)
-You should first ensure that your favourite Internet Browser is set as default one.
-It is not recommend to close the Brwoser before starting the PostgreSQL configuration but i would!
+I’ve uploaded two self written batch files to Start_WinService_PostgreSQL_11.bat and Stop_WinService_PostgreSQL_11.bat. (requires admin privilieges)
That was a workaround for me and can found on Youtube.

CMD Shell command:
net stop postgresql-x64-11
net stop postgresql-x32-11


(Thank you @SosieX for posting)

Start the “pgAdmin4.exe” (Directoy, C:\Program Files\PostgreSQL\11\pgAdmin\ )
Normal the pgAdmin Splash with TrayIcon at system clock appears, the Browser opens with
the pgAdmin Homepage and a query will ask you for your password.
(In the adressbar should now written, 127.0.0.1/5432/browser)

BEWARE, here we can get two situations of starting problems !!!
Many users reported the following error during Editor starting process
2019-11-03_15h48_52
error
Myself got the second one at starting PostgreSQL with pgAdmin.
So all listed steps were used by my to create my Database and got it running again after reboots etc.
Maybe one of the following steps can help you to solve your starting or connecting/contacting problem.

A: pgAdmin Splash, pgAdmin TrayIcon appears, Browser opens with pgAdmin Homepage but Password query doesnt appears

Solution 1:
-Stop the PostgreSQL 11 Service with cmd or batch
-Refresh the pgAdmin Page in Browser (F5) press leave page or press the refresh button twice
-Click on Server entry and/or on PostgreSQL 11 entry
-If Password query appears,
-Start the PostgreSQL 11 Service with cmd or batch again
-Now enter your Password, execute and you’re connected
-Skip now to “Database Commands & ConfigDB creation”

Solution 2:
-Close your Browser Completely
+Use a Windows Clean Tool like CCleaner Portable and use the Cleaner and Registry functions.
(We need to remove the Cookies and Site Data of from your Browser.)
-Now Stop the PostgreSQL 11 Service with cmd or batch
-Start the “pgAdmin4.exe” or shortcut on desktop again
(Directoy, C:\Program Files\PostgreSQL\11\pgAdmin\ )

+If Browser with Homepage is up and Password query appears,
-Start the PostgreSQL 11 Service with cmd or batch again
-Now enter your Password, execute and you’re connected

+If Browser with Homepage is up but query did not appear,
-Stop again the PostgreSQL 11 Service with cmd or batch
-Click on Server entry and/or on PostgreSQL 11 entry
-Now the Password query appears,
-Start the PostgreSQL 11 Service with cmd or batch again
-Now enter your Password, execute and you’re connected

B: pgAdmin Splash, pgAdmin TrayIcon appears, Browser doesnt opens and did not connect to the localhost server

-Shutdown task pgAdmin4.exe/psql.exe and/or maybe pg_ctl.exe
-Stop the PostgreSQL 11 Service with cmd or batch
+Use a Windows Clean Tool like CCleaner Portable and use the Cleaner and Registry functions.
(We need to remove the Cookies and Site Data of from your Browser.)
+You can open the Security Panel in your Browser and use the “Clear Cookies and Site Data” button


-Start the “pgAdmin4.exe” or shortcut on desktop again
(Directoy, C:\Program Files\PostgreSQL\11\pgAdmin\ )
-If TrayIcon AND Browser with Homepage is up and Password query appears,
-Start the PostgreSQL 11 Service with cmd or batch again
-Now enter your Password and execute

I will add some more solutions if i find more out or they were reported by other users!

For Windows 10 Users i cant say anything about a workaround as the ones i’ve tried to describe above.
But i found that picture (posted by @SimranZenov) in steam community hub of KCD.

Control Panel > System and Security > Administrative Tools > ODBC Data Source (32-bit) and (64-bit)

Looks like you can change and reconfigure your server informations/settings.

8 ConfigDB creation

Now we need to create the Database to restore the whole tabels for seeing objects, items, etc. in the Sandbox Editor. And for sure, to prevent a very amount of errors during loading world/levels.

NOTIFICATION

I dont know yet exactly but there will still some errors at converting proceed.
At Editor starting i got still five errors which depends on German Localization.
Reason is Unkwon for me atm???

Follow now the picture tutorial again to create the Database.


Enter your Password from PostgreSQL Setup in the query,

Now you’re connected to your [localhsot] server, click Right-Mouse button on the “PostgreSQL 11” entry > Rollover “Create” > and click “Database…”, small window will appear and type “ConfigDB” (exact as i write it but without quotes) Press “Save”, Done!

Now it should look like that,


Next we need to create a second Extension in the Databases\ConfigDB\Extensions, click Right-Mouse button on “Extensions (1)” entry > Rollover “Create” > and click “Extension…”, small window will appear and type “uuid-ossp” (it will appear after typing uui) Press “Save”, Done!

Now it should look like that,

9 Tables Restoring Commands

Now open CMD shell and enter following,
NOTE: You have to change the lines if you installed software and/or game in another hdd/directory

“C:\Program Files\PostgreSQL\11\bin\psql.exe” -f “C:\KingdomComeDeliverance\Data_reference\modding.sql” -U postgres -d ConfigDB -q

“C:\Program Files\PostgreSQL\11\bin\psql.exe” -f “C:\KingdomComeDeliverance\Data_reference\public.sql” -U postgres -d ConfigDB -q

“C:\Program Files\PostgreSQL\11\bin\psql.exe” -f “C:\KingdomComeDeliverance\Data_reference\sequences.sql” -U postgres -d ConfigDB -q

For safety purpose,

-You can download simple SetDatabase_cmd.txt file by me, open it with editor to copy&paste the commands into the cmd shell with RMB
-Write them manually into cmd shell, but enter only one command after one is finished to have a safe creation.
If you copy them from above cryptic letters can be generated in the shell and conversion will not work !!!

Sequences.sql

cmd0
Press Enter and it will ask you for your PostgreSQL Password
cmd1
You will type ghostly/invisible letters so BEWARE of typos!!!
Let the process ending and everything should be ready to use the level export command

If everything was going right you should now have on rights side of ConfigDB/Schemas/modding/Tables the value (468)

10 Registeration of integrated Sandbox Tools/functions

So there is another small extension as part of setting up the tools before attempting to start the editor without loading certain data in progress or exporting a level.pak or a level in * .cry format (modifiable).
There are several tools with functions integrated that working only with the SQL database.

NOTE: I dont know yet if this exempts the loading/exporting process from several last occured errors

You can find the file “db.reg”, a windows registry file in
X:\Steam\steamapps\common\KingdomComeDeliverance\Tools!registry reg_icon
Click on it with Right-Mouse button and Edit/Modify the file,
Here is my own saved db.reg example for the guide!


To enter your correct Port number (dword:0000XYZA) without open windows regedit, try this site for example! Add your Port number in line "Dezimal: " and press blue button if auto function not shows the Hexadezimal vaule. Replace last four numbers in db.reg file, save, close

Execute it, press yes and okay!

reg

Now you’re able to open the Sandbox Editor


You can export a level.pak with following command or this ready4use batch file.
Copy it into the bin64releasedll folder of your Kingdom Come installation

Editor.exe -useHDDForILAO -useILAOFolder AOData_builder -unattended +r_BreakOnError 0 -noSourceControl -exportTexture -layerExportProfile Game -export Data\Levels\rataje\rataje.cry

modding_eula.txt (17.9 KB)
Credits @Urquhart , @SosieX, @SimranZenov, @PostgreSQL Global Development Group, @WarhorseStudios, @Lissworx, @Rataj
(The donkey will mentioned always as last) :blush:

15 Likes

Thanks for the guide I was a bit confused about where to download OCBC from. Do you know if it is possible to edit/enhance the official guide here: https://wiki.nexusmods.com/index.php/Setting_up_Database ?

You got the driver? And i think sure, someone can replace and expand it but idk when and who.
I have not much contact to the nexusmod owner/admins. And thanks @Urquhart, that you pinned/attached the thread!

EDIT :

+Updated the Solution for problem (B) in
7 PostgreSQL start & Troubleshooting

regards,
Rataj

Do anyone have errors that prevent everything on the rataje map from loading except terrain + textures?


Everything else gets this error that shows on the screen. I got the database running with everything

Any tips or help? Thanks in advance :slight_smile:

Edit: Nvm reading through this forum I found someone that had my issue and knew what to do about it, I will display that here with extra detail for the people that wonders that too, it should be added to the guide I think.

  • When you start the editor and load the rataje map you will get the gamemap but it will be missing everything, that’s completely normal because the levels are subdivided into layers inside the map.

  • On the button with the arrow there are the layers, load one where you want to look around/edit/whatever and let it load.

  • I loaded tamberlg, now if I wanna see around how it is I can use CTRL + G to play there.

  • When you are done testing you just have to use ESC and “Quit the Game”, dont save.

I hope all this is useful :slight_smile:

1 Like

How big is KCD map?

Not compiled the rataje map folder (without final pak files) is 3,68 GB (3.962.318.848 Bytes)
and all three pak files after compiling are together 1,66 GB (original ones from WH/Game)