Coder Social home page Coder Social logo

otv's Introduction

Ortho4XP Tile Validator

Have you:

  • Built dozens if not hundreds of Ortho4XP tiles, but now get mysterious crashes when scenery tries to load?
  • Had your Ortho4XP process crash during the night and don't know which tiles completed successfully?

I have. So I wrote a utility to scan through all the Ortho4XP tiles and validate them, reporting any tiles that have errors so I can fix them in Ortho4XP.

Installation

If you already have Python(v3) installed and working, you can use pip3 to install:

$ pip3 install otv

Otherwise, head over to GitHub or PyPi and download the latest release.

Getting Started

There are three ways to run the program:

  1. If you installed via the pip3 installer, you'll have an executable named otv available, so you should be able to:

    1. cd into your Ortho4XP directory
    2. run otv
  2. Download the latest release from PyPi or GitHub and extract it into a folder. From the command line, run:

    python3 bin/otv YourOrtho4XPdir
    

    (Obviously; change "YourOrtho4XPdir" to wherever you've stored your Ortho Tiles)

  3. If you're on windows, and prefer an EXE, download the latest release from GitHub or PyPi, then:

    1. Extract the package (anywhere on your filesystem)
    2. Create a shortcut from bin/otv.exe on your desktop (must be a shortcut).
    3. Go to the Properties of the shortcut and change the "Start In" field to point to your Ortho4XP directory.

    Then you can simply double click the shortcut to run the utility anytime.

More Info

  • Running otv without any additional arguments will give you a help message:

    usage: Ortho4XP Tile Validator [-q | -v] [-p | --no-pause] [--no-progress]
                                   [-h] [--version]
                                   [tile_directory]
    
    Scan all Ortho4XP Tiles and report any problems
    
    positional arguments:
      tile_directory     Directory where Tiles are stored (usually your Ortho4XP
                         dir) - If not provided; will use the current directory
    
    display output:
      -q, --quiet        Suppresses all output; exit value indicates errors found
      -v, -V, --verbose  Increase verbosity (repeat to increase verbosity more)
    
    alter defaults:
      -p, -P, --pause    Pause the program before exiting (default for Windows)
      --no-pause         Disable auto-pause
      --no-progress      Disables the progress bar display
    
    help and information:
      -h, --help         show this help message and exit
      --version          show program's version number and exit
    
  • Currently, it checks for things like:

    • missing or empty data directories (Earth Nav Data, Terrain, Textures)
    • missing references to textures from each terrain file
    • textures which exist but aren't referenced from a terrain
  • You can find the pip page on PyPi and the source code on GitHub (both provide package downloads)

OTV is currently in beta, so if you're interested, please try it out and let me know how it works for you. I would appreciate any feedback and/or bug reports.

Known Issues

  • On Windows, the utility will pause after each run, even if running from a command line. This is done because most Windows users will be running the util from a Shortcut, so the pause is necessary without having to specifically add it. You can use the --no-pause option to disable this functionality

otv's People

Contributors

dyoung522 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

otv's Issues

earth nav data not found due to being case sensitive

OS: Linux
Ortho4XP 1.3 creates directories called 'Earth nav data' with capital 'E'
otv looks for 'earth nav data' lowercase, failing to find the directory on Linux that is a case sensitive OS.

Propose solution: Ignore the case for any combination of capitals that is legal with x-plane.
thanks for the work.

Store a list of previously passed tiles

To speed up tests, we should only check tiles which have not previously passed validation (i.e. new or failed).

To this end, we should probably keep a database of tiles which have passed validation. Once a tile has passed, it's not likely to have changed.

Additionally, we should:

  • store the tile creation date, and if it's changed, re-run the check (re-built tiles)
  • provide an option to re-run all checks.

Possible ways to accomplish this:

  • create a sqlite database to hold the data
  • store a semaphore file in each tile directory

false positives on missing texture files

Thanks, it works now but it gives wrong results on my system. It seems it reports a problem with ALL of my .ter files and textures (69'576 errors) but I wasn't able to confirm this for any of the errors I investigated further manually (tried this on 3 occasions where .ter files were said to not reference a texture - but they do and the scenery loads okay in XP).

Most errors are of the form "Terrain *.ter does not reference any Textures".

The only errors that I can confirm were reported correctly are those about missing directories.

Maybe an issue with path separator on Windows?

Also, I have a DECAL_LIB directive as a last line in most of my .ter files. Does it cope with that?

Write errors to an error log

At default verbosity, we should not list all errors produced -- can be quite lengthy and obscure which tiles need to be re-built.

  • We should write all errors to an error log, which the user can manually check after each run if they so desire.
  • Increased verbosity should show the errors on screen, but still write them to a log file.
  • There should be an option to provide the log path and name
  • there should be an option to skip the log creation (e.g. --no-log)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.