[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!

How to enable subdivided object layers in Sandbox Editor by @Fokkusu

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 additional 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 , Port selection, browser cache.
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:

17 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:

2 Likes

How big is KCD map?

I was thinking about size of the map, terrain. How big it is?

FWIU - square 8k binary “pixels”, each of 0.5m (this is approximately correct, and is the most probable storage dimension at this size).
This tiles at the boundary, with a narrow border of inaccessible terrain (~50-150m variable) which hides the ‘edge’. You can see the tiling and how it is arranged from images/video of the ‘alchemy bench’ bug which existed in an earlier version.

So that’s 8x8km?

It is about 4 x 4 km

heres a good example of what you are able to do:

4 Likes

It seems it is completely build from ground up?

Building a new area you could travel to seems an easier task than modifying the existing map, logistically. Less chance of conflicting mod spaces. I recall several well-done pieces in Elder Scrolls that used that approach…Witcher 3, as well.

Kingdom Come Deliverance Official Modding Tools update 1 to 2.0.0*

NEW FEATURES/FILES:
-added missing source files for Storm
-updated sequences.sql file to deal with auto-increment id clashes (see wiki)
-released UI assets (under Data_reference/Libs/UI) for easier modding of game UI
-prefabs folder removed, as it is not needed (Sandbox can use the one from PAKs)

FIXES:
-Skald updated to prevent some crashes
-Updated Sandbox and Tables_reference.pak for modded dialogues to work
(there was an issue with brand new dialogues with new roles)
+this bug fix requires 1.9.4 version of the game
user.cfg has now the database name configured to “ConfigDB”, which is the only valid option anyway

2 Likes

Applauds!
Will be coming back to this thread a lot in future :slight_smile:

One quick question I’ll toss in here (it isn’t really a big deal, I got PostgresSQL installed and running with admin level on my “main” drive, meaning the one with the OS): anyone know if it is possible to install PostgresSQL onto a slave drive (i.e., one that does not have the OS nor the Admin or other UAC)?
I try to keep as much stuff on my 3TB slave drive as possible. The total size of whatever winds up in the PostgresSQL folder probably isn’t a real concern, and I reckon the games files can go wherever I want them. But when I tried to install PostgresSQL onto the slave it failed and given the app depends on a client-server dynamic that makes sense.

Thank you so much for the guide. However, I’ve run into a problem when trying to run the following command in the CMD:

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

It is showing me the following error:
/Data_reference/sequences.sql:1: NOTICE: function modding.create_sequences() does not exist, skipping
create_sequences

Any idea how to go about fixing this? I’m a complete newbie but I’d really like try this out. Thank you so much for your time!

Hey so i just found this thread and its a big help! I recently just got the editor up and running however it seems the textures and models wont load in. Anyway to fix this?

Is your game, Kingdom Come installed on Harddrive C:\ ?
If not change the command to that directory and try again.

I cant say something to that but maybe write a PN to @Fokkusu. Maybe he can help you with that.

1 Like