Making a command-line-tool to load supported files
#1
Posted 16 February 2018 - 12:41 PM
The longer term vision is mentioned in: https://trello.com/c...format-checking (blueprint https://blueprints.l...mat-diagnostics).
This topic is to discuss various aspects of this new tool. This includes your wishes and needs, and at a later stage also your feedback.
Initially it will, as said in the blueprint, accept any file format known to Open Rails and attempts to load it. The output would be all of the normal loading messages from the game (e.g. warnings from the STF parser) and a simple "OK" if it successfully reaches the end of loading. The important point here is that there should not be any new loading code: the already available code should be used since that already gives the proper warnings.
I think it should either accept a single file or a set of files using a search pattern. It should be possible to run it over a complete route and perhaps even over the complete set of files in TRAINS (at this point in time still considering mostly a single file at a time).
At a later stage it would then have an option not only to load a single file but also load, subsequently, all the files referenced in the initial file (e.g. loading an .act file would also load the referred .pat and .srv files, and I guess loading a worldfile would also lead to loading hazards, shapes, textures, ...). In the end, perhaps, it would be possible to load all files needed for a route, e.g. starting from a .trk file.
I am still looking for a good name for this tool. Do note that it is a command-line tool. So you would need to type it, possibly often. Furthemore, the long term vision is that also cross-checks between different files will be taken into account. So it is not just loading files. ContentChecker or CheckContent? FileChecker? CheckFiles? Just Check? Perhaps without capitals like check.exe or checkcontents.exe?
Any other thoughts people might already have?
Jeroen.
#2
Posted 16 February 2018 - 02:14 PM
JeroenP, on 16 February 2018 - 12:41 PM, said:
I personally favour "FileChecker" but it's not easy to name. Perhaps something like "FileValidator" or "FileVerifier" would work, but I worry that we'd be implying that our loading code is perfect when I am certain it is not.
#3
Posted 16 February 2018 - 02:36 PM
Geoff
#4
Posted 16 February 2018 - 05:45 PM
omnicheck.exe
omnichk.exe (shorter)
ORomnicheck.exe
ORomnichk.exe (shorter)
ORXcheck.exe
ORXchk.exe (shorter)
ORfileXcheck.exe X = for cross, as in cross check.
ORfileXchk.exe (shorter)
ORFXcheck.exe
ORFXchk.exe (shorter), but FX looks a bit too much like effects as in D3D FX...???!!!!
ORFileIntegrityChk.exe
I would like to see a non-cryptic but explicit name used so that a casual user will not be left scratching their head as to what this executable might do. For those of us who type at the commandline, we like super short exe names, but that is so 1980s DOS, 8.3. Either way nobody will really be happy. I suppose somebody could rename it to "orfc.exe" or "orxfc.exe".
Thank you for undertaking this task!
Steve
#5
Posted 20 February 2018 - 06:05 AM
Some .dat files are not supported yet. And I guess some openrails sub-directories are also not yet supported. Feedback is appreciated. For instance on how and where this needs to go into the Source directory. And of course whether it does what was intended.
I also added some initial documentation.
Attached File(s)
-
contentchecker.zip (22.44K)
Number of downloads: 450 -
Content checker.pdf (103.89K)
Number of downloads: 467
#6
Posted 20 February 2018 - 11:28 AM
JeroenP, on 16 February 2018 - 12:41 PM, said:
How about "lint"?
Wikipedia writes:
"A linter or lint refers to tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. The term is originated from a Unix utility that examined C language source code." It comes "from the name of the undesirable bits of fiber and fluff found in sheep's wool."
#7
Posted 21 February 2018 - 04:37 AM
cjakeman, on 20 February 2018 - 11:28 AM, said:
Wikipedia writes:
"A linter or lint refers to tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. The term is originated from a Unix utility that examined C language source code." It comes "from the name of the undesirable bits of fiber and fluff found in sheep's wool."
Yeah, I'm very Familiar with "lint" on Unix. It Sounds Like a "Lint" for OR. It would be good to search for UN-closed brackets and other dumb things like that. Or Misspelt Items. Also Probably other stupid mistakes that are sometimes hard to notice.
#8
Posted 22 February 2018 - 06:33 PM
Thanks,
Steve
#9
Posted 24 February 2018 - 11:03 PM
Simon E, on 21 February 2018 - 04:37 AM, said:
If I am not mistaken the current warnings you already get are things like un-closed brackets and other real syntax errors. So for sure, these errors are then also present in the command-line tool. But I think misspelt items are currently silently disregarded. Obviously it could be a future improvement to catch these as well. But that would then be in the second stage (and after 1.3?) because it impacts current parsing.
Furthermore, I do think that the future vision (see the Trello card for instance) contains more than just checking single-file constructs. It would check also consistency between different files (e.g. are the locations in a .pat file really present in the .tdb). Therefore, I think the name "lint" is too restrictive
Eldorado.Railroad, on 22 February 2018 - 06:33 PM, said:
I added alpha code to my post of Februari 20th. To generate code I need to check things in into SVN. I wanted to wait for some feedback, also again on the name of the project. Some people have downloaded the code. I got not feedback telling me it should be done differently, so I guess I can start checking in.
#10
Posted 24 February 2018 - 11:37 PM
The manual does say they are loaded. I suspect the manual is wrong. I did find an old post, http://www.elvastowe...rogramming-team, asking confirmation on whether these files are in fact loaded, but that confirmation never came.
Currently in the command line tool I am flagging them as 'Not used by ORTS''.
So, does anyone know for a fact that these files are loaded? Otherwise we should perhaps correct the manual.