Jump to content

Not the normal docking bug


Recommended Posts

I have quite a specific issue with docking ports, and I can't find any other examples of this particular problem.

 

My ports will not dock when one of them has been attached at launch. I marry them perfectly, but no magnetic force, and they just sit next to each other - no docking! If I launch a ship with an 'exposed' docking port, not attached to anything, it works fine. But any port whose docking face is attached to anything else at launch will not work. This is true if I launch it docked to another port, or attached to a decoupler, or just attached to a fuel tank etc ready to decouple node. 

 

Looking through the save file, I found that a bunch of my docking ports are 'State = PreAttached'. Seemed like the culprit, so I edited them all to 'State = Ready'. Unfortunately, this didn't fix the issue, and doesn't seem to have changed anything. Is there something else I need to change with the docking ports in the save file to change them from being stuck in this state of preattached, to being ready for docking?

 

I would be happy to work out how to fix this in the save file every time I launch a new ship. But if anyone can suggest a reason why these aren't automatically switching to Ready when I undock/decouple them, that would be even better!

 

Thanks in advance for any advice. 

Link to comment
Share on other sites

"PreAttached" is supposed to mean that the port is currently attached to something from when it was built in the VAB.  As you imply, it should get changed to a sensible value when you decouple whatever is attached.  Without more information (e.g. an example craft or two, a save file, or a log at least) we would just be guessing...

I would recommend trying to reproduce the problem with a couple of simple stock rovers on the runway and if you can, then try the same craft in a stock install (or post the craft so others can).

Link to comment
Share on other sites

I started a new save last night, and made a ship that was just 2 Hitchhikers and 2 normal ports, one of which was in between the 2 pods. And some RCS thrusters. 

 

I launched it, exited the save, and looked in the save file. One port was State = Ready, and the other PreAttached. Just as you would expect. 

 

I went back in and decoupled the node of the port holding the 2 Hitchhikers together, to separate them. I then checked the save file and both ports were now State = Ready. Again, just what you would expect. 

So I tried to dock, but still could not. I bumped the 2 ports together for ages, with no suggestion of any magnetic force. Back in the save file, I compared the 2 docking ports, and they were identical. Line by line, every value was the same (except the Set as target, seeing as I had targeted one to try and dock). How can 2 docking ports behave differently when the code in the save file is exactly the same? I'm out of ideas.

I'm not sure there's much point in me providing a craft file. This happens on every ship, with every different type of docking port (stock or mod). But I agree it's a good idea to try to replicate in a stock-only install, which I'll do later. 

Also, I'm not sure where to find the output log in Linux. @NathanKell kindly gives instructions in this thread, but the file address he provides appears to bear no relation to anything on my computer. 

 

Thanks for your input @Padishar

Link to comment
Share on other sites

2 minutes ago, Oafman said:

Also, I'm not sure where to find the output log in Linux. @NathanKell kindly gives instructions in this thread, but the file address he provides appears to bear no relation to anything on my computer.

I'm not sure how familiar you are with linux or how the GUI tools in whatever version you are using work, but the location he gives of  ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log is in a "hidden" (the dot at the start of .config basically means hidden in linux) folder in your home directory (the ~ means your home directory).  There should be a fairly easy way to enable showing of hidden files and folders in the GUI.

It's also possible that the location of the file has changed with the Unity5 update and that thread is out of date, but someone that uses linux would have to confirm or deny this...

Link to comment
Share on other sites

19 hours ago, Padishar said:

I'm not sure how familiar you are with linux or how the GUI tools in whatever version you are using work, but the location he gives of  ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log is in a "hidden" (the dot at the start of .config basically means hidden in linux) folder in your home directory (the ~ means your home directory).  There should be a fairly easy way to enable showing of hidden files and folders in the GUI.

It's also possible that the location of the file has changed with the Unity5 update and that thread is out of date, but someone that uses linux would have to confirm or deny this...

I got it, thanks. Wasn't aware of the hidden files. (F8 unhides them in Ubuntu, if anyone else doesn't know).

 

I did more testing last night. Same as before, with 2 hitchhikers and 2 standard docking ports. They are definitely both identical in the save file, but I still can't dock. 

 

