Menu

CheckCdNotes utility script

Andrei
2019-03-19
2019-03-20
  • Andrei

    Andrei - 2019-03-19

    I've completed the codriver notes checking script. It will check the notes for unknown tokens.

    Just like CheckTex, this script it will scan for .LEVEL files in the current directory where it's run, or you can feed it directories/files by hand.

    Options:

    Option Effect
    -v enable verbosity

    Example usage (outputs omitted):

    $ ls
    bin  checkcdnotes.sh  data  doc  src
    
    $ ./checkcdnotes.sh
    $ ./checkcdnotes.sh data/maps/alignster/alignster.level
    $ ./checkcdnotes.sh data/events/01-triggercup/ --verbose
    

    I have not run it yet on Trigger Rally true data but it appeared to work correctly in tests.

    The script works quite slowly, so using --verbose is advised: it reads each line of a .LEVEL file, tries to extract notes="???" from it then checks that against standard codriver commands.

    Originally I complicated things by trying to emulate what the actual game does: scan the codriver texture/sound dirs and generate the accepted commands dynamically. Alas I was running into problems and getting nowhere with it, to the point where I started thinking it could be done more easily in C++17.

    The advantage of that "smart" version of the script would have been that it could check not only the notes, but the codrivers themselves and report exactly which codriver set couldn't accept the notes. But for now, the practical solution is the naive one, sorry. And even this one is very slow.

    As usual, I'm looking forward to your feedback, bug reports, etc.

     
  • Onsemeliot

    Onsemeliot - 2019-03-19

    Fantastic. I can't tell if it didn't find all errors but it allowed me to find errors in four maps. I updated them in [r945].

     

    Related

    Commit: [r945]

  • Andrei

    Andrei - 2019-03-20

    @Onsemeliot: nice, the fact that only 4 maps had to be corrected shows how diligent you are.

    The scripts are available in their devkit folder. I made small changes to improve code quality (for example input files are now sorted to make following progress easier) but the scripts still run as slow as snails.

    That said, the performance is not really a problem. From now on you won't need to run them for all data, just specifically for new maps you add, like so:

    $ checktex data/events/newevent/ data/maps/newmap/newmap.level
    

    Let me know if you find bugs that lead to incorrect messages.

    EDIT: re-uploaded checkscripts_20190320.zip because I found a very silly mistake in CheckCdNotes script that wasted CPU time:

    while read -r LINE
    do
        hasnotes "$LINE"
    
        if hasnotes "$LINE"
        then
    
     

    Last edit: Andrei 2019-03-20
  • Onsemeliot

    Onsemeliot - 2019-03-20

    the fact that only 4 maps had to be corrected shows how diligent you are.

    Well, you created codriver commands also and none of your maps had an error.

    Maybe my system is more powerful than yours. Less than a minute to check all maps isn't so bad from my point of view.

     
  • Andrei

    Andrei - 2019-03-20

    Less than a minute to check all maps isn't so bad from my point of view.

    One minute? I am amazed. On my system (Windows+MSYS2) it takes 30 minutes to check all maps. With the less refined version it took 35 minutes. Maybe it's because I use an emulator instead of true Linux...

     

Log in to post a comment.