Hyperjump Route Planner

Post Reply
clausimu
Posts: 111
Joined: Tue Jan 06, 2015 8:31 pm

Hyperjump Route Planner

Post by clausimu »

First of all - the route planner is terrific! A really fantastic addition to the game.

There are just a few things that may need some tweaking:

1) Show a process bar or something while the calculation is processing. I just planned a route from Epsilon Eridani to the home of the Haber Corporation. About 200 ly of travel distance. Pioneer froze up completely for a little more than 10 minutes until the calculation was done. If I didn't expect that I would have closed the game and complained about a game freeze/crash.

2) A way to save your planned routes. If I have to invest significant time into calculating these routes - there should be a way to save them for later. I just planned a route, saved the game, restarted and loaded the game - route was gone.

Just a few observations. Again - not to tear apart a great addition to the game.
The-EG
Posts: 17
Joined: Sun Dec 03, 2017 3:48 pm

Re: Hyperjump Route Planner

Post by The-EG »

Thanks!
There will be some changes in the future, but I'm happy to see it out there and getting some usage.

1. Unfortunately, it is slow for automatically building long routes. In the short term, it may be good to add a warning that long routes can take a long time, but eventually a progress bar or an animation of some sort would be best. It may be possible to speed it up as well.
2. Saving favorites or preset is also on the list. The original PR has some additional things listed that I want to address.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Hyperjump Route Planner

Post by FluffyFreak »

A *LOT* of the speed problem is that it's having to generate all of those sectors along the way. So the first thing to do might be to reduce in some way the number that it has to consider overall.

I'm just having a look into how it works now :)
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Hyperjump Route Planner

Post by FluffyFreak »

Also we can make the check a lot more local when it goes comparing system<>system to calculate duration.
I think it needs some intermediate spatial data structure.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Hyperjump Route Planner

Post by FluffyFreak »

Hmm, part of the problem is our ludicrous hyperspace range.
The default starting ship for Earth can jump 74lyrs for example.
The-EG
Posts: 17
Joined: Sun Dec 03, 2017 3:48 pm

Re: Hyperjump Route Planner

Post by The-EG »

FluffyFreak wrote: Fri Jan 19, 2018 6:43 pm Also we can make the check a lot more local when it goes comparing system<>system to calculate duration.
I think it needs some intermediate spatial data structure.
In that regard, there are a few issues that I see hitting performance:
1. There's not really a network, so it's built in the fly. Part of the reason is that everything is really connected to everything, so storing all those edges wouldn't really be feasible. Maybe something could be built into the existing sector cache that would calculate and store distances to nearby systems...
2. Another reason it's built on the fly: the duration calculation is in Lua and could be changed by a mod, so it can't be hard coded and has to be calculated (in some form) when building the route. Joonicks suggested a caching scheme that might help but I'm not positive it's all around calculating the duration (ie #1 & 3).
3. Because of #1, there isn't a set of starting nodes. The list is currently built (more or less) by buffering the start and target by the distance between them and including the systems that lie in the intersecting region. Pairing down this initial node lost should have a good boost to performance, with the risk of excluding valid nodes.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Hyperjump Route Planner

Post by FluffyFreak »

I've figured out a few little optimisations, one that gets it's to skip the calls to GetSector(v) 13502994 times (for a system 96 lyrs away) makes a nice difference.

Still there seems to be no way of avoiding generating a Sector, a lot of sectors for long routes. Instead of taking a huge cube I'm going to try taking a cylinder of sectors between the start and end, see if I can make that work.
impaktor
Posts: 994
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: Hyperjump Route Planner

Post by impaktor »

Maybe something could be built into the existing sector cache that would calculate and store distances to nearby systems...
I've been thinking about this when pondering how to implement a dynamic economy, where prices of each system would depend on prices of nearby systems. Funny we've converged on the same though for two different, unrelated, problems.
Post Reply