Modcraft - The community dedicated to quality WoW modding!

Legion- / WoD- / Mop- / Cata-Modding => Tools => Topic started by: barncastle on August 14, 2016, 07:24:03 pm

Title: [TOOL] WDBX Editor
Post by: barncastle on August 14, 2016, 07:24:03 pm
A project I started initially to learn how DBC files worked that eventually turned into this and thought it was worth a share.

This editor has full support for reading and saving all release versions of DBC, DB2, WDB and ADB. This does include support for both Legion DB2 and ADB files and works with all variants (header flags) of these.

Like the other editors I've used a definition based system whereby definitions tell the editor how to interpret each file's columns - this is a lot more reliable than guessing column types but does mean the definitions must be maintained. So far, I've mapped almost all expansions with MoP being ~50% complete, WoD being ~95% complete and everything else being 99%+ (excluding column names).

Link to the source can be found here (https://github.com/barncastle/WDBXEditor).

Features:

Tools:

Things to Note:

Credits go to Ladislav Zezula for the awesome StormLib and thanks to all those that contribute to the WoWDev wiki. I've also patched the definitions together for various sources across the internet, there are too many to name, but thanks to all.

Change Log:

V 1.0.1
The following things have been changed/added:


After some advice from Marlamin, Schlumpf and Amaroth I'm going to put the source on git in the coming week so that others can contribute and make this program better!

V 1.0.2

The following things have been changed/added:


A big thanks to UncleChristiof and Skarn for ideas, bugs and usability issues!

V 1.0.3

The following things have been changed/added:

The following things have been changed/added:

The application now runs as a single instance when launched in GUI mode. This means any files opened thereafter are sent to the running instance instead of opening the application multiple times. In certain situations this is not ideal, so a button has been added to the Load Definition screen which will open a new instance of the application for all files waiting to be loaded.

A range of command line arguments have been added (this is still early stages). This is the beginning of providing an interface so tasks can be automated/invoked via batch scripts and external programs.
Commands currently include (see the help file for more information):

Thanks to Luzifix for helping with development

(http://www.model-changing.net/uploads/monthly_2016_08/DataGrid.png.0ff1a631ca1d75922a013a9040cb4e89.png)

X-Post to other site: http://www.model-changing.net/files/file/82-wdbx-editor/
Title: Re: [TOOL] WDBX Editor
Post by: Uthil on August 14, 2016, 07:51:30 pm
Great tool, going to test and see differences from the old classic MyDBC. Keep it up.
Title: Re: [TOOL] WDBX Editor
Post by: Marlamin on August 16, 2016, 12:34:15 pm
I hope you consider open sourcing this. Too many amazing tools like this one have been abandoned and eventually lost to format changes.
Title: Re: [TOOL] WDBX Editor
Post by: barncastle on August 16, 2016, 08:10:27 pm
Quote from: "Marlamin"
I hope you consider open sourcing this. Too many amazing tools like this one have been abandoned and eventually lost to format changes.

Thanks for the compliment! My long term goal is to release the source although this will be after I've finished tinkering and provided it turns out to be a worthwhile tool (haven't had much too much feedback yet) as it needs a bit of refactoring.

That being said; if you do use it and notice any issues, sticking points or missing features let me know!
Title: Re: [TOOL] WDBX Editor
Post by: schlumpf on August 16, 2016, 08:22:05 pm
Quote from: "barncastle"
Thanks for the compliment! My long term goal is to release the source although this will be after I've finished tinkering and provided it turns out to be a worthwhile tool (haven't had much too much feedback yet) as it needs a bit of refactoring.

Just on a side note: There rarely, if ever, was anything coming out of refactoring and making code nice before releasing it. In my experience, pushing earlier is better. Even if people don't fork it or anything, there might still be those reading the code, giving helpful comments and such.
Title: Re: [TOOL] WDBX Editor
Post by: Amaroth on August 16, 2016, 09:13:49 pm
^^^ this.
Title: Re: [TOOL] WDBX Editor
Post by: Luzifix on August 22, 2016, 04:38:41 pm
Really good job
Title: Re: [TOOL] WDBX Editor
Post by: Nupper on August 23, 2016, 10:04:01 pm
Code: [Select]
F:GamesWoW DC DevelopmentDataPatch-7.MPQDBFilesClientCreatureDisplayInfo.dbc : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
F:GamesWoW DC DevelopmentDataPatch-7.MPQDBFilesClientMap.dbc : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Title: Re: [TOOL] WDBX Editor
Post by: barncastle on August 24, 2016, 12:09:53 pm
Quote from: "Nupper"
Code: [Select]
F:GamesWoW DC DevelopmentDataPatch-7.MPQDBFilesClientCreatureDisplayInfo.dbc : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
F:GamesWoW DC DevelopmentDataPatch-7.MPQDBFilesClientMap.dbc : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Either you have duplicate Ids in your DBC files or the definition has the Id field in the wrong position. Without more info I can't pinpoint this exactly however I'd suggest starting with the definitions; since these are DBC files the Id column should always be the first field.
Title: Re: [TOOL] WDBX Editor
Post by: Alastor on August 24, 2016, 10:38:06 pm
just little add

