Travel Options - Development Log #489

Michi talks about finally finding a long-standing bug and about the rework of the mission planning.

Avatar Michi

Michi (molp)

The work on the pathfinding and mission planning continues, see devlogs #487 and #488.

I was able to finish translating the path segments that the pathfinder generates into actual mission segments that are displayed when planning a flight. I spend quite a lot of time testing if everything still works as before and that I'm not breaking anything.

While being at it, I also looked into a long-standing bug where clicking multiple times on the fuel sliders (in the same place) would result in slightly different results. My first hunch was that something is off with the way the transit elements within systems are being calculated, but that was a dead end. I then noticed that the issue usually manifests in vastly different flight times for the departure and approach segments. To recap: departure is a transit segment from the orbit of a planet to a jump point that leads to the adjacent system. Approach is basically the same, but when arriving in a system and traveling towards the destination planet's orbit. Since departure and approach jump points should roughly have the same distance to a planet, the flight time and STL fuel consumption have to be almost equal as well.

While debugging the issue, I noticed that the maximum amount of STL fuel that can be spent for the approach segment was sometimes only half of what I would normally expect. This then results in less fuel usage, but longer flight durations. In the end, it was a floating point artifact in the calculation of the duration of the burn phases for the approach segment. Sometimes the coasting phase would come back as a tiny negative number instead of null, messing up the calculation and resulting in the bug.

I’m pretty happy that we found the issue, it has been haunting the game for a long time now. We'll deploy the bugfix with the next maintenance release, where we also plan to release the new pathfinding code.

Now that we have a proper graph to search, I tried implementing two search options: "least number of jumps" and "shortest FTL distance". For some routes, the results differ, but right now the "shortest FTL distance" seems to be the fastest and more fuel efficient route. I suspect this stems from the fact that the time ships spend charging their FTL drives is rather small in comparison to the time they spent in jumps. Anyway, here are two routes, the first one with the "least number of jumps" strategy, the second with "shortest FTL distance":

least number of jumps

shortest FTL distance

As always, we'd love to hear what you think: join us on Discord or the forums!

Happy trading!