Advanced Question When exactly do docking ports update position?

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
Part of the problem was described here, and I'm still trying to figure out how docking ports exactly work, even if there are no attachment points involved.

If I undock a vessel and redock it to another vessel to a docking port that just has been created, all in the same function, the vessel does not seem to update its position. Ok, so I store all the information, wait for the next pre-step, and then redock it. Works. But now I'm faced with another problem, but first let me explain what exactly I'm doing:

In IMS, you dock modules together, then "integrate" them one by one. Integration reads the properties of the module from a config file, adds those properties and the module's mesh to the main vessel, copies its docking ports over, and then deletes the module. Of course, any module previously docked to the integrated module now isn't docked anymore (since the vessel it's been docked to has been deleted), but has to be redocked manually, which is very tedious.

Enter the above explained function, the problem, and the fix, so the leftover module gets docked to the copied docking port on the main vessel.

It all works nicely enough, until the situation gets complex. Now modules are left dangling in space for a frame, and some of them autodock with another module that's been left dangling before they can redock to the main vessel. Enter trouble as you haven't known it. Situations can get so convoluted that they seem to be able to crash on saving.
the crash described in my last post... the last line written is always the one before where the dockinfo is supposed to be, so I have good reason to believe that something manages to crash the writing of the dockinfo line. Add to this that it only happens in the most convoluted circumstances where there's even a chance of circular docking, and it seems very likely that the problem has to do with docking ports.

I know, circular docking is supposed to be impossible, but since I do not know when and how the ports exactly update, I could imagine it to lead to trouble if too many docking operations on the same vessel happen in the same function. And the crash also happens when I save with scenario editor in the situation I know would cause a crash in autosave, at the very same position, so something with those ports must be wrong. Something that orbiter survives on runtime, but that crashes it when it tries to save.

EDIT2: Sorry, no circular docking after all. I jumped a module in the chain and noticed it when double- and tripple checking. There's a lot of stuff to check... but I still have to solve the general problem.

Being able to disable autodocking could be a potential solution to this, but there seems to be no possibility to do that. So it would be very helpful to know how and when exactly docking ports update their and their docked vessel's position, so I can maybe maneuver between them updating and autodocking. Or, something else that might solve the problem entirely would be an option to force a docking port to update a docked vessel's position without undocking and redocking it, but for that again I need more knowledge on how these things work.

I know the docking ports were not designed with this kind of abuse in mind. Understanding how they actually work might help me to not abuse them quite as hard... :shifty:
 
Last edited:

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
What exactly do you mean by circular docking?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
x docked to y docked to z docked to w docked to x.

EDIT: Sorry, my fail. I jumped a module in one of the possible chains, of course exactly the one where the chain was broken (it couldn't happen to me at any other module, now could it?). So, no circular docking after all, that's at least something. But the other problems I have still persist (including ctd on saving in those circumstances), so any advice on how the updating of docking ports and connected vessels exactly works is still highly appreciated.

---------- Post added at 01:15 PM ---------- Previous post was at 10:50 AM ----------

This is interesting... when you run out of ideas to try, you try that stuff that was always there but you couldn't imagine that it would change anything. In this case, calling Dock from the center vessel using attachment mode 1 instead of calling it from the recently undocked vessel using mode 2. As far as I can see from the documentation and a few additional experiments I conducted, there really shouldn't be a difference between the two. But in my case it's the difference between working (almost) perfectly and total carnage... :shrug:
 
Last edited:
Top