[Tool] FTL Error Checker

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker - v 0.962

Postby kartoFlane » Sun Sep 22, 2013 12:51 pm

Found another bug while testing for errors in Infinite Space... Updated with a fix, changelog:

Code: Select all

- version 0.96
  - Fixed another bug that would prevent the checker from parsing archives
  - Added a popup window informing the user that an error has occured, printing the stack trace to file in the checker's directory, as well as copying it to clipboard


Download: FTL Error Checker 0.962

Edit:
Just noticed that the checker uses the unreliable SWT.isLoadable() call, which may prevent the program from running on some systems. Updated with fixed 0.961 version.

Edit 2:
Fixed the popup window code being in wrong place, hence never showing up, even if a critical error occured.
Superluminal2 - a ship editor for FTL
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby kartoFlane » Thu Sep 26, 2013 12:53 pm

Fixed, corrected and improved several things, figured I might as well release them:

Code: Select all

- version 0.965
  - Fixed validation of event termination tags (<event/>, <store/>)
  - Weapons and drones with non-uppercase <type> now correctly get highlighted as erroneous
  - Improved detection of non-uppercase / lowercase blueprint names
  - Added a bit of error-proofing, cleaned up code


Download: FTL Error Checker 0.965
Superluminal2 - a ship editor for FTL
ApexMods
Posts: 41
Joined: Sun Aug 25, 2013 12:58 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby ApexMods » Thu Sep 26, 2013 2:58 pm

Many(!) thanks for creating this excellent tool, kartoFlane! With the recent update it finally works on my Mac (OS X 10.8.5, Java 1.7.0_40-b43) and I'm a very happy camper now! :D
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: [Tool] FTL Error Checker - v 0.965

Postby speedoflight » Fri Sep 27, 2013 6:13 pm

This is weird, the error-checker is not able to detect this sort of errors -> <item modify> -->> <item_modify> (the underlash missing). So i was parsing the files cuz i coudnt get an event to work, and the error checker never detected this missing underscores. I wonder if this is an isolated missing feature or there are more issues that the tool cant detect.
My currently mods / wips ->
ImageImage
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby kartoFlane » Fri Sep 27, 2013 7:00 pm

The missing underscore might be difficult to detect, simply due to the fact that the parser intentionally allows opening and closing tags to not match.

Though I guess I could keep a list of children a given blueprint/event can have, and then throw errors on children that don't match any name on that list... Crude, but would work.

And yes, there are a lot of things the program can't detect.
Since the very beggining I intended for the checker to be a "community effort" of sorts to build a database of FTL's quirks. It'll be difficult for the checker to become complete if there's no feedback on what to add, fix or remove.
Superluminal2 - a ship editor for FTL
ApexMods
Posts: 41
Joined: Sun Aug 25, 2013 12:58 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby ApexMods » Sun Sep 29, 2013 1:43 pm

Your Error Checker is a god-sent as it is, but I'll try to give some feedback on possible improvements.

  • initially the executable fell over a one-letter typo in one of the XMLs and couldn't finish parsing the rest (luckily it did report the error before giving up parsing)
  • for some reason it wrongly reports false description lengths for bomb weapons with 17-part image strips ("Mismatched frame count declared in anim and frame count in anim sheet (17 != 9)")
  • it does not recognize class="random" and class="ghost" statements for crew in blueprints.xml ("Referenced blueprint name does not exist")
  • for ships with artillery in place of cloaking (that can't have both) it reports the missing cloaking declaration as a critical error ("Player ship doesn't have a required system tag declared (missing <cloaking> system tag)")
  • some XML objects that are hard-coded or referenced across e.g. sector-specific XMLs are not recognized as linked and therefor marked as unused ("This object is not referenced from anywhere, and is not used in-game")
  • double line breaks in credits.txt are reported as layout error ("Double line break in txt layout file")
  • although you already mentioned your reasoning, but I'd still prefer missing/wrong closing tags to be reported
  • on my Mac, EC has 100% usage of one CPU core and occupies about 600MB of RAM while being idle

One thing that's obviously out of your control is the XML conversion performed by Vhati's SMM. It apparently overwrites any previous text encoding (with Windows encoding, of all horrors) and line breaks (Windows too, ZOMG), rendering the resulting XML a visual mess extremely difficult to read in EC.

Again, your tool is indispensable, even with the small hiccups mentioned above.
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby Sleeper Service » Sun Sep 29, 2013 2:10 pm

ApexMods wrote:[*]it does not recognize class="random" and class="ghost" statements for crew in blueprints.xml ("Referenced blueprint name does not exist")


Small thing: It might also not recognize the new class="traitor" class that came with last update.
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby Vhati » Sun Sep 29, 2013 4:43 pm

ApexMods wrote:One thing that's obviously out of your control is the XML conversion performed by Vhati's SMM.
  • It apparently overwrites any previous text encoding (with Windows encoding, of all horrors)
  • and line breaks (Windows too, ZOMG),
  • rendering the resulting XML a visual mess extremely difficult to read in EC.

Please elaborate.

Encoding and line endings should not have any visible effect, unless they're being read/rendered incorrectly.
The game itself requires that specific text format, and SMM converts everything to that standard.

What do you mean by "visual mess"? Just the omitted blank line between top-level tags?
If you're seeing something more severe, there's likely a bug in EC on Mac.


ApexMods wrote:although you already mentioned your reasoning, but I'd still prefer missing/wrong closing tags to be reported

SMM's Validate will catch that - because it also tries a strict parser, just to see how it complains.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby kartoFlane » Sun Sep 29, 2013 5:07 pm

Thank you, I'm glad the tool manages to serve its intended purpsoe :)

ApexMods wrote:initially the executable fell over a one-letter typo in one of the XMLs and couldn't finish parsing the rest (luckily it did report the error before giving up parsing)

It bothers me as well, but that's the way SMM's parser works, I don't really know how I'd go about correcting this. In any way, the best solution is to validate your mod with SMM's validate function, to catch typos like that, before feeding it to the checker.
ApexMods wrote:for some reason it wrongly reports false description lengths for bomb weapons with 17-part image strips ("Mismatched frame count declared in anim and frame count in anim sheet (17 != 9)")

The checker compares the number of frames declared by length= attribute in <desc> child in <anim> tags:

Code: Select all

<desc length="#" x="#" y="#"/>

and the frame count acquired by dividing width (w) by frame width (fw) of the linked <animSheet>:

Code: Select all

<animSheet name="" w="#" h="#" fw="#" fh="#">...</animSheet>

I'm not exactly positive that this is how it works, and it seems to have no effects in-game... But most anims/animsheets follow this rule *shrugs*
ApexMods wrote:it does not recognize class="random" and class="ghost" statements for crew in blueprints.xml ("Referenced blueprint name does not exist")

Whoops, I'll look into it.
ApexMods wrote:for ships with artillery in place of cloaking (that can't have both) it reports the missing cloaking declaration as a critical error ("Player ship doesn't have a required system tag declared (missing <cloaking> system tag)")

Well, actually, you can have both artillery and cloaking, it's just that the UI will break and look awful.
I don't really like having an exception to the error, by not reporting a missing <cloaking> when <artillery> is present...
ApexMods wrote:some XML objects that are hard-coded or referenced across e.g. sector-specific XMLs are not recognized as linked and therefor marked as unused ("This object is not referenced from anywhere, and is not used in-game")

I actually have a list of stuff that FTL is hardcoded to use, that the checker ignores -- though I may have missed some. As far as I'm aware, though, FTL does not use the WEAPONS_STANDARD, and similar, blueprintLists (that's why the augment list can have non-existing augments, and the game doesn't crash - it's never used)
ApexMods wrote:double line breaks in credits.txt are reported as layout error ("Double line break in txt layout file")

Whoops, I'll get that fixed
ApexMods wrote:although you already mentioned your reasoning, but I'd still prefer missing/wrong closing tags to be reported

Yeah, I don't like it either, the old parser did report mismatched closing tags -- but as Vhati said, SMM's validate should catch that
ApexMods wrote:on my Mac, EC has 100% usage of one CPU core and occupies about 600MB of RAM while being idle

Whoa. The RAM usage could be explained by the re-created XML structure that the checker uses internally to detect errors. But the CPU usage has me puzzled...

ApexMods wrote:rendering the resulting XML a visual mess extremely difficult to read in EC.

You mean, everything is on one line in the text viewer on the right side? That shouldn't be happening...
Superluminal2 - a ship editor for FTL
ApexMods
Posts: 41
Joined: Sun Aug 25, 2013 12:58 pm

Re: [Tool] FTL Error Checker - v 0.965

Postby ApexMods » Sun Sep 29, 2013 5:22 pm

Vhati wrote:Please elaborate.

Encoding and line endings should not have any visible effect, unless they're being read/rendered incorrectly.
The game itself requires that specific text format, and SMM converts everything to that standard.

What do you mean by "visual mess"? Just the omitted blank line between top-level tags?
If you're seeing something more severe, there's likely a bug in EC on Mac.


Hope I didn't offend you there, Vhati. That was not my intention. The transforming SMM does behind the curtains has no negative impact on general use at all, it's just when viewed in EC that the SMM-transformed XMLs become very hard to read.

By visual mess I mean the stripping of all multiple line breaks (and spaces ?) that turns any formatted paragraphs of code and comments(!) into one huge wall of text, e.g. when viewed in Error Checker. Admittedly, the use of non-monospaced fonts for code in EC does its part to distort the formatting.

As for encoding and newlines, IIRC I never had any issues with UTF-8 encoding and Unix LF in FTL's XML. Isn't it just the ship layout plain text files that use (require ?) archaic Windows "carriage returns"? I know it doesn't matter much, I just prefer not to use anything even remotely Windows-related, which hopefully also explains my rather sarcastic horrors and ZOMG remarks.

;)
Last edited by ApexMods on Sun Sep 29, 2013 5:36 pm, edited 1 time in total.