Bug #1043

Time acceleration causes inaccuracy in orbit recalculation on encounter/escape

Added by voneiden over 1 year ago. Updated 12 months ago.

Status:NewStart date:07/18/2013
Priority:Low% Done:


Target version:-
Version:0.20.2 Platform:Any


The issue has existed in all versions of KSP that have implemented sphere of influence.

What happens?

When a ship changes the orbiting body of reference (encounter/escape), the orbital elements are recalculated. The exact time of encounter/escape is known by the simulation, however instead of utilizing the known time the physics engine uses the current simulation time when doing this recalculation. This means that the encounter/escape calculation is always done "later" than the actual encounter/escape happened. When under fast time warp the recalculation can happen thousands of kilometers too late which manifests into considerable error in the trajectory calculation. The faster the relative speeds, the greater the error. Most serious impacts currently are in interplanetary travel, however the error is already considerable in Kerbin-Mun travel at warps over 10000x.

How to reproduce?

1) Have an encounter with a planet/moon coming up in a few simulation hours. Note down the periapsis. Quicksave.
2) Warp near the encounter, cross the encounter point with slow time warp (max 10x). Note down the periapsis, it should closely match the above.
3) Quickload. Warp over the encounter with fast time warp (10000x or more for most visible effects). Note down periapsis if you didn't crash the planet/moon.
4) Compare periapses.

Suggested fix (rather simple)

Since the simulation already knows the exact moment when the encounter/escape should happen, save it for later referencing. When recalculating the orbit for the new parent body, use the saved time instead of current simulation time.

Temporary fix

Kerbal Alarm Clock ( http://kerbalspaceport.com/kerbal-alarm-clock-2/ ) can stop time acceleration when approaching encounter/escape.

1.png - Mun encounter, periapsis at 80 km (252 KB) voneiden, 07/18/2013 01:52 am

2.png - Encounter at 10x warp speed, everything OK (233 KB) voneiden, 07/18/2013 01:52 am

3.png - Encounter at something between 10 000-100 000 warp speed, crash course. (203 KB) voneiden, 07/18/2013 01:52 am



#2 Updated by willglynn 12 months ago

Please address this. It doesn't seem difficult to prevent the simulation from streaking through SOI boundaries at high warp and breaking carefully-crafted intercept trajectories. Veteran players drop out of warp for SOI changes out of necessity -- Scott Manley noted this just yesterday and then screwed it up -- a survival tactic new players quickly learn once they've been harmed. Fixing this issue will improve every single player's experience in every single mission beyond low Kerbin orbit.

Also available in: Atom PDF