Jump to content

Undocking Problem - MechJeb


Recommended Posts

Hey guys, I've got a weird problem here.  Its been happening consistently over the past week with different iterations of this ship.  What happens is I go to undock my fuel pods, but each time on 1-2 pods it doesn't completely undock.  The two couplers will separate and occasionally the ship will separate from the radial attachment point, but the ship still (kind of?) acts like its attached.  The engines on the 'undocked' module will still fire at the same time, and if I go to the navigation station at base and try to go back to the ship it glitches out and won't load.  Note that I did use MechJeb's Docking Autopilot software to line up the tanks for docking, but I tried disabling it and docking them manually and it still had this error.  Its hard to explain, so here's a video for you guys:

The only mod's I have had installed were visual enhancers and MechJeb, I uninstalled all mods but MechJeb and the problem continues to occur, I also reinstalled MechJeb with no improvements.  Can someone help me understand why this is happening?

Edited by Knexrule11
Link to comment
Share on other sites

Please provide the following: link to the savegame that brings to this error; KSP version and build; MechJeb build you have installed. Best if you can also provide links to the crafts files for the ship and docked assemblies.

Also, if you are able to read the output log (or, open the debug window and select Console), please observe if any error or exception is shown when you undock and report it. If not, please provide output_log,txt after having "unsuccessfully" undocked.

I'm fairly sure checking the structure of your ship in the savegame (or craft file) will reveal something weird, as also can be guessed by one detail in your vid (that BZ-52 radial attachment point seemingly floating next to the ship but not moving, therefore actually still a part of the ship though seemingly belonging to the detached fuel pod).

Link to comment
Share on other sites

21 minutes ago, diomedea said:

Please provide the following: link to the savegame that brings to this error; KSP version and build; MechJeb build you have installed. Best if you can also provide links to the crafts files for the ship and docked assemblies.

Also, if you are able to read the output log (or, open the debug window and select Console), please observe if any error or exception is shown when you undock and report it. If not, please provide output_log,txt after having "unsuccessfully" undocked.

I'm fairly sure checking the structure of your ship in the savegame (or craft file) will reveal something weird, as also can be guessed by one detail in your vid (that BZ-52 radial attachment point seemingly floating next to the ship but not moving, therefore actually still a part of the ship though seemingly belonging to the detached fuel pod).

KSP: 1.2.2.1622 64bit

MechJeb: 2.6.0.0

Link to zip containing save-game and craft files:  https://www.dropbox.com/s/aa3cezc51e7i6aq/Files for Error Report.zip?dl=0

I think you might be right about the structure of my ship, although the only thing that makes me doubt this is on a previous test flight I docked/undocked these modules no problem and it functioned as expected.  However it is a wonky ship design, as I launch all 4 at once and I believe that might be the cause however I am unsure how to check this.  If you could let me know what you think I'd greatly appreciate it, I've spent a week troubleshooting this and I'm about out of options.

I'm not sure how to read the output log, but I'll go try to figure that out next and I'll edit it into this comment if I figure it out.

9 hours ago, HobbitJack said:

Did you try the problem only stock?

I haven't tried it in stock because docking these modules is nearly impossible without the autopilot, but I'll load the docked ship in vanilla and give that a try next.

Link to comment
Share on other sites

Files are good for me to check your issue. Indeed an abnormal undocking shows every time with one of those fuel pods, which raises exceptions.

wxCtt7y.png

Please allow me some time, have to clean all unneeded vessels in your savegame before going deeper. A early analysis with KML (generally very useful to check docking issues) showed other vessels with troubles, but not that one:

Cq8J2Qb.png

That means I'll have to go deeper hoping to find where the trouble is and how to fix it. Anyway, doesn't seem related to use of MechJeb.

Link to comment
Share on other sites

Hmmm interesting, I figured it would be MechJeb cause I didn't figure something like this could happen in Vanilla KSP but I guess it can (which is why I posted in the mods sub-forum)!  Thanks a bunch for helping me out with this though, I really appreciate it.  Let me know if you need me to supply anything else for you to help solve this.

Link to comment
Share on other sites

Must say, never found this bug before. Really doesn't seem related to MechJeb, the trouble while undocking shows even while the plugin isn't loaded (MechJeb parts have to because vessels won't load without, but can't cause harm). It seems when the fuel pods docked, KSP got confused and didn't set correctly all relationships with parts of those fuel pods then belonging to the docked vessel. Sketched a graph showing these relationships for parts involved using data from your savegame.

Spoiler

NyKMVus.png

Numbers are the ID of each part (0 would be for the root part with the vessel). This chain starts from the size3 tank (ID = 191) where 4 attachment points are radially attached in symmetry, with large adapters and then docking ports over them. With the fuel pods docked, the chain continues from the coupled docking ports, large adapters and attachment points, to arrive at the size3 tanks with each pod (each one carrying a now unused attachment point). Somehow KSP got things wrong (probably due to how those pods were assembled) and didn't set the relationships shown by a red arrow, between attachment points and size3 tanks (in the savegame those show as nil, instead of pointing at the correct ID for the attached part).

Though unclear how the above could bring to the issue, tried editing the savegame with the correct values. Unfortunately my try didn't work, with or without MechJeb still the issue shows; what follows is KML analyzing a savegame just after a unsuccessful undocking, showing the docking Port (with ID#501) having invalid data, plus the opposite attachment node on the same fuel pod being now wrongly attached. Interestingly, another vessel identical to the one with the 4 fuel pods (but still not detached) is also reported to have a problem with a docking port (probably caused by the double link with the mirrored ports, stock KSP isn't able to manage double links).

BmmdWDo.png

I'm guessing something similar to the error with attachment points not correctly tied to those size3 tanks happens not only while docking, but undocking too. Indeed, undocking makes for all parts with the detached vessel to reverse parentship again, starting from the root part down; whatever caused KSP to not set ties correctly when docking seems to occur again. Therefore, even if I had the link for the attachment point corrected (parts 503-504) still this causes part 570 to go detached from the fuel pod and remain logically tied to the ship.

Possibly the error that occurs at undocking (NullReferenceException: Object reference not set to an instance of an object) is due to this; certainly something prevents the new vessel to be generated (therefore the above exception) with consequences with all the concerned parts. KML shows the fuel pod still being a part of the ship (as confirmed by the docking ports not being reset to 'Docked(same vessel)' but having remained docked to the corresponding other port) and therefore that pod still uses engines at the same time of the ship. Parts 501 and 570 being now marked as having the root part as parent (though being not attached) brings to a situation that KSP is then unable to manage if the scene is reloaded.

Normally similar issues could still be solved resetting by hand the docking ports; but this time KSP didn't even generate a vessel; may still try to solve manually deleting each single part of the detached fuel pod from the savegame, if not else to allow you to keep going with the game. Can't promise it will be successful; but before starting doing so, please let me know what is the situation you wish with that ship (seeing the pods are filled with fuel, they are probably not yet to be detached but intended to be used).

 

Link to comment
Share on other sites

On 5/13/2017 at 5:08 PM, diomedea said:

Must say, never found this bug before. Really doesn't seem related to MechJeb, the trouble while undocking shows even while the plugin isn't loaded (MechJeb parts have to because vessels won't load without, but can't cause harm). It seems when the fuel pods docked, KSP got confused and didn't set correctly all relationships with parts of those fuel pods then belonging to the docked vessel. Sketched a graph showing these relationships for parts involved using data from your savegame.

  Reveal hidden contents

NyKMVus.png

Numbers are the ID of each part (0 would be for the root part with the vessel). This chain starts from the size3 tank (ID = 191) where 4 attachment points are radially attached in symmetry, with large adapters and then docking ports over them. With the fuel pods docked, the chain continues from the coupled docking ports, large adapters and attachment points, to arrive at the size3 tanks with each pod (each one carrying a now unused attachment point). Somehow KSP got things wrong (probably due to how those pods were assembled) and didn't set the relationships shown by a red arrow, between attachment points and size3 tanks (in the savegame those show as nil, instead of pointing at the correct ID for the attached part).

Though unclear how the above could bring to the issue, tried editing the savegame with the correct values. Unfortunately my try didn't work, with or without MechJeb still the issue shows; what follows is KML analyzing a savegame just after a unsuccessful undocking, showing the docking Port (with ID#501) having invalid data, plus the opposite attachment node on the same fuel pod being now wrongly attached. Interestingly, another vessel identical to the one with the 4 fuel pods (but still not detached) is also reported to have a problem with a docking port (probably caused by the double link with the mirrored ports, stock KSP isn't able to manage double links).

BmmdWDo.png

I'm guessing something similar to the error with attachment points not correctly tied to those size3 tanks happens not only while docking, but undocking too. Indeed, undocking makes for all parts with the detached vessel to reverse parentship again, starting from the root part down; whatever caused KSP to not set ties correctly when docking seems to occur again. Therefore, even if I had the link for the attachment point corrected (parts 503-504) still this causes part 570 to go detached from the fuel pod and remain logically tied to the ship.

Possibly the error that occurs at undocking (NullReferenceException: Object reference not set to an instance of an object) is due to this; certainly something prevents the new vessel to be generated (therefore the above exception) with consequences with all the concerned parts. KML shows the fuel pod still being a part of the ship (as confirmed by the docking ports not being reset to 'Docked(same vessel)' but having remained docked to the corresponding other port) and therefore that pod still uses engines at the same time of the ship. Parts 501 and 570 being now marked as having the root part as parent (though being not attached) brings to a situation that KSP is then unable to manage if the scene is reloaded.

Normally similar issues could still be solved resetting by hand the docking ports; but this time KSP didn't even generate a vessel; may still try to solve manually deleting each single part of the detached fuel pod from the savegame, if not else to allow you to keep going with the game. Can't promise it will be successful; but before starting doing so, please let me know what is the situation you wish with that ship (seeing the pods are filled with fuel, they are probably not yet to be detached but intended to be used).

 

This is incredibly helpful, thank you for putting so much effort into this.  One thing I was wondering is did I corrupt my entire game file now, or is it just this ship will always have undocking issues but other ships would be fine?  I have quick saves of this game from before launching this ship, so I can revert to those so no need to manually edit the docking ports out to try and preserve the game.  I guess I will just call this mission a loss and continue on in this world hopefully without errors.

Thanks for giving it your best shot!  I didn't expect getting this level of help and I really appreciate it, I'm glad I could somehow produce an interesting error for you haha.

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