Page 1 of 9

[Tool] FTL Error Checker

Posted: Thu Aug 08, 2013 1:02 am
by kartoFlane
.
FTL ErrorChecker - a problem detector for FTL mods

Image


About

As is commonly known, modding FTL is a pain. It's very easy to make a mistake, and unproportionately hard to find and fix it. And even if everything seems to be correct, the game still crashes, for no apparent reason.

This tool is intended to help with that.

The name gives it all away - it's a utility that parses the game's archvies and looks for errors or mistakes - both the blatant and the obscure ones - and displays them to the user, to help with debugging of installed mods.
SleeperService has been unwittingly tricked into testing this utility for me (Image), and said that it, I quote, "makes excessive modding so much more comfortable".


Download

Important: The editor requires at least Java 6 in order to run.

[ FTL ErrorChecker 0.1 Alpha ]

Source code is available at Github.


Setup

    Installation:
  • Unpack the program anywhere.

    Running:
  • Don't double-click on the .jar file. Use one of the launchers instead:
    • For Windows users:
      - Double-click on run.bat. If that doesn't work, make sure Java is installed correctly.
    • For Linux/Mac users:
      - Double-click on run.sh (Linux) or run.command (Mac)
      - If that doesn't work, open the Terminal, drag the script file onto it, and press Enter.

    Setup:
  • When running for the first time, the program will attempt to find FTL installation.
    Most of the time this should be located automatically, and you'll only be asked for confirmation,
    but in the rare case that it fails, you'll have to locate FTL installation yourself.

    How To Use:
  • Install the mod you wish to check with SMM.
  • Run the ErrorChecker (or, if it's already running, press the "refresh" button)
  • Press the "parse" button
There are some errors in FTL's vanilla files that are not your mod's fault -- you can ignore
them, they're mostly harmless. If you can't distinguish between them and those caused by your
mod, run the Checker against clean, unmodded FTL first.


Troubleshooting

In case of problems, ask here in this thread.


Database Improvements & Suggestions

If you have dabbled with the checker's scripted database and improved some of the code, or added a script that verifies some aspect of a mod, please share it -- I can't possibly know all of FTL's quirks, so all help is appreciated.

Re: [Tool] FTL Error Checker

Posted: Thu Aug 08, 2013 8:48 am
by Sleeper Service
As mentioned in the op: I tested this this thing and it is the one single reason Captains Edition runs stable now. It's pure modding gold.

Tools for event or blueprint creation have been requested some times. But I really think this tool here already does a great job with making modding more accessible and secure. No more bug tracing by endless trial and error ever again... no matter how big the mod.

Re: [Tool] FTL Error Checker

Posted: Thu Aug 08, 2013 9:57 am
by UltraMantis
Oooh, you're going to spoil us rotten :D :D

Thanks for writing this tool, error checking a sea of xml is maddening.

Re: [Tool] FTL Error Checker

Posted: Thu Aug 08, 2013 12:38 pm
by speedoflight
Nice!. This will be really really helpful for a lot of people.

1 question, is this tool able to detect mistakes in events that are not related to syntaxis or bad referenced parent lines?? for example, bad position of an event line (that will not make the game crash but the event will just not work) or a bad structure of an event (yup, this is hard to detect, but again, it will not cause the game to crash, just the event will not work, and it could affect other events, since the ftl event engine becomes crazy after that).

Re: [Tool] FTL Error Checker

Posted: Thu Aug 08, 2013 12:53 pm
by kartoFlane
speedoflight wrote:bad position of an event line (that will not make the game crash but the event will just not work) or a bad structure of an event

That's rather broad. What exactly do you mean? An example of badly structurized event?

The checker will tell if you an event if is missing a required tag, or an obligatory attribute, or when a number is negative when it's not supposed to, among some other things. Also, when an event termination tag (<store/>, <quest/>, <event/>) is not last in a nested structure.
Events referencing their ancestors (creating a loop) is not successfully implemented yet.

Re: [Tool] FTL Error Checker

Posted: Fri Sep 13, 2013 11:21 pm
by Vhati
kartoFlane wrote:New version currently in development:
  • Uses a [proper] XML parser from Vhati's SMM, which is basically as tolerant as FTL's own parser.

A proper XML parser wouldn't be tolerant...
How about "more robust", if you mean relative to the Error Checker's current parser. ;)

Re: [Tool] FTL Error Checker

Posted: Fri Sep 13, 2013 11:38 pm
by kartoFlane
Good point :lol:

Re: [Tool] FTL Error Checker

Posted: Sat Sep 14, 2013 9:14 pm
by Vhati
The non-Windows builds throw NullPointerException on startup because of the getRealArch() bug.

Re: [Tool] FTL Error Checker

Posted: Sat Sep 14, 2013 9:36 pm
by kartoFlane
Vhati wrote:The non-Windows builds throw NullPointerException on startup because of the getRealArch() bug.

Got that covered in the update I'm working on.
Currently trying to devise a way to reliably check for loops in events, and determine which blueprints are unused...

Re: [Tool] FTL Error Checker - v 0.95a

Posted: Wed Sep 18, 2013 4:21 pm
by kartoFlane
I've finally updated the checker to version 0.95. Some most significant changes:

Code: Select all

  - Internal overhaul - ported to use Vhati's SloppyXMLParser, which is basically as sensitive and tolerant as FTL's own parser
  - Added search text feature
  - Added case-sensitive flag to search window (off by default)
  - Added checking for event loops
  - Added checking for unused objects (may be imperfect)
  - Added "Previous" button to search window
  - 0x0 rooms should no longer show up as an error
  - Right-clicking on the error table opens up a popup menu, allowing you to copy the error message
  - Errors are now always listed from earliest to latest in the table


Download: FTL Error Checker 0.95a

Edit:
Unsurprisingly enough, there was a bug in original 0.95 version that would prevent the checker from parsing some modded archives. This has been fixed.