Jump to content

[Tutorial] Soft-Docking Docking Ports


curtquarquesso

Recommended Posts

Almost on accident, I've figured out how to take advantage of the acquireForce/docking port magnetism, and animated colliders, to make docking ports soft-dock before they hard dock.

Both the Apollo and the Soyuz "soft-dock" before they hard dock. In KSP, the advantage to soft-docking before hard-docking, is that you can rotate your spacecraft to the desired orientation, before you commit to a hard-dock, and join the spacecraft together.

Real Life and In-Game Demonstrations

Scrub to 17:52 in the ESA video...

4xpMUO0.gif

9pq93Vm.png

WI356XJ.gif

Beta Dropbox Download (When you download, please try to break it and make it do ugly things so I can make it better.)

Basically, what you're seeing is a basic collision mesh extending and retracting with the probe meshes in Unity. In game, when the probe is extended, and the two docking ports come within their acquire range, the magnetism kicks in, and brings the two docking ports together, but is prevented from docking by the collider in the way. The player can then rotate their spacecraft to their liking, then retract the docking probe, retracting the collider, and allowing the mating faces and dockingNode empties to connect and register as docked.

This all came from revamping some docking ports from Beale's Tantares add-on pack. Next up will be some APAS ports. I don't have models for them yet, but I know how I'm going to make them work in Unity I believe.

Just wanted to share this technique with you all. Might make docking more realistic, and more forgiving. No more hoping you're rotated perfectly, and having to perform multiple docking to get your rotation juuust right. Now, you can take all the time in the world, and make it look awesome to boot.

Discuss. :)

Full Modeling credit to Beale, author of the Tantares add-on.

Edited by curtquarquesso
Link to comment
Share on other sites

Way too cool :)

I suspect that for the APAS docking ports, since they don't really have a probe to provide sufficient distance by themselves for soft-docking in KSP, you're looking into also tweaking the acquireRange and captureRange parameters to suit?

Link to comment
Share on other sites

Way too cool :)

I suspect that for the APAS docking ports, since they don't really have a probe to provide sufficient distance by themselves for soft-docking in KSP, you're looking into also tweaking the acquireRange and captureRange parameters to suit?

I may not have to by the looks of it. If you look at where the extending probe collider is, it doesn't extend very far above the mating surface really. If you look at the APAS-95 and APAS-89 designs, the active docking ring doesn't extend too far from the structural ring either, so I think my probe collider might be near the right place already. Shouldn't have to tweak the forces much if at all.

I think I may add some challenge to the APAS ports by making the guide fins have proper colliders. You won't have to spin around to align, the guide fins should do it for you.

Link to comment
Share on other sites

It's still not showing up. I just put the file in the game data folder.

These are beta parts for the Tantares add on, so you're going to put them in the Tantares folder. Make sure it's installed. It's required. Place in Tantares/Parts/SOYUZ. I'll clarify in the front page.

Remember, this is really a demo of the whole idea of soft docking in general. The parts matter not really. I want to see if it's useful, if people like it, and more importantly, if it causes any grief that would make it a bad idea for add-on authors to implement in their own docking port designs.

Link to comment
Share on other sites

Is there a chance to make a plugin for other Dockingports such as Raidernicks Soyuz-Dockingports or CBMs?

No. No plugins are required for this. If you look at how it's done in Unity, it'll all tricky collider animation. Only way it works is if they're built and animated that way.

The goal of this thread is to show people how to do it in Unity so they can make their own variations.

Link to comment
Share on other sites

Hey all,

I have a question regarding the config file for this thing:



MODULE
{
name = ModuleDockingNode
deployAnimationController = 1
referenceAttachNode = top
nodeType = size1
}

MODULE
{
name = ModuleAnimateGeneric
animationName = ProbeExtend
actionGUIName = Toggle Docking Probe
startEventGUIName = Extend Probe
endEventGUIName = Retract Probe
allowAnimationWhileShielded = False
}

The question is, does referenceAttachNode conflict with deployAnimation controller? Is there any reason I can't have a docking port with a fixed dockingNode have an animation that is only allowed to be toggled while it's in the undocked state? I have a feeling that you can't have a docking port that has a referenceAttachNode that also has a deployAnimationController, as none of the stock ports are this way either.

TL;DR: I need to make sure the animation can't be toggled while the docking port is in the docked state, just like the stock animated Clamp-O-Trons.

Link to comment
Share on other sites

Soyuz Docking Mechanism Update: (Copy/paste from the Tantares thread.)

So, I've run into a road block.

As Beale pointed out, if you do not follow instructions, and extend the probe while docked, and then undock, or load the scene in that state, the spacecraft explodes just a little... Because of that possibility, I've tried to dummy-proof the docking ports. Granted, it's really not that hard to use the docking ports properly, because if you dock normally, you'll never need to extend the probe while docked, and all will be fine, but, for the sake of safety, I've tried

The verdict is complicated: In the stock Shielded Clamp-O-Tron .cfg file, there's a parameter called deployAnimationController = 1 When 1 is a value for this, the docking port will not be allowed to animate while docked. In game, this is why you can't open or close the inline, Mk2, and shielded docking ports while docked.

The issue is this: This parameter activates in the acquire/magnetism stage of docking, not in the docked stage. This means, that if I enable this parameter, once you're soft-docked, you can no longer retract the probe to hard-dock. I experimented with stock Clamp-O-Trons and confirmed my suspicions.

2BtIZePl.png

As you can see here, the docking ports are trying to dock, but the I-Beams are in the way. While they're separated, I can't close the shields in the same way I can't retract the probe on my ports. Very frustrating.

Unfortunately, without writing a crazy plugin, there are limitations within the game that make dummy-proofing the ports difficult. As soon as the ports acquire, you can't retract the probe.

I'm actually thinking about sending a message to one of the KSP devs about this. If they made the deployAnimationController activate when ACTUALLY docked, instead of when you're in the acquire stage, it could allow further development of add-on soft-docking ports.

Any thoughts?

Link to comment
Share on other sites

Go ahead and send them a message about it. Would be nice if they would listen... or maybe even start thinking about implementing soft docking into stock KSP. IMHO that´s how docking should work.

I'm not looking for support so much, as I'm looking for a way to find a loophole in the way things currently work.

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