Hello fellow gamers or soon-to-be ones. I recently had an idea while playing Star Trek Online during the seasonal event. The event, called the Horizon Logo Festival, consists of a series of events occurring on a rotating schedule. One of these events, the Horgan Collector Event, happens every hour and a half. During this event, the objective is to collect a bunch of items scattered around the island. There are approximately 16 or 17 locations that you need to visit, and you must collect 10 artifacts.
The first thought that came to my mind was how to make this task easier and more efficient. Since this is essentially a traveling salesman problem, where you need to visit a certain number of locations with the shortest distance traveled, I decided to utilize Python to write a piece of code that would solve this problem.
I started by checking JGPT, a powerful language model, to see if it could help me with this task. I asked it to show me Python code for solving the traveling salesman problem, where it needs to visit only a subset of the nodes instead of all of them. JGPT generated some code, but it didn’t include node coordinates. So, I asked JGPT to add a simple node class with XY coordinates, and it did.
I tested the code locally and realized that when I fed it the actual coordinates from the game, it took a long time to compute the shortest route. I asked JGPT why it was taking so long, and it explained to me how the permutations work in this problem. I then asked JGPT to add a progress bar to show me how long I had to wait.
While testing the code, I found that for a specific combination of visiting 10 nodes out of the 16, it would take a long time to compute the shortest route. I asked JGPT if there were more efficient algorithms, and it suggested a couple of approximation algorithms. I asked JGPT to implement the nearest neighbor algorithm, which is faster than the previous algorithm.
I also asked JGPT to modify the algorithm so that the route doesn’t need to be a closed loop, as I can teleport back to the starting location in the game. JGPT adjusted the algorithm accordingly. However, there was an exception in the code, which JGPT helped me debug.
The result is a piece of Python code that calculates the shortest route for visiting the required locations. I can now use this code to optimize my gameplay during the Horgan Collector Event. The code generates the optimal path and the corresponding coordinates for each location.
To visualize the optimal route, I took a screenshot of the game and painted the coordinates on top of it. This allowed me to see the sequence of locations I need to visit. Now, I can simply follow this optimal route during the event and complete it faster.
I hope you found this demonstration of using JGPT and Python to optimize gameplay in Star Trek Online interesting. If you have any questions or want to see more content like this, please like, share, or subscribe to this channel. Thank you for your time and attention!