Remove Nearly Parallel Connections
The logic goes something like this:
- During final-fixes, after RSC and CSD have finished running, check each planet and space-location
- For each triplet of points, if a connection exists between all 3, check if route should be considered parallel
- Uses polar math to check length of AB + BC is roughly equal to length of AC (using LENGTH_TOLERANCE to allow some wiggle room in the length ratio)
- Uses polar math to check the angles of all three corners, checking that the two smaller angles are much smaller than the largest angle (using ANGLE_TOLERANCE to define how much larger it needs to be in relation to the smaller angles)
- Orientation around the sun for each point is used to increase the odds that a connection will be removed (greater difference is more likely to be removed, using ORIENTATION_WEIGHT to define the effect)
- If all checks passed, immediately nils the connection, removing it entirely from the game, and preventing it from affecting subsequent passes
- Respects redrawn_connections_keep on routes, preventing these from being removed, even if the connection passes all checks to be removed
LENGTH_TOLERANCE , ANGLE_TOLERANCE, and ORIENTATION_WEIGHT cannot currently be modified in-game, but this functionality should be added in future, once I figure out some safe values.
Currently, the most likely connections to be removed are inner routes from the Moshine/Vulcanus region to the Arig/Hyarion/Maraxsis area that wrap around the orbit of the sun, with another nearby planet that has connections that are visibly nearly parallel. Also some extra routes near Fulgora.
All of this depends on the mod loadout, so it may remove some connections that don't look parallel, or not remove some connections DO appear to be parallel. If the effect on your game is not desired, then you can safely disable the feature to restore all previous existing connections.
Feedback for this feature is greatly appreciated!