• 1
Claw

FIX: Dock / Undocking Bug in 0.23.5

Question

Help! My docking ports refuse to dock or undock!

KSP has suffered from docking and undocking problems for a while now. This thread by roscoe_jones outlines a fix but seems to not fix all of the problems with docking issues in 0.23.5. I think I have figured out a new method which seems to work on the more stubborn undocking problems in 0.23.5.

Also, for completeness, I've included instructions on how to fix the common "unable to dock" problem.

This thread has been added to the 0.24 Cross-Platform Problems thread: http://forum.kerbalspaceprogram.com/threads/92235

Keep a copy of your save files somewhere safe...


UPDATE HISTORY:

8 May 14 - Found shorter method to fix "undock bug"

Edited by Claw

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0
You're a lifesaver Claw. Couldn't detach an experimental pod from my orbital station and your fix worked! Thanks!

EDIT: And yes: this was on 0.25

Fantastic! I'm glad to hear it's still working. :D

And the fix is something that could probably be compiled as a dll that is called whenever the "undock" or "decouple" button is pressed, just prior to calling the actual decoupling routine.

I am working on a fix module for this (link to other stock bug fixes in my sig). The problem with this one is detecting when the bug exists. It can be difficult to tell if the ship is actually connected when the port thinks it isn't, and to check if there isn't something connected when the port thinks there is. It would be bad to go around resetting ports that don't need to be reset... I'm working on another project at the moment, but this fix is still in the queue. (Hopefully someday "soon.)

(* the other two are the game crashing, which primarily occurs on scene changes; and a nasty Kraken that prevents quicksave or return to the Space Center. I'd say those two plus the can't undock bug are absolute musts to tackle in 0.9)

I'm not sure which "scene changer" crash you're referring to, but there is a known bug that prevents quicksave or returning to the space center. The known one isn't a "kraken" though. The name kraken gets thrown around a lot, even though the actual kraken was slain a while ago. So I'm not actually sure if you're referring to the known bug or something else.

Cheers,

~Claw

Share this post


Link to post
Share on other sites
  • 0
I am working on a fix module for this (link to other stock bug fixes in my sig). The problem with this one is detecting when the bug exists. It can be difficult to tell if the ship is actually connected when the port thinks it isn't, and to check if there isn't something connected when the port thinks there is. It would be bad to go around resetting ports that don't need to be reset... I'm working on another project at the moment, but this fix is still in the queue. (Hopefully someday "soon.)

I'm pretty sure this bug is caused by a missing garbage cleanup / destructor in the docking routine. A possible solution is immediately after docking to run through the ship's data and look for and fix missing docker-dockee links.

Alternately, it could be something related to the two names "undock" and "decouple". These are the same function as far as the user is concerned, so presumably the difference is in the way KSP manipulates ship data for those two functions. I'm guessing the dockee's vessel name and root uid don't change, and the docker's name and root uid both change, whereas decoupling works differently. If that is the source of the confusion for KSP, then the solution is to change the way the game renames vessels, tying a name permanently to each control pod and changing the name only if the user changes it. Then use only "undock" or "decouple", not both. If the old root uid is not present on an undocked vessel then the vessel's new root is the first control pod found, and the vessel's new name is the name tied to that control pod. In the VAB, if a ship is built with multiple control pods on board, each control pod after the root gets its name based on that root (Foo Ship or Foo Rover or Foo Probe etc.), and when the section of spacecraft is decoupled the probe or whatever already has a name ready to go.

I'm not sure which "scene changer" crash you're referring to, but there is a known bug that prevents quicksave or returning to the space center. The known one isn't a "kraken" though. The name kraken gets thrown around a lot, even though the actual kraken was slain a while ago. So I'm not actually sure if you're referring to the known bug or something else.

Yeah the quicksave bug is the known one. The scene changer crash occurs when going from a ship to the space center to the tracking station to a ship to switching to another ship in the map screen back to the space center... do enough scene changes and there's a hard crash. However, I put those in parentheses because I didn't want to clutter up this thread with unrelated topics, merely comparing the severity of the can't undock bug to those other bugs. Basically, this bug is in the top three of must-fix bugs to tackle in 0.9.

Edited by edrobotguy

Share this post


Link to post
Share on other sites
  • 0
Alternately, it could be something related to the two names "undock" and "decouple". These are the same function as far as the user is concerned, so presumably the difference is in the way KSP manipulates ship data for those two functions.

Yes, each is handled differently internally by KSP, which is why the fix for undocking works. This is another bug that I know how to fix, but still can't trigger the bug "on-demand."

I'm guessing the dockee's vessel name and root uid don't change, and the docker's name and root uid both change, whereas decoupling works differently.

This is a common assumption but it doesn't work that way at all. KSP has a hierarchy order for subsuming ships based primarily on ship type and listed order in the save file. For example, a ship docking with a station results in the station being the root of the new vessel. It doesn't matter which you're in control of at the time of docking. If you dock two ships together, the one that's first in the save file will be the root of the new vessel (regardless of size or part count). I made a whole thread about this, buried somewhere in the tutorial forum.

However, you're right, docking does work differently. But KSP tracks the old root UID and old vessel's name. When you undock, that information is pulled and used when reconstructing the ship. If I recall correctly without looking, that name/uid is stored in the docking port because that's the safe place for it once you start docking multiple pieces together. And frankly, it can't be tied to a control pod because you can build vessels which don't have a pod or probe core at all (such as an adrift refueling tank).

Cheers,

~Claw

Edited by Claw

Share this post


Link to post
Share on other sites
  • 0

so is there any indication as to what causes this? it seems to be related to one specific build in my save but i'm not sure what about that ship caused it.

Share this post


Link to post
Share on other sites
  • 0

It appears this issue is still not fixed in 0.90. Had multiple docking ports on a Mun station go on the fritz today. Luckily this fix still worked! :)

Share this post


Link to post
Share on other sites
  • 0
so is there any indication as to what causes this? it seems to be related to one specific build in my save but i'm not sure what about that ship caused it.

I don't know. It seems to happen a lot, but unpredictably. So it's hard to replicate.

Although I suspect that some of it (not all) might be triggered by Lazor docking mod since most save files I see have that installed.

It appears this issue is still not fixed in 0.90. Had multiple docking ports on a Mun station go on the fritz today. Luckily this fix still worked! :)

Great! I'm glad it is still doing it's job. :D

Cheers,

~Claw

Share this post


Link to post
Share on other sites
  • 0

Encountered this today... What a mongrel thing, and it seems to be one of those bugs that won't go away.

I tried your quick and dirty fix, and I followed it to a T, using the disable crossfeed button to find the UID and then searching the UID to find the part and changing the Attn line to refelct Top, (parent), saving and reloading and hitting decouple, not undock...

But the wrong part decouples!!! Screenies attached.

Javascript is disabled. View full album

Any clues? (yes I have my unedited save backed up :) )

edit: So I gave up on it and set that craft adrift.... made a new base for another orbital station, got it into orbit, docked and... same thing again.

Edited by KerBlam

Share this post


Link to post
Share on other sites
  • 0
Any clues? (yes I have my unedited save backed up :) )

Yes, actually. You told it to decouple there, which I'm sure wasn't your intent.

The problem is actually further down in your picture. You put the wrong part ID in the attN line. From your pictures, I can't tell you what that number needs to be, but it definitely isn't "1". Part 1 (the SAS part) is already attached to the bottom node.

Do search for the dockUId that you have highlighted and you should find the other docking port somewhere. You actually need to then set the partner port to "attN = top, X" where X is the parent in that partner port (which will actually reference the port shown).

Actually, I'm considering building a fix for this. If you still have a save file available, it would be awesome if you could upload it.

Cheers,

~Claw

Share this post


Link to post
Share on other sites
  • 0

I did something interesting...

I have a few files...

Here is the one from this save> https://www.dropbox.com/s/dpqt7y60tl9rtvs/quicksave1.sf?dl=0

This one, I believe, is from one that happened more recently, it's happening to me now whenever I try to undock a clamp-o-tron sr.

The saves are from immediately before undocking> https://www.dropbox.com/s/l2z19jxnpee4wsq/quicksave.sfs?dl=0

and THIS is a file.. it may be useful or not, I wouldn't try to load it as a save though. It's basically a changelog of the second save file from immediately before undocking, and immediately after and firing the RCS thrusters once. It shows what changed in the save file. > https://www.dropbox.com/s/knfer9uboi85sxv/logcompare.txt?dl=0

Share this post


Link to post
Share on other sites
  • 0

Incidentally, I was able to find an ingame workaround but it only works if the part you are trying to undock has thrusters that point AWAY from the dock. RCS doesn't work.

What I've found works is: If you undock and it jams, turn thrusters barely on and exit to the spaceport, then immediately return to the ship and it should be undocked. This has worked for me everytime when it has been a ship with thrusters.

Why I think this works: I noticed that if I exited to the spaceport after a jam and went back to my ship there would be a split second upon reload when the ships were free of each other, but the game is still loading and you cannot turn your thrusters on in time to move away.

As soon as you can control your ship at all, the ships lock back together (and if you try and undock again, all your shytt explodes, which is awesome)

sooo... by having your thrusters already on before you exit and return, they are already on during that initial loading phase and the ships are able to move free of each other.

It says to me that the docks are reverting to a *ready to dock* phase immediately after undocking, which they shouldn't do. Somehow that's causing them to stick, but they aren't actually stuck, because if you reload, they are free for just that tiny split-second.

I think if there was a distance buffer (say 1m) that after undocking the ship would not be *ready-to-dock* until after the ship had exited that 1m proximity limit that may fix the problem...

I'm no coder, and this is all just an observation, I might be way off the mark, but I thought I'd share anyway.

I'm going to post this in it's own thread, in case it helps anyone else.

Edited by KerBlam

Share this post


Link to post
Share on other sites
  • 0

Very interesting observation. I don't know what it might mean off hand, but definitely something to look in to (hopefully this week).

Thanks!

-Claw

Share this post


Link to post
Share on other sites
  • 0

Claw, I am running the Mac version, but I have had exactly the same issues. I just posted a bug report here:

http://forum.kerbalspaceprogram.com/threads/55657-0-90-Kerbal-Joint-Reinforcement-v3-1-1-1-15-15?p=1672059&viewfull=1#post1672059

I have a small group of base mods (DRE/FAR/KJR) that I usually add PF to (and Snacks), but I made a fresh install, then added the mods one by one, when I had all, plus your stock bug fix mod in there, it worked fine… until I added KJR. My thought was that if KJR triggers it reproducibly, that might help you figure out the cause (even if it is slightly different).

tater

Share this post


Link to post
Share on other sites
  • 0

Tater, this is great! I see you posted a craft and save file. I will download these and give them a try soon.

Thanks!

~Claw

Share this post


Link to post
Share on other sites
  • 0

Let me know if there is anything else i can do for you. Was unsure if persistent or quick save was best (I'm unsure if they are different formats). This was sandbox, and the only vessel as well, I tried to keep is as simple as possible.

Share this post


Link to post
Share on other sites
  • 0

But will this help in situations where one docking port's data was written incorrectly or a botched repair job made it worse? (i.e. DOCKEDVESSEL improperly constructed while fixing the save file)

Share this post


Link to post
Share on other sites
  • 0

THANK YOU THANK THANK YOU!!!! Just wish I would have found this before I gave up on 3 days worth of ship building that resulted in multiple jammed docking ports resulting in multiple explosions.

Share this post


Link to post
Share on other sites
  • 0

^ 1st post and all!

Claw~ Check this out... seems ferram has a solution, but I'm waiting for an official release to be sure.

Edited by KerBlam

Share this post


Link to post
Share on other sites
  • 0

Hey! There you go. And all this time I was suspicious of the Docking Port Alignment mod... :P

Share this post


Link to post
Share on other sites
  • 0

I see I'm not the only one who's run into this. However, I've tried everything, and I'm still not getting my lander to separate from the carrier. I've spent an inordinate amount of time getting this together in career mode, building the ships up from flat-pack parts, brought up from the surface in 3 loads on an SSTO space-plane with a 40m cargo bay. I decided to swing past Mun and Minmus, and complete the outpost missions on the same trip, and that's when I got stuck.

I'd appreciate it if someone can tell me where I'm going wrong here. I've tried this workaround, as well as followed instructions on the "Can't Undock Bug" thread, but the problem is, I can't determine what the parent is supposed to be, because it doesn't seem to be referenced anywhere. I also have a feeling that part of my problem is that the various modules aren't individually named - they all took the name of the SSTO load they are brought up on.

I've uploaded my quicksave to https://www.dropbox.com/s/hfe0tgrt3x799v9/quicksave.sfs?dl=0. An image of my setup: https://www.dropbox.com/s/78ev2z0xliq4g9s/Stuck%20docking%20port.jpg?dl=0. Following from the nose backwards, the ports that are jammed are the first ports you see down the center-line of the ship. In running the latest update of .90 on Windows 7, if that helps.

The UIDs for the docking ports that I'm struggling with are:

1872071175 (Carrier)

3517598418 (Lander)

Thanks

Desperate!

Edit: It ALWAYS happens that after I've made the post, I make one last ditch attempt at following the instruction to the letter, and it then works. Thanks all the same!!!!

Edited by spearsp

Share this post


Link to post
Share on other sites
  • 0

I ran into this bug in my current 0.90 modded career save. The bug occurred while launching a station to fulfill a "build an orbital station around Kerbin" contract. I had two set of docking ports on the craft that got stuck and would not undock. Both docking ports were linked to action groups to undock -- this may have caused the bug, but am not sure yet. Here is the craft file. I was playing with the following mods:

Active Texture Management

Astronomer's Performance Improvement

KSP Add-on Version Checker

Blizzy's toolbar

Kerbal Engineer Redux

Kerbal Alarm Clock

Trajectories

Deadly Reentry

FAR

Procedural Fairings

Kerbal Isp Difficulty Scaler

Kerbal Joint Reinforcement

Real Chute

Remote Tech

SCANSat

TAC life support

Dmagic Orbital Science

Universal Storage

Kerbal Attachment System

USI Kolonization Systems MKS/OKS

Contracts Window +

Contract Configurator

Contract Pack: Remote Tech

Contract Pack: SCANSat

Chatterer

Precise node

Eventually, this fix got the stuck docking ports unstuck.

I'm going to see if I can reproduce the bug and will provide any logs or other useful information, if I can.

Edit:

So I was able to reproduce the bug by doing the following:

1. Start new sandbox save with the mods listed above.

2. Quit KSP.

3. Copy paste craft file above into the new sandbox save's folder.

4. Load sandbox save.

5. Load Skylab craft.

6. Launch.

7. Use first stage to get apoapsis above 100 km

8. Trigger staging to decouple SRBs and ignite second stage.

9. Circularize and cut engines.

10. Press 1 for saved action group to undock docking port connecting main craft and second stage.

Docking port now stuck together even though should be undocked. Vigorous shaking, rotating, thrusting, etc. will not get unstuck.

Here is the output log after reproducing as such. I've made a backup copy of the entire KSP folder as it existed right after reproducing this bug, so I can send any other files that might be helpful as well.

Edited by Kedwin Hubble
reproduced bug

Share this post


Link to post
Share on other sites
  • 0

KJR reportedly was triggering this bug recently. You might also want to check and make sure your KJR is up to date.

Thank you for the extra info.

Cheers,

~Claw

Share this post


Link to post
Share on other sites
  • 0

It's the latest version of KJR. I realize stuff happens with such a heavily modded game, but figured it was worth documenting, since this bug supposedly pops up in stock too. Thanks for helping to document, workaround, fix, and squish the bugs.

Edited by Kedwin Hubble
grammar

Share this post


Link to post
Share on other sites
  • 0

The quick fix worked for me - thank you!

Another data point - I have many mods but neither KJR nor any of the Lazor mods are among them.

Share this post


Link to post
Share on other sites
  • 0

This now the second time my OKS station is rendered useless because I cannot undock 2 of three vessel docked to it.

I just don't feel like tinkering with a text file with over 70K lines any more and am frustrated like hell.

Not expecting anyone from Squad will read this.

This bug has been in here for so long, I don't expect it to be fixed any time soon.

I guess it's time for an extra long break from KSP.

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.