KSPModdingLibs / KSPCommunityFixes

Community patches for bugs in the KSP codebase
50 stars 17 forks source link

Undocking a double docked vehicle from another while landed causes entire vehicle to accelerate upward #207

Open StormCircuit opened 7 months ago

StormCircuit commented 7 months ago

This is difficult to describe, see the screenshots:

In the editor, the docking port on the right is the real connection. My mouse is hidden but it is over the lower right hand docking port. So the root part is within the little rover hanging under.

20240226141858_1

20240226142122_1

When undocking the 'real' connection, KSP decides to recreate project orion and instantly shoot the vehicle into the air as if it magically received some kind of force impulse: (note: phys warp is on but set to 0.25x with better timewarp. This was occurring regardless of timewarp)

20240226140032_1

Zip file contains ksp log and craft file. Let me know if I can provide this in a better way.

KSP.zip

StormCircuit commented 7 months ago

Changing the root in the editor did not change the behavior

reducing the configuration to a singular docking port however did fix the issue

JonnyOThan commented 7 months ago

@StormCircuit It would be useful to provide a craft file that reproduces the issue only using stock parts.

gotmachine commented 7 months ago

Can reproduce with the following stock craft : image UndockBouncer.zip

The "master" docking port is under the flag, undocking it will indeed impart a large upward force on the vessel (mapped to action group 1 for easier repro). This reproduce on the launchpad, and on any other terrain.

However, this only reproduce when the decoupled vessel has wheels touching the ground at the time of decoupling. I could not reproduce it after replacing the wheels with landing legs nor with a generic structural part, nor when the wheels are nudged up a bit so they don't initially touch the ground.

This also reproduce when using a decoupler (with zero decoupling force) instead of a docking port (with a second docking still used to close the loop) : image DecoupleBouncer.zip

Hard to say what is exactly going on, but my guess would be wheel colliders somehow being reset to their fully extended position under those specific conditions, causing an intersection with the ground and consequently a large pushback force being generated. But from a quick look I fail to see what is the exact code path involved.