1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

 Official 1C Company forum Modding Darkside / WotN without the Editor
 Register FAQ Calendar Mark Forums Read

 King's Bounty Famous series of Fantasy Real-time RPG with turn-based battles.

#1
09-28-2016, 04:51 AM
 MattCaspermeyer Approved Member Join Date: Aug 2010 Posts: 549
Modding Darkside / WotN without the Editor

I've been asked how I modded the game.

Here is the tool you need:

KB_DB_EDIT

You should be able to search these forums to get it and it should still be available. If not, let me know and I'll post it here.

What you need to do with KB_DB_EDIT is read the README.TXT file and learn how to decompile and compile the binary game files.

You will need to decompile the LOC files (these are basically the map data files) if you want to change stuff that appears on the maps / shops, etc.

Once the file is decompiled, you need to use your favorite text editor to make changes to the file.

The files have sections like this:

Code:
{Y}{embs}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
{
{Y}{els}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 13 elements
{
{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
{
{U}{rndid} = {2701106889}
{A}{n} = {Aguzik_Big_Axe}
{A}{aa} = {npc_dying_aguzak}
{U}{f} = {33}
{U}{cnt} = {1}
{Y}{ii0}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
{
{X}{p} = {66660842DC1A8044CDCC2A420000803F}
{F}{a} = {6.04}
{F}{s} = {1.00}
{U}{u} = {1964}
{Y}{vp}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
{
{Y}{hint}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
{
{U}{flags} = {0}
{W}{strg} = {itext_m_tristrem_start_1964_hint}
}
{Y}{msg}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
{
{U}{flags} = {0}
{W}{strg} = {itext_m_tristrem_start_1964_msg}
}
}
These are typically large files and so you need to search for the ATOM's of the units you want to change, for example:

Code:
		{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 8 elements
{
{U}{rndid} = {1784720102}
{A}{n} = {embryo_4}
{A}{aa} = {army_shaman}
{U}{f} = {33}
{U}{cnt} = {1}
{Y}{ii0}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
{
{X}{p} = {CDCC6441AB1480449A99DC420000803F}
{F}{a} = {-0.84}
{F}{s} = {1.00}
{U}{u} = {1986}
{Y}{vp}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
{
}
}
{Y}{aov}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
{
}
{Y}{e}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 8 elements
{
{W}{name} = {}
{I}{jnt} = {-1}
{U}{tdf} = {0}
{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
{
{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 10 elements
{
{W}{name} = {??????}
{U}{bod} = {1}
{U}{hero} = {0}
{A}{script} = {}
{U}{disp} = {1}
{U}{arra} = {1}
{A}{beh} = {Joining}
{Y}{troops}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
{
{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 8 elements
{
{A}{races} = {}
{A}{units} = {shaman}
{A}{level} = {}
{A}{perc} = {100}
{A}{kolvo} = {1}
{U}{prob} = {10}
{I}{ext} = {-1}
{U}{fillt} = {0}
}
}
}
}
{U}{chance} = {100}
{U}{uid} = {6}
{U}{wuid} = {153791718}
{A}{class} = {army}
}
}
Buried in here is the number of Shamans you'll get from a stack (army_shaman) of friendly shamans that appear on the map::

Code:
							{
{A}{races} = {}
{A}{units} = {shaman}
{A}{level} = {}
{A}{perc} = {100}
{A}{kolvo} = {1}
{U}{prob} = {10}
{I}{ext} = {-1}
{U}{fillt} = {0}
}
{A}{units} = {shaman} refers to the ATOM file for that unit and {A}{kolvo} = {1} is the number you'll get. You can make simple changes, for example: {A}{kolvo} = {2 } will give you 2 shamans. You can save the TXT file and then compile it back into a LOC file with KB_DB_EDIT. Make very simple changes like that at first and then test it.

I can't stress the testing part enough because if you mess up the TXT file and recompile it and run the game with it, it will probably crash.

There is a steep learning curve for doing this, but I had to figure it out when I was creating my H3B mod for TL in order to make some of the changes I made to the game.

You can also use KB_DB_EDIT in combination with the AP / CW editor and then decompile simple maps you create, then make a slight change, and note the differences (use a file compare tool like WinMerge) in the two files.You can also learn the syntax used to do unit ranges / probabilities and other types of things via this type of method.

With KB_DB_EDIT you can mod the entire game without the editor plus there are certain things that I never figured out (for example you'll see rndid or uid and other codes that I have no idea how to generate), but you can always perform a trial and error change and see if it works. I did this a lot with TL and discovered that some of the ID's you can ignore while others you cannot.

See this post for an example of where to put the files you change: http://forum.1cpublishing.eu/showpos...1&postcount=21

Experimentation is key!

By the way, I haven't modded the game in about two years and so I had to go mostly off of memory (which is quite fuzzy) and I also don't frequent the forum much any more, but if you have questions, post them here and hopefully I'll swing by to answer them in the near future.

Good luck with trying to mod the game!

Matt
#2
09-29-2016, 07:29 AM
 jahes64 Approved Member Join Date: Jan 2015 Posts: 69

Thanks for the guide.

In prologue campaign of demoness in DarkSide, last stack is positioned very badly that we can't fight it! How to correct it?

Also how to load DarkSide maps in editor? I copied "darkside" folder from "sessions" folder of darkside's main directory to "sessions" folder of crossworlds's main directory, then started editor and chose "darkside", but all I got after choosing one of maps, was a crash!

Last edited by jahes64; 09-29-2016 at 07:38 AM.
#3
10-05-2016, 03:23 AM
 MattCaspermeyer Approved Member Join Date: Aug 2010 Posts: 549

Quote:
Okay, KB_DB_EDIT is here:

Quote:
 Originally Posted by jahes64 In prologue campaign of demoness in DarkSide, last stack is positioned very badly that we can't fight it! How to correct it?
If you are really good with KB_DB_EDIT and deciphering the LOC file in question, you should be able to reposition units with it. I'd suggest starting with Daert and playing with m_vampire_start\m_vampire_start.embryos.loc. Fiddle with this file because it is very small and you can use it to learn a lot about the file structure by making changes and starting a new game since you can immediately see your changes. Also look specifically at embryo_0 through 2.

Here is what I have for embryo_2 (I changed to give you female vampires):

Code:
		{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 8 elements
{
{U}{rndid} = {2709136742}
{A}{n} = {embryo_2}
{A}{aa} = {army_vampire_woman}
{U}{f} = {33}
{U}{cnt} = {1}
{Y}{ii0}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
{
{X}{p} = {6666904200008044333388420000803F}
{F}{a} = {0.72}
{F}{s} = {1.00}
{U}{u} = {50}
{Y}{vp}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
{
}
}
{Y}{aov}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
{
}
{Y}{e}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 8 elements
{
{W}{name} = {}
{I}{jnt} = {-1}
{U}{tdf} = {0}
{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
{
{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 10 elements
{
{W}{name} = {??????}
{U}{bod} = {1}
{U}{hero} = {0}
{A}{script} = {}
{U}{disp} = {1}
{U}{arra} = {1}
{A}{beh} = {Joining}
{Y}{troops}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
{
{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 8 elements
{
{A}{races} = {}
{A}{units} = {vampire_woman}
{A}{level} = {}
{A}{perc} = {100}
{A}{kolvo} = {2}
{U}{prob} = {10}
{I}{ext} = {-1}
{U}{fillt} = {0}
}
}
}
}
{U}{chance} = {100}
{U}{uid} = {3}
{U}{wuid} = {1384780455}
{A}{class} = {army}
}
}
Note that I *think* the position is controlled via:

Code:
				{X}{p} = {6666904200008044333388420000803F}
{F}{a} = {0.72}
{F}{s} = {1.00}
{U}{u} = {50}
{Y}{vp}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
{
}
Note that the really long hexidecimal value after {X}{p} I never figured out how to generate. In my H3B mod I just ignored it and it seems to have caused no harm.

I'm guessing that these two deal with position: {F}{a} and {F}{s}? I'm not certain, but you'll have to experiment to find out. If those don't do anything, then I have no idea where they'd be - you'll have to use the editor to add a unit, save the session, copy the LOC, move the unit, save the session, and do a file compare of the old and new decompiled LOC text files.

Quote:
 Originally Posted by jahes64 Also how to load DarkSide maps in editor? I copied "darkside" folder from "sessions" folder of darkside's main directory to "sessions" folder of crossworlds's main directory, then started editor and chose "darkside", but all I got after choosing one of maps, was a crash!
The editor creates a new session under your Windows User Name and somewhere down in AppData or something like that. Launch the editor, create a new session, and then go find it on your hard drive. I don't have AP / CW installed right now, so I'll have to install them to verify where the stuff is located...

Once you find it, then you can load LOC files from there, but the editor does crash a lot so you have to have a lot of patience with it.

All be sure to read all posts in the King's Bounty Editor Forum if you haven't done so already.

Good luck!

Matt
#4
10-05-2016, 09:16 PM
 jahes64 Approved Member Join Date: Jan 2015 Posts: 69

Btw I went for KBscaner for scanning saves to choose the best save before I start a new game, then I noticed that KB_DB_EDIT_0.75_eng.zip exist in my KBScaner archive! After comparing the file that I found with the one that you uploaded, I noticed that the file that I found in KBScanner archive is twice larger and its time stamp is newer than yours but its icon is of lower quality even though version number of both are the same.
Not sure but I think what I found is newer, so I attached it here.

Quote:
 The editor creates a new session under your Windows User Name and somewhere down in AppData or something like that. Launch the editor, create a new session, and then go find it on your hard drive. I don't have AP / CW installed right now, so I'll have to install them to verify where the stuff is located... Once you find it, then you can load LOC files from there, but the editor does crash a lot so you have to have a lot of patience with it.
I made a new session and saved it but it was saved in same directory that the editor asked its address when i started it for the first time. But I failed to load LOC files in it for edit purpose!
At best I managed to load LOC file from Misc/view storage file... just for viewing purpose. And what is more, after loading LOC map was not loaded, I just got a list!
How to load Darkside maps in it?

Quote:
 All be sure to read all posts in the King's Bounty Editor Forum if you haven't done so already.
Ok, I will do it.
Attached Files
 KB_DB_EDIT_0.75_eng.zip (501.7 KB, 11 views)
#5
10-07-2016, 02:54 AM
 MattCaspermeyer Approved Member Join Date: Aug 2010 Posts: 549

Quote:
My bad, I should have checked the ZIP file - I've edited my post and added another ZIP that includes the README and another "0.75" version of KB_DB_EDIT. Just use the one that you find works best as I'm not sure why there are so many "0.75" versions!

Quote:
 Originally Posted by jahes64 Btw I went for KBscaner for scanning saves to choose the best save before I start a new game, then I noticed that KB_DB_EDIT_0.75_eng.zip exist in my KBScaner archive! After comparing the file that I found with the one that you uploaded, I noticed that the file that I found in KBScanner archive is twice larger and its time stamp is newer than yours but its icon is of lower quality even though version number of both are the same. Still README.TXT is missing. Not sure but I think what I found is newer, so I attached it here.
I forgot that KBScanner includes KB_DB_EDIT - the whole savegame file is dumped as if it is a LOC file (and other files, too).

Quote:
 Originally Posted by jahes64 I made a new session and saved it but it was saved in same directory that the editor asked its address when i started it for the first time. But I failed to load LOC files in it for edit purpose! At best I managed to load LOC file from Misc/view storage file... just for viewing purpose. And what is more, after loading LOC map was not loaded, I just got a list! How to load Darkside maps in it? Ok, I will do it.
Someone loaded the Legend maps into it - there is a post about it in the Editor forum, so hopefully it gives you some hints how to do it.

I can see I'm going to have to go find the folder for you where it stores the sessions you're working on...

Matt
#6
10-07-2016, 03:52 AM
 MattCaspermeyer Approved Member Join Date: Aug 2010 Posts: 549
Editor Data Is Here

Okay, here is where the King's Bounty Editor game data is located if you're going to use it:

<WINDOWS DRIVE>:\Users\<USER NAME>AppData\Local\VirtualStore\Program Files (x86)\1C Company\King's Bounty. Armored Princess\sessions

On my system, mine is located here:

C:\Users\Matt\AppData\Local\VirtualStore\Program Files (x86)\1C Company\King's Bounty. Armored Princess\sessions

So you should be able to find your King's Bounty Editor sessions under there that will include any new data you create (maps, etc.).

I made a new session and called it "sunset" so there is a sunset folder under there...

Good luck and keep posting questions here...

Matt
#7
10-07-2016, 03:05 PM
 jahes64 Approved Member Join Date: Jan 2015 Posts: 69

Quote:
 Originally Posted by MattCaspermeyer My bad, I should have checked the ZIP file - I've edited my post and added another ZIP that includes the README and another "0.75" version of KB_DB_EDIT. Just use the one that you find works best as I'm not sure why there are so many "0.75" versions!
Thanks, but that readme file is in Russian, which is of no use to me. Is there no English version of it?

Quote:
 Originally Posted by MattCaspermeyer I forgot that KBScanner includes KB_DB_EDIT - the whole savegame file is dumped as if it is a LOC file (and other files, too).
You mean this tool can edit saves too?

Quote:
 Originally Posted by MattCaspermeyer Someone loaded the Legend maps into it - there is a post about it in the Editor forum, so hopefully it gives you some hints how to do it.
Ok, I will try to find that post.

Quote:
 Originally Posted by MattCaspermeyer I can see I'm going to have to go find the folder for you where it stores the sessions you're working on... Matt
For me "1C Company" folder does not even exist here:
<WINDOWS DRIVE>:\Users\<USER NAME>AppData\Local\VirtualStore\Program Files (x86)\

I made another session and saved it, but again it saved in the folder that I had given its address to the editor first time that I ran the editor. (I chose a folder outside windows drive because damned "windows" folder of win7 grows up as time passes.)

That session is saved here for me (a single .strg file):

Anyway, I copied m_atrixus folder from
D:\GOG Games\King's Bounty - Dark Side\sessions\darkside\locations
to
and ran the editor, this time its name was in the list for me to choose for loading it in the editor.I loaded the map, found that bad positioned stack, corrected its location and saved it. But none of those files were updated (all had same checksums), instead a new file was created with .strg extension! I put it in mods folder, ran the game and went to fight that stack but nothing was changed!!! Then I closed the game, moved that file from mods folder to m_atrixus folder beside the files that it corrects, and ran the game again, but still position of that stack was not changed.

Should I put .strg files elsewhere to work???

 Thread Tools Display Modes Hybrid Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules