Bug #2349
Frozen Orbit Null Reference Exception
100%
Description
Version: 0.23.5.464 (fresh install, no mods or addons)
Description: The onset of the "frozen orbit" bug coincides with a NullReferenceException appearing in the debug menu. Once triggered, using nonphysical timewarp will freeze some spacecraft in place in their current SOI. Others will be torn apart.
The "frozen on launchpad" and "catastrophic explosion" bugs both seem to be closely related. (Refer to http://bugs.kerbalspaceprogram.com/issues/2338 - both are first triggered by a NullReferenceException and both result in nonphysical timewarp becoming seriously bugged.) However, the "frozen orbit" bug could not be reproduced via the same steps.
I've now found a reproducible set of steps to trigger the "frozen orbit" bug. Here they are:
1. Go to the tracking station
2. Switch to a ship clawing an asteroid travelling at <~1000 m/s around Kerbin (ideally with a few reaction wheels)
3. Physical timewarp x4
4. Turn the spacecraft forcefully in any direction (e.g. by holding on A)
5. Quicksave at a point where the spacecraft is severely out of alignment with the COM (~20+ degrees)
6. Reload the quicksave
7. Repeat from step 4 until triggering "Null Reference Exception" in the debug menu (doesn't usually happen the first time, but always after a few tries)
8. Nonphysical timewarp
After finding a way to reliably trigger the "Null Reference Exception" I tested the effects on different spacecraft.
Effect #1 - The spacecraft that triggered the bug freezes in its orbit around Kerbin after using nonphysical timewarp.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot359.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot361.jpg
Effect #2 - A spacecraft in the Sun's SOI freezes in its orbit after using nonphysical timewarp.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot362.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot363.jpg
(Other spacecraft in low-velocity (<~1000 m/s) orbit around Kerbin also freeze in orbit.)
Effect #3 - Spacecraft on the launchpad will freeze in place after using nonphysical timewarp. Thrusting up tears the ship apart, but the top of the ship remains hovering above the ground indefinitely.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot367.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot370.jpg
Effect #4 - Spacecraft in a high-velocity (>~2000 m/s) orbit around Kerbin gently break apart after using nonphysical timewarp. (No catastrophic explosion.)
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot373.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot374.jpg
Effect #5 - A spacecraft clawing an asteroid in a high-velocity (>~2000 m/s) orbit around Kerbin experiences a strong torque about the claw after using nonphysical timewarp. The spacecraft rapidly twists around until it hits the asteroid, either exploding or breaking apart depending on the force of impact.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot375.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Testing/screenshot376.jpg
Output logs from repeated tests:
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Output%20log%201/output_log.txt
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Output%20log%202/output_log.txt
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Output%20log%203/output_log.txt
Related issues
History
#1 Updated by Kerolyov over 10 years ago
- Status changed from New to Need More Info
Hey, thanks for this report, frozen orbit annoying bug that I've seen but can't reproduce with your steps unfortunately.
I tried your persistent file from http://bugs.kerbalspaceprogram.com/issues/2347 and tried many different craft in different orbits and despite many quicksaves and loads couldn't get a null exception. So still needs a bit of nailing down.
One note I'll make is the only time it happened previously was when I was on a simple orbiter with no claw or asteroid so looks like its not an asteroid/claw specific bug but something general related to timewarp maybe?
#2 Updated by Kerano over 10 years ago
I tried that persistence file as well and got the crazy torque/self destruction version of the NullReferenceException bug easily enough, but the frozen orbit version didn't trigger on all ships. I could only reproduce it using one craft (Goliath VIII-2).
Here is the backup persistence file from when I first stress-tested the frozen orbit bug, in case it's useful (I used Goliath VIII-2):
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/persistent.sfs
It's strange that some ships will trigger the "frozen orbit" version of the NullReferenceException bug, but others trigger torques/disassemblies/explosions. My best guess is that to trigger the âfrozen orbitâ version, the ship needs to be at a specific distance and/or velocity relative to Kerbin. Could be something related to the ship design though.
I agree that there seem to be multiple methods of initiating the bug, and it may not be asteroid/claw specific. The method I outlined above is simply the first way I've been able to reliably reproduce the bug.
Here are some screenshots to walk through the exact process I used just now to replicate the bug again, using the backup persistence file linked above:
#1 â Select Goliath VIII-2 in space centre
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot389.jpg
#2 â Load Goliath VIII-2
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot390.jpg
#3 â First physics warp + torque + quicksave
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot391.jpg
#4 â First reload
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot392.jpg
#5 â Second physics warp + torque + quicksave
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot393.jpg
#6 â Second reload (first appearance of NullReferenceException, though not yet freezing in orbit with nonphysical timewarp)
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot394.jpg
#7 â Third physics warp + torque + quicksave
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot395.jpg
#8 â Third reload (another NullReferenceException)
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot396.jpg
#9 â Immediately after hitting nonphysical timewarp this time, a huge list of NullReferenceExceptions came up, and the âfrozen orbitâ bug was activated
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/Persistent%201/screenshot397.jpg
(Sometimes it takes a few more than 3 iterations to get there, but it always happens eventually.)
#3 Updated by Kerano over 10 years ago
Aha! Finally managed a breakthrough.
Iâve just done some more testing with the persistence file linked above to try to narrow down the conditions triggering the bug. One new crucial thing I noticed is that the craft is never exactly âfrozenâ in its orbit â the altitude is changing at the same rate as if no timewarp were being used, but the velocity remains constant. Of course a constant velocity in an elliptical orbit is effectively a phantom acceleration as you change in altitude. I saw a bug report from someone else who triggered the NullReferenceException during a launch and waited long enough to be eventually flung out of Kerbinâs SOI without any throttle. On a hunch I tested what happened if I waited for a while after triggering the bug myself, and I got a craft on a collision course with Kerbin to raise its periapsis out of the ground with no throttle.
So Iâd reclassify the âfrozen orbitâ and âphantom accelerationâ bugs as different manifestations of one bug:
- Nonphysical timewarp has no effect for the craft youâre focussed on, instead you experience regular time (though all other objects will timewarp)
- Your craftâs velocity is locked at the value it had when you pressed nonphysical timewarp in the bugged state
Here are the results of my tests with the particular orbital inclination and eccentricity of Goliath VIII-2, using the persistence file and steps above. Each test begins with exiting and restarting the game to remove the bugged state.
Test #1 â altitude 5300 km, velocity 982 m/s -> âfrozenâ orbit (repeated 6+ times)
Test #2 â altitude 29000 km, velocity 67 m/s (apoapsis) -> catastrophic explosion (repeated twice)
Test #3 â altitude 19950 km, velocity 331 m/s -> catastrophic explosion
Test #4 â altitude 9950 km, velocity 659 m/s -> catastrophic explosion (repeated twice)
Test #5 â altitude 8950 km, velocity 710 m/s -> catastrophic explosion
Test #6 â altitude 7850 km, velocity 780 m/s -> âfrozenâ orbit (repeated three times)
Test #7 â altitude 6900 km, velocity 840 m/s -> âfrozenâ orbit
Test #8 â altitude 5500 km, velocity 960 m/s -> âfrozenâ orbit
Test #9 â altitude 2500 km, velocity 1430 m/s -> âfrozenâ orbit
Test #10 â altitude 880 km, velocity 2126 m/s -> torqueing followed by gentle disassembly or explosive disassembly, depending on the orientation of the spacecraft to the asteroid (repeated four times)
The first thing to note is that there seems to be a clear cutoff point around 8000-9000 km where the âfrozenâ orbit doesnât happen, at least for this particular inclination and eccentricity. I rechecked what happened at the 9950 km altitude if I changed the orientation of the craft, thinking that maybe the catastrophic explosions were a result of the direction the craft was facing in its orbit. However, there was no such effect â I tried about 10 different orientations at ~60 degree intervals everywhere along the navball, and always got the catastrophic explosion. So it seems the altitude and/or velocity of the orbit matters in terms of whether you get the âfrozenâ orbit version of the NullReferenceException.
Following Test #10, I waited to see what happened in the game following the disassembly. Aside from the constant âstuckâ velocity raising my periapsis out of the ground, the spacecraft actually disassembled a second time as it moved closer to Kerbin, leaving it with only a couple of structural elements and a remote guidance unit. This makes me suspect that only part of the spacecraft is locked at constant velocity, and as the discrepancies build up between the velocities different parts want to move, the ship develops an irreversible torque and/or rips itself apart.
(By the way, the length of time to trigger the NullReferenceException using the steps above is still pretty random. Occasionally it happens on the first quicksave/reload, sometimes it takes 15-20 iterations. On one occasion, the first two times I reloaded to a NullReferenceException it didnât trigger any bugs with nonphysical timewarp, only entering the bugged state after the third NullReferenceException.)
#4 Updated by Kerano over 10 years ago
After more testing with different spacecraft in the persistence file linked above, I have a few more notes.
#1 â The steps from http://bugs.kerbalspaceprogram.com/issues/2338 seem to trigger the same bugged game state as the steps listed above. Whether the apparent effect of the bugged game state is âfrozen orbitâ, âfrozen launchâ, âphantom accelerationâ, âcatastrophic explosionâ, âgentle disassemblyâ, âphantom torqueâ, or a combination thereof appears dependent on the orbital parameters and current position of the spacecraft. All of the different effects can be triggered by switching to a spacecraft and hitting nonphysical timewarp after the bugged game state is initiated. The consistent factor always seems to be (1) locked velocity, and (2) nonphysical timewarp having no effect for the selected craft (or sometimes being unusable due to acceleration/gyrations).
#2 â For Goliath VIII-2, on the way up to the apoapsis the âfrozen orbitâ can be triggered up to 8264 km, while the âcatastrophic explosionâ is triggered from 8265 km upwards. I tested this several times and was surprised how consistent it was. Whether or not the craft explodes, the two consistent factors are always (1) the velocity of the craft/remote guidance unit is locked, and (2) time passes at the normal rate regardless of nonphysical timewarp.
#3 â For most other spacecraft the boundary between âfrozen orbit/phantom torqueâ and âcatastrophic explosionâ seems to be at lower altitudes than for Goliath VIII-2, around 3000-6000 km.
#4 â Going into physical timewarp below about 1000 km with a craft thatâs already been torn apart from its asteroid shows the âphantom torqueâ still in effect on the remnants of the craft.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot471.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot472.jpg
#5 â While in a âfrozen orbitâ, entering another SOI will tear apart the craft. I suspect this may be because entering another SOI changes the relative orbital velocity, but at least one part of the craft tries to maintain its locked velocity. In the screenshots below I got a craft into a region near the Munâs orbit, then triggered the NullReferenceException and nonphysical timewarped until the Munâs SOI was close by.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot476.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot477.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot478.jpg
#6 â When physical timewarping ahead with a craft in a âfrozen orbitâ attached to an asteroid, the asteroid-craft system soon starts oscillating. My suspicion is that this is the result of the craft trying to maintain its locked velocity, which consequently applies a force to the asteroid which is trying to move in a ânormalâ orbit. If these oscillations continue for a while, the craft will sometimes clip through the asteroid to an absurd extent.
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot481.jpg
https://dl.dropboxusercontent.com/u/87213001/KSP/Frozen%20orbit/screenshot482.jpg
#5 Updated by Kerano over 10 years ago
I just realised that talking about "locked velocity", "phantom torquing" and "phantom acceleration" is actually missing a much simpler way of thinking about the problem.
When the bug is triggered, gravity stops acting on at least one part of the spacecraft.
I think the reason I didn't come to this conclusion sooner is because the map screen still draws the projected orbit for the spacecraft based on its current velocity and altitude. But after the bug is triggered, the spacecraft (or what's left of it) isn't moving along an orbital path at all - it's moving in a straight line. This would be more noticeable if the ability to nonphysical timewarp didn't happen to be broken at the same time.
A lack of gravity on at least one part of the spacecraft would neatly explain the locked velocity, phantom torqueing, phantom acceleration, and frozen launchpad issues. Broken nonphysical timewarp explains the illusion of "frozen" orbits. The only thing I can't explain are the catastrophic explosions at high altitudes (above ~5000-10000 km) - a lack of gravity alone shouldn't cause this, so I'm guessing it has to do with something else.
#6 Updated by Claw over 10 years ago
- File screenshot11.png screenshot11.png added
- File screenshot14.png screenshot14.png added
- File screenshot16.png screenshot16.png added
- File screenshot17.png screenshot17.png added
I'm not sure if this is the same bug or not. It manifested itself a bit differently, but perhaps it's related.
WHAT HAPPENS:
Clawing a piece of debris resulted in target velocity runoff. The craft thought the target was stationary in orbit, although it was clawed. (Doing a full orbit caused the target velocity to zero out, then grow again.)
HOW TO REPRODUCE:
This was from a completely fresh save game. No other craft were running in the persistent.sfs. I did not timewarp during any of this.
1) Create a craft (as seen in the pictures). The only part missing from the pictures for launch are three radial mount SRBs.
2) Launch into orbit.
3) Decouple orbital insertion stage (orange tank) and claw it with the probe.
NOTES:
After this happens, the game won't let me return to the space center, revert, or quicksave/quickload.
This seemed to happen more often when I clawed the "Rockomax Brand Adapter" first, but you can see even the orange tank did it.
When I had a probe body on top of the Rockomax Adapter, it didn't do this. Although I only tried that once...
Even though the skipper engine didn't show up on the staging side, the engine fires.
Time warping did not cause an explosion.
#7 Updated by Ted over 10 years ago
Okay, so I've given your grappling the decoupled tank a go, Claw. Can't say I spotted any odd behaviour there - other than the target velocity being quite wrong.
Going to test the other notes in this issue further.
#8 Updated by sal_vager over 10 years ago
- File bugged persistent.sfs bugged persistent.sfs added
- File frozen orbit KSP.log frozen orbit KSP.log added
- File frozen orbit 2 KSP.log frozen orbit 2 KSP.log added
- Status changed from Need More Info to Confirmed
- % Done changed from 0 to 10
I have successfully reproduced this issue, by following the steps given in Kerano's post above, there was no nullref before using regular warp however.
The craft, once frozen, will just sit in place on is orbit despite the altitude changing, also it will still be stuck even if KSP is restarted and the save reloaded.
I have attached the KSP.log and bugged save from testing this.
#9 Updated by Kerano over 10 years ago
Ted: Good to know. Let me know if I can help in any way. :)
sal_vager: I was surprised you said the bug remained for you even if KSP was restarted and reloaded, as that has not been my experience. I downloaded the file you uploaded to check - as far as I could tell the bug was not present in this save. Using nonphysical timewarp worked perfectly normally for me.
I presume you used Goliath VIII-2 as I did? Are you sure you're completely exiting all instances of the game? Maybe try restarting your computer and loading up the file again?
From my experience, exiting/restarting the game always removes the bug. It has to be re-triggered to reappear, and two methods seem to be (1) quicksaving and reloading a clawed asteroid after moving it multiple times, and (2) switching between multiple clawed asteroids in the map view. (One of my crazier save files triggers the NullReferenceException almost every time with just one quicksave and reload - it's in post #3 here: http://bugs.kerbalspaceprogram.com/issues/2367). As noted above, the exact effects of the bug - "frozen" orbit/launch, catastrophic explosion/disassembly, phantom acceleration/torque - seem to depend on the location and/or velocity of the craft.
#10 Updated by dstruct2k over 10 years ago
Ted wrote:
Okay, so I've given your grappling the decoupled tank a go, Claw. Can't say I spotted any odd behaviour there - other than the target velocity being quite wrong.
Going to test the other notes in this issue further.
The issue you're mentioning about incorrect target velocity on clawed objects sounds like a different bug; When the object is grappled, it stops being a separate object and is now part of the active vessel. The target's ID no longer exists (although it'll reappear when ungrappled) and the game ends up referring to the last known position of that ID. What should be happening here is the same as when docking: the current target should be cleared.
Really wish I had input on how to solve the bigger issue here though. :(
#11 Updated by Saskwach over 10 years ago
For what it's worth, I'm also seeing this in the x86_64 Linux build.
I engage nonphysical time acceleration and the ship I'm watching just stops moving. Everything else continues on in its orbit, but my focus doesn't move at all. I'm seeing this pretty consistently with vessels from large fuel tanks docked to spaceplanes down to a tiny probe with nothing but an ion drive and a couple solar panels.
#12 Updated by disoculated about 10 years ago
I experienced this problem and was as wits end trying to figure it out. I mean, I'd been playing for months and all of a sudden this starts happening? To every ship, every time I warp?
To make a long story short, I noticed that there were 128 mechjeb ship config files in C:\Program Files\Steam\steamapps\common\Kerbal Space Program\GameData\MechJeb2\Plugins\PluginData\MechJeb2. 128 being a suspicious number, I deleted them all.
Poof. Problem gone.
#13 Updated by Squelch almost 10 years ago
- Category changed from Bug Tracker to Physics
Setting relations and a changing the category for easier queries.
#14 Updated by widi1975 over 9 years ago
Hi, I had the same issue. May I have workaround. I could reproduce the bug.
I am using the MKS Mod (The colony mod to build bases on moon for example)
I built a test colony with a test vehicle near my landing platform.
After I did that I had the problem with frozen spacecrafts when I go to warp (time warp).
After I deleted some debris in Space and deleting everthing near my landing platform on kerbal - I hadn't the bug anymore.
I hope this will help resolving the bug. Because this bug is really annoying.
#15 Updated by widi1975 over 9 years ago
I have some bases on moon. Not every time but very often I am switch from my base on ground to a space craft I could reproduce the bug. My Spacecraft explode or freeze after I use the time warp.
#16 Updated by widi1975 over 9 years ago
- File MKS Integrated Module Base.png MKS Integrated Module Base.png added
- File MKS Integegrated Module Base2.png MKS Integegrated Module Base2.png added
I think, I have found a part in the MKS mod which cause the time warp bug.
If you use the MKS Integegrated Module Base and connect it to other parts on your Base and you go back to a vessel and click warp the bug cause that the vessel freeze or explode.
#17 Updated by Trainzack over 9 years ago
I have had the misfortune of this bug affecting my 1.0 save.
However, I happened to have made tens of dated quicksaves that may help investigations.
Mods include station parts expansion (http://forum.kerbalspaceprogram.com/threads/91814-1-02-Stockalike-Station-Parts-Expansion-%2804-05-2015-CTT-and-minor-fixes%29), RPM, Transfer Window Planner, and Distant Object Enhancement, although you should only need the first to load these saves. I think it was at (5-7 20+55 3 kerbals returning) that the bug repeatedly happened, although restarting the game seemed to fix that.
The zip file containing the quicksaves is here: https://dl.dropboxusercontent.com/u/55136631/GhostKrakenBugSaves.zip
#18 Updated by ofirc over 9 years ago
I am experiencing this (or a very similar issue) in an unmodded 1.0 (steam) installation.
It mostly happens in career mode (which is a new game with default difficulty settings - so it doesn't seem to be an upgrade artifact) and seems to be related to being close to Kerbin (~10-200KM) and/or (and more likely) to be related to not having access to maneuver nodes and/or to direction selector (due to low pilot level/command module tech/upgrade level).
I don't need claw in the craft to reproduce it (but may be related to having activated the asteroid redirect scenario earlier), essentially, with those conditions, with some crafts, whenever I activate wrap, I get a can't wrap during acceleration message (even though no acceleration is active), and then see the constant orbit constant speed effect, usually ending with some parts of the craft going missing after some time.
Given the simple scenario, and since this is probably the configuration for most new career games, it probably deserves new attention.
#19 Updated by Sniffy over 9 years ago
- File Capture.PNG Capture.PNG added
1.0.2 Steam install - unmodded
This is happening to me after docking with my klaw on minnus or simply switching to that vehicle and switching back.
Here are two scenarios that I can replicate with 100% success.
Scenario 1:
Dock my super simple ship (mono fuel tank, mono engine, probe, cockpit) to my refueling station on minnus. After refueling I fly away. Upon reaching 3k meters, I hit the timewarp and instantly explode, leaving the remaining control-point suspended in mid-space (was about to say air)...
Scenario 2:
fly a ship....anywhere in space. Switch to my minnus base (same as above, with klaw). switch back to said ship. Accelerate. Timewarp. Timewarp will go up, but then go back to 1x right away, leaving my ship glued to its control point. I can watch the rest of the ship try to pivot and move but b/c it is connected to the stuck point, it does nothing. 9 times out of ten I get the "can't warp during accel" message if I try again. Every now and then I can accelerate and just watch the world below me spin SUUUUUPER fast. This may be altitude related, though the rest of the symptoms are the same so I'm pretty sure it's the same bug.
#20 Updated by vonsch over 9 years ago
I'm seeing the same behavior in Steam 1.0.4 install, mods on or off. 3 Different ships. All instantly explode during time warp, although with KJR installed, they don't explode, but they do remain entirely static and uncontrollable.
I'm new to KSP and bugtracking. let me know what I can post to help.
#21 Updated by Squelch over 9 years ago
- Platform Win32 added
- Platform deleted (
Windows)
#22 Updated by widi1975 over 9 years ago
Hi, I have the same issue now with a other modul. If I use the extraplanetary launchpad. The launchpad for ground is causing this issue. The vessels explode by warping or freezing.
After the vessel explodes, you can see that every part has a different speed. some parts are escaping the planet or moon, some others flying on different places on the planet
#23 Updated by sal_vager about 9 years ago
- Status changed from Confirmed to Resolved
- Severity changed from High to Normal
- % Done changed from 10 to 100
Hi, please be mindful of the bug reporting guidelines and priority table when reporting issues, thank you.
http://bugs.kerbalspaceprogram.com/projects/ksp/wiki
No longer occurring in 1.0.5, build 1028
#24 Updated by TriggerAu over 8 years ago
- Status changed from Resolved to Closed