However, I've now observed that something quite weird is happening. When very close together, the ports are trying to dock. There's no magnetic force, but the camera view starts to shift, kind of like when you switch your trajectory to suborbital (although I'm still comfortably in orbit). The camera shakes around a bit, as the docking command is clearly trying to work but failing. 

 

I didn't get chance to try this in a stock only game, will do so later. 

 

If anyone thinks they can help, the log and save file from my testing last night are in this dropbox folder: https://www.dropbox.com/sh/7rrt8c4nvc5qsyq/AAAuLyr7zSW3cNmIGbD6YkzHa?dl=0

Link to comment
Share on other sites

1 hour ago, Oafman said:

If anyone thinks they can help, the log and save file from my testing last night are in this dropbox folder: https://www.dropbox.com/sh/7rrt8c4nvc5qsyq/AAAuLyr7zSW3cNmIGbD6YkzHa?dl=0

Unfortunately, the player.log file is rather messed up.  Both the start and end have large chunks overwritten with information about Mono not being able to load various types.

One thing I can see is that the Trajectories mod is spamming the log with exceptions all through the loading process:

NullReferenceException: Object reference not set to an instance of an object
  at FlightGlobals.get_ActiveVessel () [0x00000] in <filename unknown>:0 
  at Trajectories.AutoPilot.Update () [0x00000] in <filename unknown>:0 

Why an AutoPilot object is even being created that early on is a mystery.  I presume they use [KSPAddon] with the "instantly" option to avoid the object being deleted and recreated on every scene switch for some reason, but this isn't a very nice thing to do, it should just be instantiated in the scenes that it's needed in (and has a hope of working in).  If this is done to preserve data between scenes then this can be done in other ways (e.g. store the data in statics rather than instance variables, or various other ways).

Link to comment
Share on other sites

3 hours ago, Padishar said:

Unfortunately, the player.log file is rather messed up.  Both the start and end have large chunks overwritten with information about Mono not being able to load various types.

Not entirely sure what that means. 

3 hours ago, Padishar said:

One thing I can see is that the Trajectories mod is spamming the log with exceptions all through the loading process:

Hmm. I'll try removing that mod and see what happens. That mod has often been problematic for me, to varying extents. Or perhaps that's a product of the fact that I hyperedited the craft into orbit?

3 hours ago, Padishar said:

Why an AutoPilot object is even being created that early on is a mystery.  I presume they use [KSPAddon] with the "instantly" option to avoid the object being deleted and recreated on every scene switch for some reason, but this isn't a very nice thing to do, it should just be instantiated in the scenes that it's needed in (and has a hope of working in).  If this is done to preserve data between scenes then this can be done in other ways (e.g. store the data in statics rather than instance variables, or various other ways).

Errrr....I have no opinion to offer on that!

 

Thank you for your help with this, very kind of you to take the time to look at it for me. I'll try without Trajectories, then again with a stock-only install, to see if I can get any different results.

Link to comment
Share on other sites

On 23 June 2016 at 11:34 AM, Oafman said:

However, I've now observed that something quite weird is happening. When very close together, the ports are trying to dock. There's no magnetic force, but the camera view starts to shift, kind of like when you switch your trajectory to suborbital (although I'm still comfortably in orbit). The camera shakes around a bit, as the docking command is clearly trying to work but failing. 

What is actually happening with this, is that it switches the active ship I'm trying to dock to 'landed' mode, rather than 'in orbit'. 

The camera continually shakes around and MJ reports 0s and NaNs for all the Orbit numbers. If I go to the Tracking Station, it has the craft described as 'Landed at Kerbin' even though the map in the tracking centre shows that it is in orbit. 

However, this doesn't always happen. Sometimes (rarely) i can dock ports successfully. Sometimes they just bounce off each other with no attempt to dock, and sometimes it tries to dock, and I get the 'landed' thing I just described. I'm really struggling to find a pattern for these. 

I haven't had much time to test recently, as I've been busy coming to terms with my country failing a national IQ test. But i should be able to tinker a little more in the coming days, including a stock-only test. 

Incidentally, @Padishar removing the Trajectories mod made no difference, apart from speeding some things up in orbit slightly, but it was;t related to the docking issues

Link to comment
Share on other sites

  • 3 weeks later...

Well, I never worked out what was going on. Multiple issues maybe, given the variety of problems related to docking, and my inability to pin down exactly what was going on. 

In the end, I chose the nuclear option, and switched the whole save file, along with all mods, into a Windows version of KSP. 

And I'm happy to report, that has worked! Docking is now functioning, and touch wood, I don't seem to have any further save-breaking issues to  overcome. 

I'll leave this thread open in case anyone else experiences these kind of problems, or comes up with a solution. 

Link to comment
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
Reply to this topic...

×   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.

×
×
  • Create New...