Apex GP - Assetto Corsa track importer, version 1.0.0

Convert an Assetto Corsa track mod into an Apex GP track mod on your computer.
The converter measures the road's centreline, width and elevation, calculates
a racing line for Apex GP and can export static trackside scenery. This release
accepts track layouts only. Car mods are outside its scope.


LICENCE AND PRIVATE USE

The converter ships no Assetto Corsa content and no converted geometry.
You must own Assetto Corsa and the mod you convert, and have permission to
convert it for your own use. Converted output is for private use only. It is
marked "publishable": false in provenance.json and, when present, scenery.json.
Do not redistribute it. The download packager refuses to package scenery/.


WHAT YOU NEED

  * Extract the whole zip into a folder you can write to. On Windows you can
    use a short path such as C:\apexgp-ac-import.
  * Install Python 3.9 or newer with venv and pip. On Windows the installer
    from python.org can add python.exe to PATH.
  * On first run the launcher installs NumPy and SciPy from requirements.txt
    into .venv beside the launcher. Connect to the internet for setup.
    Later conversions work offline.
  * Locate the track on disk. For a single layout, use the track folder. At a
    multi-layout venue, use the subfolder that holds ai/fast_lane.ai. Leave
    the track's .kn5 files and models configuration in their original places.


CONVERT YOUR FIRST TRACK

Open a terminal in the extracted converter folder. These examples assume the
assettocorsa folder sits beside it and the track is named my_track. Replace
the quoted path with your track or layout folder, keeping the quotes.

  Linux or macOS
      sh ./run.sh "../assettocorsa/content/tracks/my_track" --report

  Windows (Command Prompt or PowerShell)
      .\run.bat "..\assettocorsa\content\tracks\my_track" --report

On Windows you can also drag the layout folder onto run.bat. Starting the
launcher without a folder prompts you for one. With --report you see the
chosen source route, lap length, road checks and, when enabled, scenery
counts. On success the launcher prints the line below, followed by the full path.

      Done. The track mod is the folder

The example writes out/my_track/ beside the launcher. The folder holds
mod.json (what the game loads), track.json (the playable road) and
provenance.json (source, measurements and private-use marker). With scenery
enabled you also get scenery.json and numbered scenery/*.glb files with
embedded textures. If the road fails validation, the report identifies the
problem and the converter leaves the previous output in place.

  Options, added after the track path
      --id <id>                Set the mod ID and default output folder name.
      --name "<name>"          Set the display name in Apex GP.
      --out <folder>           Write directly into this mod folder.
      --no-scenery             Write the road only. The mesh route enables
                               scenery by default.
      --scenery                Request scenery on the ai or kn5 route too.
      --scenery-kinds bridge,fence,pit   Select which kinds to include.
      --scenery-lod auto       Select a level of detail (auto, 0, 1, 2 or coarsest).
      --scenery-budget 500000  Set the triangle budget, or use 0 for unlimited.
      --help                   List all options.


PUT IT IN THE GAME

Copy the whole my_track folder into Apex GP's mods folder so you have
mods/my_track/mod.json, then restart the game.

      Windows   %APPDATA%\apexgp\mods
      macOS     ~/Library/Application Support/apexgp/mods
      Linux     ~/.local/share/apexgp/mods (or $XDG_DATA_HOME/apexgp/mods)
      Android   /storage/emulated/0/Android/data/dev.phil.apexgp/files/mods

Device installation guide   https://apexgp.racing/mods/


KNOWN LIMITS

  * The full mesh route needs a .kn5 file with a usable road mesh and an
    ai/fast_lane.ai spline. Without a usable road mesh, the ai route estimates
    the road from the spline. With a suitable KN5 road ribbon alone, the kn5
    route can use its edges. The report identifies the route used.
  * Barrier fitting needs geometry from before the corridor cull. A fresh
    conversion measures source rails in the KN5. Re-fitting from exported
    scenery reads the pre-cull GLBs, because the cull removes some faces.
  * The fitted corridor is capped at 25 m of runoff beyond the kerb on each
    side. A more distant rail can be recorded even where the playable runoff
    stops at that cap.
  * Scenery is visual only. Apex GP builds its own colliding barriers. The
    playable road has a single width, with no banking or drivable pit lane.
    Apex GP drivers use their own racing line.
  * Scenery textures are embedded at up to 1024 px. Unsupported textures use
    the material colour or a plain normal. If scenery exceeds the triangle
    budget, the converter lowers detail and drops distant chunks first.
    The report shows how much protected geometry was kept beyond the budget.


IF SOMETHING GOES WRONG

Look beside the launcher for setup.log (first-run setup) or error.log (a
conversion error). To rebuild the private environment, delete .venv and run
the launcher again. To use your own Python environment, install the packages
in requirements.txt there first and set AC_IMPORT_NO_VENV=1.
