With my hourly income going into the negatives due to bottoming out the price of ore, I’ve spent some time implementing a trading approach for the command ship so I can complete contracts that require trade goods. This required at least a lap of the markets in the system to probe the price details of each trade good. This recon went well until the final waypoint that appeared to have a market but no fuel - the ship promptly ran out of gas and I had to write code to drift to the closest waypoint with a fuel supply. After the recon was complete, contract trading appeared to work until the ship got stuck in a loop between waypoints.

On investigation it appeared the current contract required the ship to move through a distant waypoint that expended most of the fuel, and had no fuel supply. Drifting back to the nearest waypoint with fuel available executed correctly, but then the logic would push the ship back through the same distant waypoint and the cycle would repeat. I’ll need to update the navigation logic to be aware of fuel requirements and availability so the ship can buy extra fuel and store it in cargo should a route require it.

To help with this, I’ve added a Grafana panel that allows me to visualise the layout of waypoints in the system. I was unable to find a cartesian plane or similar visualisation in Grafana, so instead i’ve hacked the Geomap visualisation to achieve this. I’ve chosen an empty point in the ocean, zoomed in as far as it’ll go, and used that point as the origin. I’ve then plotted the waypoints of the system as offsets from this origin. Perhaps in the future I’ll add ship position to this panel.

waypoint layout

Source