i hope you didnt used unsigned variables for columns its rare but i rofled hard when i find out various DBC editors faling only because Spell.dbc is using negative values too :D ( for example energy type -2 is your HPs if i remember correctly )
Title: Re: [TOOL] WDBX Editor
Post by: Nupper on August 31, 2016, 07:43:48 am
Known Database Issue
SQL Error (1364): Field "M_lang_enGB" Doesn't have a default value
Its like that with all with no Default value
Title: Re: [TOOL] WDBX Editor
Post by: barncastle on August 31, 2016, 03:03:09 pm
Quote from: "Nupper"
Known Database Issue
SQL Error (1364): Field "M_lang_enGB" Doesn't have a default value
Its like that with all with no Default value

Thanks for reporting this, it sounds like you've got your MySQL server in STRICT which enforces these kinds of policies. I'll update the program when I get a chance to default strings to a non-null character.
Title: Re: [TOOL] WDBX Editor
Post by: Nupper on August 31, 2016, 06:19:47 pm
Quote from: "barncastle"
Quote from: "Nupper"
Known Database Issue
SQL Error (1364): Field "M_lang_enGB" Doesn't have a default value
Its like that with all with no Default value

Thanks for reporting this, it sounds like you've got your MySQL server in STRICT which enforces these kinds of policies. I'll update the program when I get a chance to default strings to a non-null character.
How would i disable the strict for Non-Null Characters in mysql
Title: Re: [TOOL] WDBX Editor
Post by: barncastle on August 31, 2016, 10:30:16 pm
Quote from: "Nupper"
How would i disable the strict for Non-Null Characters in mysql

If you run
Code: [Select]
select @@sql_mode; it will tell you what mode your engine is running in. Apparently STRICT_TRANS_TABLES is the default now so I'd suggest just updating any text columns to have a default of an empty string literal.

I don't know how many fields you need to alter but the below will generate the SQL needed to bulk update them all for you, obviously replace <table_name> with your table's name.
Code: [Select]
SELECT GROUP_CONCAT(CONCAT('ALTER TABLE ','<table_name>',' ALTER COLUMN `',COLUMN_NAME,'`  SET DEFAULT '''';') SEPARATOR ' ') FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '<table_name>' AND DATA_TYPE = 'text';

I've pushed a fix for this to the git repo, I'd be grateful if you had a chance to test it works.
Title: Re: [TOOL] WDBX Editor
Post by: Nupper on September 05, 2016, 07:52:30 pm
is there a compiled update...my visual studieo is to old for it i think.
Title: Re: [TOOL] WDBX Editor
Post by: barncastle on September 06, 2016, 09:01:27 pm
Quote from: "Nupper"
is there a compiled update...my visual studieo is to old for it i think.

Yeah sorry I need to sort my git management out! I've created a release on the master branch https://github.com/barncastle/WDBXEditor/releases/tag/1.0.2
Title: Re: [TOOL] WDBX Editor
Post by: Nupper on September 06, 2016, 11:59:27 pm
Quote from: "barncastle"
Quote from: "Nupper"
is there a compiled update...my visual studieo is to old for it i think.

Yeah sorry I need to sort my git management out! I've created a release on the master branch https://github.com/barncastle/WDBXEditor/releases/tag/1.0.2

Known issue with Certain DBC
CreatureModeldata.dbc
GameObjectDisplayInfo.dbc

the  is removed upon import or export..
Example:
Default:
WorldCreatureCreatureNameCreaturename.m2
Exported/Imported:
WorldCreatureCreatureNameCreaturename.m2

Gameobjects have the same issue.
Title: Re: [TOOL] WDBX Editor
Post by: Nupper on September 07, 2016, 01:16:29 am
I get "An error occured exporting to SQL"

Default Value issue again
Title: Re: [TOOL] WDBX Editor
Post by: barncastle on September 10, 2016, 02:17:41 pm
Nupper, latest version has gone up. I've added a lot of stuff to the SQL Import/Export to try and combat your issues. I've even changed it to temporarily switch the sql mode. Let me know how it goes
Title: Re: [TOOL] WDBX Editor
Post by: Chase on October 22, 2016, 02:19:39 am
When you open a dbc with "n" in it, it turns it into the new line character, but does not export it back to "n"
Title: Re: [TOOL] WDBX Editor
Post by: jesper54321 on December 05, 2016, 07:35:45 am
Would there be any way to increase the difinition size, as my main work is in db2 files used for a large cata realm with alot of stuff? :)
Title: Re: [TOOL] WDBX Editor
Post by: Kobiesan on May 27, 2017, 02:41:25 am
For anyone else who couldn't get this to build, make sure you build it in Visual Studio 2015.