Skip to content
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

Vessels change position abruptly when using non-physical timewarp #1416

Closed
scimas opened this issue May 30, 2017 · 10 comments · Fixed by #1472
Closed

Vessels change position abruptly when using non-physical timewarp #1416

scimas opened this issue May 30, 2017 · 10 comments · Fixed by #1472
Labels
Milestone

Comments

@scimas
Copy link
Contributor

scimas commented May 30, 2017

Get 2 vessels close together, use non-physical timewarp. One or both vessels can be seen changing position abruptly by about 200 m. When you switch back to 1x timewarp, the position again changes abruptly to (presumably) where the vessel should be after the timewarp (basically looks like it subtracts the previous abrupt change.) Attaching save file in txt format where this can be verified.
Bug_report.txt

@SunScream
Copy link

Happens at relatively long range and includes both targeted and non-targeted objects.

https://github.com/SunScream/Principia-issues/blob/master/Offset_in_Timewarp.zip

@pleroy pleroy added the bug label Jun 2, 2017
@pleroy
Copy link
Member

pleroy commented Jun 5, 2017

We were able to reproduce the problem. Tracing the altitude around the time of the warp shows that KSP hesitates as to the altitude of the vessel:

E0605 16:48:35.144068  9980 interface.cpp:630] RescueShip 77664.5017526983
E0605 16:48:35.172071  9980 interface.cpp:630] RescueShip 77664.5127555303
E0605 16:48:35.206074  9980 interface.cpp:630] RescueShip 77485.1164742472
E0605 16:48:35.211076  9980 interface.cpp:630] RescueShip 77664.5356854253
E0605 16:48:35.226076  9980 interface.cpp:630] RescueShip 77485.1321253225
E0605 16:48:35.255079  9980 interface.cpp:630] RescueShip 77485.1399544015
E0605 16:48:35.284082  9980 interface.cpp:630] RescueShip 77485.1477861585
E0605 16:48:35.289083  9980 interface.cpp:630] RescueShip 77664.5797277195
E0605 16:48:35.312085  9980 interface.cpp:630] RescueShip 77485.163457879
E0605 16:48:35.342088  9980 interface.cpp:630] RescueShip 77485.1712975268
E0605 16:48:35.346088  9980 interface.cpp:630] RescueShip 77664.6127787221

The correct altitude determined by Principia is 77664.0921842906391 m. Where the ~180 m jitter comes from, we have no idea...

@scimas
Copy link
Contributor Author

scimas commented Jun 20, 2017

So I noticed something interesting yesterday. I was trying to rendezvous and dock which wasn't going so well. I started time warping, experienced the sudden shifting of position of the vessels. It looked like the vessels would crash if I didn't come out of the timewarp and decided to see what happens. They didn't crash but did come very close and passed by each other, so I came out of the warp. Now usually when I come out of time warp, both vessels jitter and it at least looks like the amount of jittering is different for both vessels; you can literally see the target vessel jumping around on screen. This time it didn't happen. The jitter was present, I could see the orbit parameters like Ap and Pe jumping by about 200m when going in and out of warp, but it was like both vessels were jumping by exactly the same amount in exactly the same direction; instead it looked like the celestial body (minmus) was jumping around by that amount.
May or may not be relevant to the bug, just seemed a different experience so decided to share.

@ToniStack
Copy link

Noticed this issue myself using RSS in conjunction; but also even when not using timewarp noticed after getting under 200 meters the game suddenly flickered the astroid as well as made another copy of one approximately 700 meters away from the original, after witch docking to claw and capture the astroid in earth orbit became impossible

@scimas
Copy link
Contributor Author

scimas commented Jul 3, 2017

Since Cauchy, when vessels come close together (close enough to switch between them using hotkeys), they change position abruptly. It looks almost exactly like this timewarp issue, so wrote here before opening a new issue.

@eggrobin
Copy link
Member

The issue was that the function used to set the position of unpacked vessels relative to celestials was using the degrees of freedom of the celestials at current_time_, but the degrees of freedom of the parts at the time passed to AdvanceParts, which is after current_time_. This resulted in an incorrect position when the vessels were unpacked (out of timewarp).
As far as I can tell (by looking at the code, I haven't tested that) this has been broken since Cardano.
This will be fixed in Cayley, to be released on the new moon, 2017-07-23.

@eggrobin
Copy link
Member

Note: that is only part of the problem; this solves the altitude of the active vessel jumping when warping, but not nearby vessels jumping when warping.

@eggrobin
Copy link
Member

Hm, it seems that the remaining problem occurs for vessels ~200 m away, but not for vessels right next to the active vessel (and regardless of warp, a jump occurs when approaching those vessels, as described by @scimas). Further investigation is needed...

@eggrobin
Copy link
Member

eggrobin commented Jul 15, 2017

The jump now seems to affect unpacked vessels, and be in the direction of their orbit (KCI frame, in a low orbit). Further, I am testing in a low orbit, whose speed is 2290 m/s, and the jump is roughly 45 m. This seems consistent with an off-by-one-frame error (2290 m/s / 50 Hz = 45.8 m).

@eggrobin
Copy link
Member

I think I know what is going on here, but that's going to have to be a separate issue, it's quite tricky.
Opening #1473 to track this separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants