Jump to content

Docking mod


Pleborian

Recommended Posts

Hmm, it would be very difficult to dock/undock without imparting energy. Ideally, the craft your essentially driving into would have an automatic RCS system to keep it steady, which would work best with a grapple system so that instantaneous forces acting upon it would never need to exceed its thrust capacity. But that wont happen, so you'll have to make any corrections once the docking is complete, with either craft. Fortunately, if your gentle, it shouldn't be too bad. And if you dock small to large, then the bigger the large craft the less it matters. Undocking is a bit better. Just let go and use your RCS system to back off, using short bursts. Ideally your RCS system would not have any thrusters too close to the other craft, so that they don't push it.

I was thinking more about how close can a sattelite be when I go flying past it with 3 big rocket engines at full power, without blowing it up or knocking it out of orbit. I'm guessing its actually pretty close, but I can't say for sure.

Link to comment
Share on other sites

Indeed. it does! When he comes out of timewarp the peices are a bit crooked, and the snap back together again in the same fashion that they do when they dock. I'm impressed that it works, but after a long warp, they might be too far apart for the snap to work, or if it does, it might pull the parts back together too violently.

I don't know if it's exposed in the modding API but in general physics engine can change an object's position and velocity without applying any force.

Link to comment
Share on other sites

I don't know if it's exposed in the modding API but in general physics engine can change an object's position and velocity without applying any force.

So is it possible to record the relative position between the lander and the dock when the time-compression starts and then keep this relation during the warp until the time-compression is back to 1x?

Edited by HoneyFox
Link to comment
Share on other sites

Indeed. it does! When he comes out of timewarp the peices are a bit crooked, and the snap back together again in the same fashion that they do when they dock. I'm impressed that it works, but after a long warp, they might be too far apart for the snap to work, or if it does, it might pull the parts back together too violently.

That "snap" is when the game reevaluates the physics of the spacecraft. It's the same jerk that can take place at the time of launch, as well as during the game from time to time (like when you come out of warp, or when you are launching and climbing and the game's physics reevaluates). It shouldn't rip the spacecraft apart at all - it would just tend to be annoying at times.

Link to comment
Share on other sites

Fantastic!

Have a fast check of the codes. Looks like it is recording the relative position and repeatedly setting the ship's position according to that, just like what i guessed before.

But well, i'm just guessing but you are the man who achieved this. Thank you!

EDIT:

advice: make the nearestDistance as a public member of the class so it can be tweaked via part.cfg. So that we can avoid wrong docking position when we have multiple docks nearby.

Also, can you add some angle check of the docks. Like calculating the normalized direction vector of both docks. If the value is bigger than -1 to some degree (also we can setup this threshold in part.cfg), then the docking request will be rejected because the angle is not good enough.

Edited by HoneyFox
Link to comment
Share on other sites

Fantastic!

Have a fast check of the codes. Looks like it is recording the relative position and repeatedly setting the ship's position according to that, just like what i guessed before.

But well, i'm just guessing but you are the man who achieved this. Thank you!

It repeatedly moves both ships into position when in warp mode but it uses a fixed physical joint in real time mode. I'll be looking into pack/unpack and save/load in the morning, New Zealand time, that should allow switching away from the area.

Link to comment
Share on other sites

It repeatedly moves both ships into position when in warp mode but it uses a fixed physical joint in real time mode. I'll be looking into pack/unpack and save/load in the morning, New Zealand time, that should allow switching away from the area.

Ah...is that joint the source of the traction force which helps to merge the two ships? or is the joint created after they're merged?

Anyway, I guess fuel transfering may be doable via this dock system. But I don't know if the game engine allows changing fuel amount in a part of other ship. If the refuel function (actually it's the consuming fuel function called with a negative parameter IIRC) is exposed to other classes, it can be done.

Edited by HoneyFox
Link to comment
Share on other sites

erkle64

Your mod is awesome! I think you should create a thread in this section of the forum so that everyone could see it :)

http://kerbalspaceprogram.com/forum/forumdisplay.php/38-Plugin-Powered-Addon-Releases

GCBgHl.png

The only issue I've found is that the docking ports wobble when turning the ship or engines running - it would be great to strengthen the connection so that the docked ships would behave like a solid construction :)

But this mod is great anyway, I can now simulate Apollo mission.

Link to comment
Share on other sites

erkle64

SNIP... it would be great to strengthen the connection so that the docked ships would behave like a solid construction :)

It's not a matter of strength and there is no connection as far as the game is concerned, the code just keeps resetting the position of the clamps(and the ships connected to them) repeatedly so they are end to end. So it can't be made "stronger".

Still epic.

Link to comment
Share on other sites

It's not a matter of strength and there is no connection as far as the game is concerned, the code just keeps resetting the position of the clamps(and the ships connected to them) repeatedly so they are end to end. So it can't be made "stronger".

Still epic.

Actually, he did say that he uses a physical joint while the game is in physics mode. It only sets the position of the other ship when warping, because then theres no physics around to help you with that sort of stuff.

Link to comment
Share on other sites

Thanks heaps for the feedback. I'll be ironing out a couple issues and adding a few features today, then I'll post it in the addon release section.

This isn't the docking mod from the OP, I just got impatient and made one myself last night.

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