You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The path-finding code is very slow. I think it is iterating through every StellarObject in every system once per ship for every ship in the fleet, 60 times a second.
This is most noticable when your escort fleet is 'trapped' on the other side of a Jump Drive gap without a Jump Drive.
Steps to Reproduce
Load provided game
Leave planet
press 'h' to prevent pathing and get your CPU back.
Now I am no mathmetician and I don't understand Graph Theory, so I am not best placed to solve this, but I believe we don't need to re-route every escort 60 times a second. An already-found path should suffice until the graph of known systems changes, or the Orders change, or the player or escort moves to a new system (is that the same as 'graph changes'?)
I think caching whether a system has a wormhole would be helpful too.
The text was updated successfully, but these errors were encountered:
nickshanks
added
bug
Something in the game is not behaving as intended
unconfirmed
More information is needed to be sure this report is true
labels
Jun 18, 2024
Is there an existing issue for this?
Describe the bug
The path-finding code is very slow. I think it is iterating through every StellarObject in every system once per ship for every ship in the fleet, 60 times a second.
This is most noticable when your escort fleet is 'trapped' on the other side of a Jump Drive gap without a Jump Drive.
Steps to Reproduce
press 'h' to prevent pathing and get your CPU back.
Expected Behavior
CPU usage would be 10%, not 450%
Screenshots
No response
Link to save file
Nicholas Shanks~250% CPU.txt
Nicholas Shanks~350% CPU.txt
Nicholas Shanks~450% when jumping.txt
Nicholas Shanks~also 250% CPU.txt
Operating System
MacOS X
Game Source
Built from source
Game Version
nickhanks/endless-sky/tree/master with unpushed changes
Additional Information
Commenting out code to find the cause, I traced it here:
Now I am no mathmetician and I don't understand Graph Theory, so I am not best placed to solve this, but I believe we don't need to re-route every escort 60 times a second. An already-found path should suffice until the graph of known systems changes, or the Orders change, or the player or escort moves to a new system (is that the same as 'graph changes'?)
I think caching whether a system has a wormhole would be helpful too.
The text was updated successfully, but these errors were encountered: