"Oh, the Places You've Gone!" .. Python navigator script

Discussion in 'The Hangar Bay' started by imlarry425, Jun 3, 2021.

  1. imlarry425

    imlarry425 Captain

    Joined:
    Jan 10, 2019
    Messages:
    462
    Likes Received:
    340
    The attached work in progress script performs shortest path (Dijkstra's algorithm) navigation restricted to places you've already visited as described in the global.db SolarSystems table. In order to run you will need Python installed on your machine along with networkx, mathplotlib, apsw, and SQLite .. all these can be found on the web via Google along with install instructions.

    Operation is all command line/text; enter the path to your save file (where global.db lives), specify the range of your CV warp drive, identify which system your CV is in, and then enter a loop of entering a destination and getting the best path to it from where you are along with the pentaxid cost.

    I still have a number of things I want to add (highlighting the path, restricting the star chart to the path and its neighbors, etc) along with packaging it so that it's more friendly for the non-geek.

    It seems to be practically useful in the current form for folks who know how to run python from the command line so dumping a copy here. Comments and criticism welcome. I'll update with a link to a git project when I get around to packaging it better.

    cmd window.png
    graph.png
     

    Attached Files:

    #1
    Last edited: Jun 3, 2021
    Sup likes this.
  2. imlarry425

    imlarry425 Captain

    Joined:
    Jan 10, 2019
    Messages:
    462
    Likes Received:
    340
    If anyone would be willing to beta test I've tried to package this as a simple 64-bit exe. I'm doing a reverse engineer of the domain tables in global.db before getting to work on either putting a GUI on the front end with more functionality or packaging as a mod (clueless on what that's like/would look like) but this utility should be able to find the least expensive route to any solar system you've visited from where your CV is currently located and that's been a big pain for me.

    I realize that @ASTIC started working on something similar as a mod (see the previous navigator thread) but thanks to the guys who wrote networkx I was able to get the best path bit working and wanted to share. This tool is only useful in MP if you have read access to the game save directory on the server.
     

    Attached Files:

    #2
  3. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,120
    Likes Received:
    742
    Exactly, I have stopped further development on it since it can only travel "known" paths and star systems, but not those which are displayed on the map but not yet generated. So there can be detours or no connections at all although a path through the star system exists.

    This has frustrated me so much that I have not adapted the mod to the multistar system, although this is of course possible.
     
    #3
    imlarry425 likes this.
  4. imlarry425

    imlarry425 Captain

    Joined:
    Jan 10, 2019
    Messages:
    462
    Likes Received:
    340
    I hear you there! More than once since the big galaxy release I had taken a fairly straight course through dozens of jumps to get into another faction's sphere of influence and had a terrible time trying to find my way back. Even though the DB can only tell you the places you've been it was still better for me than trying to follow bread crumbs (read: bookmarks) back out. Since the systems are x/y/z relative to each other you can potentially find a better path (through visited systems) once you add all the potential edges assuming better ones exists.

    I can see why the devs might only want to fully instantiate stars that have been visited but it would be nice (!) if there were placeholders in SolarSystems table for everything in the stellar map. You could populate Playfields if a player actually visits- this would have the added benefit of obfuscating systems added by scenarios. A coverage "create index where" with a "HasVisited" boolean would let you add all those rows without impacting things very much other than the initialize.
     
    #4

Share This Page