-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash during timewarp at space center #1628
Comments
I also am getting this running Windows 7 on a PC. Only at KSC, when in the flight screen I can warp without a crash. Crash happens after approx 20 days of warp. Mods from the post above which I also have are |
@KSPjohnFX: Could you please give us your logs? We'll need them to debug and figure out if this is the same issue. See the FAQ for details. |
@aw1621107: I have been able to reproduce the crash. Thanks for the journal, it made my life much easier. The immediate cause is that we have a stack overflow when trying to downsample the history. This needs to be fixed by writing the downsampling code iteratively instead of recursively, but that's not the crux of the problem. The crux of the problem is that we have a trajectory where the positions and the velocities are not consistent, so the Hermite interpolation yields large errors. I have no idea how this could happen, so more analysis will be needed. |
I sat in the tracking center and tried increasing the timewarp rate in various ways. Unfortunately, I get 2 to 4 frames per second in the tracking center, so the changes were quite rapid.
Max timewarp rate is 100'000x, because BetterTimeWarp likes to reset RSS timewarp rates to that of stock for some reason. |
Here is my journal from a crashed game. I do not have the save that was regularly crashing as I have found the game pretty stable when warping in the flight screen. I can recreate a save or any particular logs you ask for though. EDIT : Just to let you know, I do not have bettertimewarp installed. |
We now believe that the problem comes from the Adams-Moulton integrator used to compute the velocities. The positions are integrated using a Quinlan integrator, and then, from the accelerations, the velocities are computed using an Adams-Moulton integrator. Most of the time this works fine, but when the vessel gets close to a singularity both integrators misbehave (e.g., they don't conserve energy) which is expected. However, they misbehave in different ways, so the velocities and the positions end up inconsistent, even once the vessel has moved far away from the singularity: the velocity is mostly unrelated to the change in position. Trying to fit Hermite polynomials to the positions and velocities result in "squiggly" polynomials and downsampling fails. We got "lucky" that the downsampling algorithm was stupidly written recursively, otherwise we would probably never had noticed this. |
@KSPjohnFX: your journal seems to exhibit the same bug as @aw1621107's. |
Glad to have provided helpful data. Hope the solution is relatively easy for you. Very handy that Principia makes it's own journals. |
Unfortunately, as we dig deeper into the issue, properly fixing it seems to be horrendously complicated. We are going to give it precedence, because we understand it's a real pain for users, but it's likely to take several weeks. |
Ouch. Maybe advise users in the meantime to only warp when in flight to stop more reports flooding the forum thread? Thank you very very much for the work you are about to put in for free on a mod for a game I play. I only wish I knew more about the language KSP mods are coded in so I could help. |
So another problem is that, when the vessel goes close to a singularity, the integrator is no longer symplectic and doesn't conserve energy, typically resulting in ridiculous accelerations. Furthermore, the integrator, being multistep, starts having wild oscillations that result in wild variation of the velocity. The proper fix is to detect that we are moving too close to a singularity (because we are inside a celestial) and delete the vessel. I have started some work towards this (#1640). (You'd hope that KSP would do this detection, but no, if you warp fast enough through a celestial everything is cool.) |
Steps to reproduce:
Save: https://www.dropbox.com/sh/wh6qo46lbns39wn/AABZwWk_yUmXdgiy0qrWnjpQa?dl=0
Journal: https://www.dropbox.com/s/lxiyuhyn9gztzpq/JOURNAL.20171122-074220?dl=0
Required mods (as far as I can remember):
Trimmed down part from macOS diagnostic report:
Unfortunately, nothing is recorded in Player.log, nor stderr.log.
BetterTimeWarp is present, but I didn't have to interact with it for the crash. It sets the RSS timewarp rates back to stock rates for whatever reason, though, so idk if that has an impact
The text was updated successfully, but these errors were encountered: