Page 1 of 5 12345 LastLast
Results 1 to 20 of 81

Thread: EDB validator

  1. #1
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default EDB validator

    Current version is 1.2.8 (Oct 16, 2012)

    Download link: http://www.twcenter.net/forums/downl...o=file&id=2559

    Checks EDB for:

    - possible syntax errors (too many to list here)
    - invalid unit type references
    - invalid faction/culture names
    - invalid religious belief references
    - invalid hidden_resource references (also checks to make sure the limit on the number of hidden resources has not been exceeded)
    - references to non-existent buildings/building levels

    How to use:

    Requires Java 6 or later runtime environment to be installed on your box. If you don't have it,
    you can download it here: http://java.sun.com/javase/downloads/index.jsp

    1. Double-click on the "EDB Validator 64" shortcut to start the program

    Note: You may have to adjust the 'Target' line in the properties of the shortcut
    - open the properties of the shortcut by right clicking it and choosing 'properties'
    - use the search option of your system to search for javaw.exe file
    - copy the path you find over the original entry, should the path have spaces in it then enclose it in quotation marks, example:
    "D:\Programs\java 7\bin\javaw.exe" -cp classes checkEDB.EDBValidator
    - Click 'apply' and then 'ok' - the shortcut is ready for use

    2. Select which game the mod is for (RTW/BI/Alex or M2TW/Kingdoms) and configure options (check boxes)

    3. Click on the "..." button, browse to the location of your mod, and select it.

    4. Click on Validate

    Assumptions:

    - The validator assumes agent types have not been modified (in other words, vanilla types are hard-coded).

    Notes:

    - Plugins validation is not supported. All plugin defitions will be skipped and won't be included in the "Generate prettified EDB" output.
    - Faction and cultures types are cross-checked with descr_sm_factions.txt and descr_cultures.txt
    - Unit types are cross-checked with EDU
    - Checks export_buildings.txt: for buildings, it checks for {id_name}. For levels, checks for {id}, {id_desc}, and {id_desc_short}
    - (RTW) Religious beliefs are checked against those listed in descr_beliefs.txt, if found. If not found, assumes that vanilla religious
    beliefs are used and checks against those.
    - (MTW2) Religions are checked against descr_religions.txt

    Files the program reads:

    - text\export_buildings.txt
    - export_descr_buildings.txt
    - export_descr_unit.txt
    - descr_cultures.txt
    - descr_sm_factions.txt
    - descr_beliefs.txt (RTW, if present) / descr_religions.txt (MTW2)

    Other than EDB itself, these files are not parsed completely, but are only quick-scanned for lines containing ids.

    To-do list for future versions:

    - Cross-check agent types with descr_characters.txt

    What this validator does NOT check (other than what's on the to-do list):

    - loops in building levels, i.e. upgrade paths that form a loop
    - unit ownership (use RedFox's validator for that, though: http://www.twcenter.net/forums/showthread.php?t=247668)
    - presence/absence of building cards
    - references to normal, non-hidden resources
    - syntax errors in files other the EDB
    - for MTW2, it does not check event_type references against descr_events.txt

    Change history:

    v1.2.8
    - Added a shortcut for the default location of java.exe on 64-bit system

    v1.2.7
    - Changed program locale settings to English. This fixes floating point number parsing (for example, in M2TW recruit_pool
    capability lines) for users whose computers' default locate is set to use something other than dot for decimal separator.

    v1.2.6
    - Added support for weapon_artillery_mechanical capability type for M2TW

    v1.2.5
    - Fixed a bug with parsing descr_sm_factions.txt and descr_cultures.txt when faction/culture id is immediately followed by a semicolon
    - (M2TW) Added support for a few building capabilities that I previously wasn't aware of

    v1.2.4
    - When a plugin definition is detected, will give a warning and skip over it, rather than abort with error.

    v1.2.3
    - Interface clean-up
    - Minor bug fix in handling intermixed delimiters (both tabs and spaces) when set not to report tabs as errors
    - Now will remember last used settings when you restart the program (settings are saved when you run a validation)
    - Now works with RS2-like folder structure

    v1.2.2
    - When reporting errors found in export_buildings.txt, show that the error is in that file rather than in EDB
    - Added an optional check for tabs. When enabled, leading/trailing tabs are still considered ok, but tab in the middle of the line are flagged as errors
    - Added a check to catch the use of building_present/building_present_min_level requirement condition in recruit capability lines (known cause of CTDs)

    v1.2.1
    - Fixed the requires port condition. It was already defined as a requirement type, but wasn't being checked for when parsing requirements. Reported by MasterOfNone.
    - Fixed the max number of buildings in EDB to be 128 for MTW2. Reported by Augustus Lucifer.

    v1.2.0
    - Added support for validating MTW2 EDB

    v1.1.1
    - Fixed a bug that caused an error to be reported when EDB has exactly 64 hidden resources

    v1.1.0
    - Added code to detect references to non-existent buildings/building levels
    - If there is no descr_cultures.txt in the modfolder, will look for it in the vanilla folder
    - Minor UI tweaks

    v1.0.4
    - Added a check to make sure the maximum allowed number of hidden resources (i.e. 64) has not been exceeded
    - Added detection of references to non-existent hidden resources

    v1.0.3
    - Now checks references to religious beliefs against those listed in descr_beliefs.txt (previously only worked with vanilla religions).

    v1.0.2
    - Replaced checkEDB.bat with a shortcut, so now you'll get no DOS pop-up window in the background when starting the program.
    - Fixed a bug in the "Generate prettified EDB" functionality where the generated output missed requirements for all but the very first building level. Thanks to Redfox for spotting this one.

    v1.0.1
    - Fixed a bug that caused an error to be reported if there was a comment
    at the end of the line. Thanks to dvk901 for reporting it.

    v1
    - Original public release
    Last edited by Gigantus; August 19, 2023 at 12:34 PM. Reason: Shortcut properties stuff
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  2. #2
    MasterOfNone's Avatar RTW Modder 2004-2015
    Join Date
    May 2005
    Location
    England
    Posts
    16,707

    Default Re: EDB validator

    Superb stuff, HoH - I've added it to the list of tools at the bottom of the EDB Guide: http://forums.totalwar.org/vb/showthread.php?p=837957

    I tried it myself and found an error (just 1!) in an edb I am working on - it stemmed from vanilla I believe but had I used the building in a certain way (which I didn't - thus it was never an issue) it would have caused a CTD. Corrected it just to be safe!

    Thanks again.
    "One of the most sophisticated Total War mods ever developed..."
    The Fourth Age: Total War - The Dominion of Men

  3. #3

    Default Re: EDB validator

    Very useful!!

  4. #4

    Default Re: EDB validator

    Excellent tool, HouseOfHam. I like the "Generate prettified EDB" feature. I have one complaint though: the program stops on the first error making it rather time consuming to look through one's whole EDB file at times.

    Also, could you make the validator check for tabs? They cause problems in EDB, if you didn't know already. Source

    Expand your borders, a mod based on XGM 5.

  5. #5
    MasterOfNone's Avatar RTW Modder 2004-2015
    Join Date
    May 2005
    Location
    England
    Posts
    16,707

    Default Re: EDB validator

    Excellent tool, HouseOfHam. I like the "Generate prettified EDB" feature. I have one complaint though: the program stops on the first error making it rather time consuming to look through one's whole EDB file at times.
    There's a simple answer to that
    "One of the most sophisticated Total War mods ever developed..."
    The Fourth Age: Total War - The Dominion of Men

  6. #6
    Ramashan's Avatar Artifex
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    4,991

    Default Re: EDB validator

    I look forward to trying this tool out. It may not solve my current problem, but at least it will make sure I'm doing everything OK. Great addition to the tools HOH!
    Under the Patronage of Lord Condormanius

  7. #7

    Default Re: EDB validator

    Quote Originally Posted by MasterOfNone View Post
    There's a simple answer to that
    I hope you mean besides fixing up one's EDB.

    Seriously though, I think it is an excellent tool, and I just wanted to offer a suggestion to improve it.

    Expand your borders, a mod based on XGM 5.

  8. #8

    Default Re: EDB validator

    Great stuff HoH !

  9. #9
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    Posted v1.0.1 with a small bugfix.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  10. #10
    Ramashan's Avatar Artifex
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    4,991

    Default Re: EDB validator

    Great tool HOH. Found only three errors, but I probably would have never come across them myself without serious picking through the EDB.
    Under the Patronage of Lord Condormanius

  11. #11

  12. #12
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: EDB validator

    It's an useful tool, but the biggest drawback is the bulky interface and no repeat list for errors (just have the code jump back to the start of the check-loop mechanism after it detects an error).
    Also, the "prettify edb" command removes all of the building 'requires factions' conditionals after level 1, making it sort of useless.

    It helped to find a few ',}' bugs though, so if you improve the interface (no console in background) and add an unit ownership checker, this tool would be quite the bomb.

  13. #13
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    Hey, Redfox, thanks for posting your feedback.

    The DOS box in the background pops up because I used a batch file to start the actual java program. The thing is that java programs are not .exe's, so you can't start them directly. I'll replace the batch file with a shortcut in the next version. As a workaround for the current version, you can create one yourself by doing this:

    1. Go to the EDB validator folder
    2. Right-click and select New > Shortcut
    3. For the location of the item, enter %windir%\System32\javaw.exe -cp classes checkEDB.ExportDescrBuilding
    4. For the name of the shortcut, enter EDB Validator (or whatever else you'd like to call it)
    5. Click on Finish
    6. Right-click on the new shortcut, wipe out the value in the Start in: field, and click on OK to save.

    Now, you'll able to just double-click on that shortcut and there will be no DOS window.

    The issue with "prettify edb" sounds like a pretty nasty bug I missed. Thanks for reporting it. I'll look into it.

    Checking unit ownership is something I might add in the future, when I have more free time.
    Last edited by HouseOfHam; August 17, 2009 at 10:48 AM.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  14. #14
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    v1.0.2 posted.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  15. #15

    Default Re: EDB validator

    Thank you. Usefull tool.
    Although I agree the previous comments about the interface
    I have one complaint though: the program stops on the first error making it rather time consuming to look through one's whole EDB file at times.
    It's an useful tool, but the biggest drawback is the bulky interface and no repeat list for errors (just have the code jump back to the start of the check-loop mechanism after it detects an error).
    I was going to complain about the tabs causing errors, but only because I didn't know they could cause problems in EDB. It is good to know it.

  16. #16
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    If there are a lot of errors in EDB, it'll be time consuming to fix them regardless of whether they're reported all at once or one at a time. Reporting them one at a time is actually a good way to make sure you test your fix before you jump to the next one.

    Not sure what you mean by "bulky interface". What would make it less "bulky"?

    Tabs at the beginning of the line are ok, but not inside.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  17. #17
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    v1.0.3. posted.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  18. #18

    Default Re: EDB validator

    Great job !

  19. #19
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    v1.0.4 posted.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  20. #20
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: EDB validator

    v1.1.0 posted.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

Page 1 of 5 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •