Jump to content

[1.9.*, 1.10.*] DockRotate - lightweight robotics - rotational control on docking ports (plus NodeRotate, make any part rotate)


Recommended Posts

4 hours ago, peteletroll said:

What kind of problem, @linuxgurugamer? No undocking?

Just bigvref messages saying docking put was bugged.  

I got your latest update, will try the same thing again later to get logs if it happ er ns again 

Link to post
Share on other sites
5 hours ago, peteletroll said:

What kind of problem, @linuxgurugamer? No undocking?

Well, I just tested using the same craft file which game me an error message last night, no issues now.  So either the game was bugged or it was fixed.

I'll try to grab the log file next time it happens (if it does)

Link to post
Share on other sites
56 minutes ago, linuxgurugamer said:

So either the game was bugged or it was fixed

Docking ports used as decouplers were incorrectly marked as bad by the previous version. This is fixed now.

Link to post
Share on other sites
31 minutes ago, peteletroll said:

Docking ports used as decouplers were incorrectly marked as bad by the previous version. This is fixed now.

And that was exactly what the ship was doing.

thanks

Link to post
Share on other sites

Really love this mod!. I have recently started a new game in 1.8.1 (RSS/RO) and was wondering if the newest releases (which are marked as 1.9.x only) are compatible with 1.8. Would love to get the highlighting features!

Link to post
Share on other sites
2 hours ago, peteletroll said:

@pt1243, it could. No time to try now, but if you start a temporary sandbox you can try it safely. Share your results of you do! I'll update the post title accordingly.

Great, I'll take a look and let you know.

Link to post
Share on other sites

No issues in game, and the logs reported no errors!

I did notice a small issue when playing around with it in game (but not related to the version, I think). When the part is rotating, there is a bit of overlap in the PAW as the "stop rotation" button appears but does not shift the other buttons down (see https://imgur.com/a/mQSLqNj). Not sure how difficult this is to fix (if at all possible), but if so, it would be a nice little tweak.

Link to post
Share on other sites
  • 2 weeks later...

New release!

The docking port state checks are fully configurable in file PluginData/DockingStateChecker.cfg:

Spoiler

DockingStateChecker // reloaded at every check, edits effective without restarting KSP
{
    enabledCheck = True
    enabledFix = True
    checkDelay = 5
    messageColor = 1,0,0,1
    messageTimeout = 3
    messageStyle = UPPER_CENTER
    highlightColor = 1,0,0,1
    highlightTimeout = 5
    NodeState // this undocked state is allowed
    {
        state = Ready
        hasJoint = False
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Acquire
        hasJoint = False
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Acquire (dockee)
        hasJoint = False
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Disengage
        hasJoint = False
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Disabled
        hasJoint = False
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Docked (docker)
        hasJoint = True
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Docked (dockee)
        hasJoint = True
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = Docked (dockee)
        hasJoint = True
        isSameVessel = True
    }
    NodeState // this undocked state is allowed
    {
        state = Docked (same vessel)
        hasJoint = True
        isSameVessel = True
    }
    NodeState // this undocked state is allowed
    {
        state = PreAttached
        hasJoint = True
        isSameVessel = False
    }
    NodeState // this undocked state is allowed
    {
        state = PreAttached
        hasJoint = False
        isSameVessel = False
    }
    JointState // this docked pair state is allowed
    {
        hostState = PreAttached
        targetState = PreAttached
        isSameVessel = False
    }
    JointState // this docked pair state is allowed
    {
        hostState = Docked (docker)
        targetState = Docked (dockee)
        isSameVessel = False
    }
    JointState // this docked pair state is allowed
    {
        hostState = Docked (dockee)
        targetState = Docked (docker)
        isSameVessel = False
    }
    JointState // this docked pair state is allowed
    {
        hostState = Docked (same vessel)
        targetState = Docked (dockee)
        isSameVessel = True
    }
    JointState // this docked pair state is fixable
    {
        hostState = Docked (dockee)
        targetState = Docked (dockee)
        isSameVessel = False
        hostFixTo = Docked (docker)
        targetFixTo = 
    }
}

I tried to make the configuration file as self-documenting as possible.

The file is read at every check, so you can modify it and see the changes without restarting KSP: just change it, and timewarp a little. If you mess up, delete it, and it will be recreated at the next check (again, timewarp).

You can customize the colors and the visualization time. If you find it troublesome, just disable it with the enabledCheck and enabledFix parameters.

The checker helped me recover a few ships in my current career, and I'm publishing it in the hope it can help others: fixing a large career file with a text editor is doable, but difficult and dangerous.

Feedback please! We can expand the set of fixable situations. Logs needed, as usual...

Link to post
Share on other sites
1 hour ago, Angel-125 said:

Does the docking state checker fix situations where you try to undock and your vessels are stuck together?

It should. If it doesn't, send a log file.

Link to post
Share on other sites
12 minutes ago, peteletroll said:

It should. If it doesn't, send a log file.

Awesome, thanks! That happened to me recently and it's a pain to fix. Also looking forward to using NodeRotate on the Mk-33's launchpad parts- almost to the point where I'll be making those. :)

Link to post
Share on other sites
On 7/31/2020 at 3:41 AM, peteletroll said:

Working fine on 1.10.1.

I'm wondering if you can help diagnose an issue i'm having with NodeRotate. Here is what I am trying to do:

GQ3PX8b.png

I'm building a strongback for my Mk-33. The strongback needs to rotate from horizontal to vertical. The Mk-33 is docked to the strongback via a docking port. If you look in the picture there is a small cylinder at the bottom of the strongback where it rotates. The strongback is node-attached to the fuel tanks via its "bottom" node.

Here is the config:

Quote

...

    node_stack_bottom = 0.0, -12.86728, 0.0, 0.0, -1.0, 0.0, 3

...

    MODULE:NEEDS[DockRotate]
    {
        name = ModuleNodeRotate

        // find node name in part cfg file, and remove the "node_stack_" prefix, or use srfAttach
        rotatingNodeName = bottom
        smartAutoStruts = True
        soundClip = DockRotate/DockRotateMotor
        soundVolume = 0.5
        soundPitch = 1.0
        electricityRate = 1.0
    }

This is the error I get:

Quote

[LOG 15:49:30.353] [DR:67112] DockRotate.VesselMotionManager+StructureChangeInfo.reset() OffRails after
[LOG 15:49:30.354] [DR:67112] MDR:Mk33DockingNoseCone:1092236617.doSetup(): joint null
[LOG 15:49:30.354] [DR:67112] JointMotion.get(): created JM:-2114376:mk33Strongback:3469451444>>>Mk33AftTank:338636960
[LOG 15:49:30.355] [DR:67112] JM:-2114376:mk33Strongback:3469451444>>>Mk33AftTank:338636960.updateOrgRot(): 0°
[LOG 15:49:30.356] [DR:67112] MDR:Mk33AftTank:338636960.doSetup(): joint PJ:-2105790:mk33Strongback:3469451444>>>Mk33AftTank:338636960
[LOG 15:49:30.357] [DR:67112] MNR:mk33Strongback:3469451444.findMovingJoint(): has DockRotate, NodeRotate disabled
[LOG 15:49:30.357] [DR:67112]     ... .doSetup(): joint null
[LOG 15:49:30.358] [DR:67112] MDR:mk33Strongback:3469451444.doSetup(): joint null
[LOG 15:49:30.359] [DR:67112] JointMotion.get(): created JM:-2114378:wbiMk2DockingPort:2919419585>wbiMk2DockingPort:3259406087
[LOG 15:49:30.360] [DR:67112] JM:-2114378:wbiMk2DockingPort:2919419585>wbiMk2DockingPort:3259406087.updateOrgRot(): 0°
[LOG 15:49:30.360] [DR:67112] MDR:wbiMk2DockingPort:3259406087.doSetup(): joint PJ:-2105738:wbiMk2DockingPort:2919419585>wbiMk2DockingPort:3259406087
[LOG 15:49:30.361] [DR:67112] JM:-2114378:wbiMk2DockingPort:2919419585>wbiMk2DockingPort:3259406087.updateOrgRot(): 0°
[LOG 15:49:30.362] [DR:67112] MDR:wbiMk2DockingPort:2919419585.doSetup(): joint PJ:-2105738:wbiMk2DockingPort:2919419585>wbiMk2DockingPort:3259406087
[LOG 15:49:30.363] [DR:67112] MDR:wbiMk2DockingPort:2594712529.doSetup(): joint null
[LOG 15:49:30.363] [DR:67112] MDR:wbiMk2DockingPort:675074638.doSetup(): joint null
[LOG 15:49:30.364] [DR:67112] [DockingStateChecker] loading C:\KSPDev\GameData\DockRotate\PluginData\DockingStateChecker.cfg
[LOG 15:49:30.367] [DR:67112] [DockingStateChecker] loaded
DockingStateChecker:
    NodeState:state=Ready:hasJoint=False:isSameVessel=False:nodeFixTo=
    NodeState:state=Acquire:hasJoint=False:isSameVessel=False:nodeFixTo=
    NodeState:state=Acquire (dockee):hasJoint=False:isSameVessel=False:nodeFixTo=
    NodeState:state=Disengage:hasJoint=False:isSameVessel=False:nodeFixTo=
    NodeState:state=Disabled:hasJoint=False:isSameVessel=False:nodeFixTo=
    NodeState:state=Docked (docker):hasJoint=True:isSameVessel=False:nodeFixTo=
    NodeState:state=Docked (dockee):hasJoint=True:isSameVessel=False:nodeFixTo=
    NodeState:state=Docked (dockee):hasJoint=True:isSameVessel=True:nodeFixTo=
    NodeState:state=Docked (same vessel):hasJoint=True:isSameVessel=True:nodeFixTo=
    NodeState:state=PreAttached:hasJoint=True:isSameVessel=False:nodeFixTo=
    NodeState:state=PreAttached:hasJoint=False:isSameVessel=False:nodeFixTo=
    JointState:hostState=PreAttached:targetState=PreAttached:isSameVessel=False:hostFixTo=:targetFixTo=
    JointState:hostState=Docked (docker):targetState=Docked (dockee):isSameVessel=False:hostFixTo=:targetFixTo=
    JointState:hostState=Docked (dockee):targetState=Docked (docker):isSameVessel=False:hostFixTo=:targetFixTo=
    JointState:hostState=Docked (same vessel):targetState=Docked (dockee):isSameVessel=True:hostFixTo=:targetFixTo=
    JointState:hostState=Docked (dockee):targetState=Docked (dockee):isSameVessel=False:hostFixTo=Docked (docker):targetFixTo=

[LOG 15:49:30.394] [UIMasterController]: ShowUI
[LOG 15:49:30.506] [DR:67115] analyzing incoherent states in Skyranger
[LOG 15:49:30.506] [DR:67115] [DockingStateChecker] MDN@3469451444_mk33Strongback<338636960>0:"":dj=PJ[0],
    unallowed node state "".isTree
[LOG 15:49:30.507] [DR:67115] [DockingStateChecker] MDN@338636960_Mk33AftTank<223737901>0:"PreAttached":dj=PJ[-2105790:3469451444>>>338636960],
    unallowed couple state "">"PreAttached".isTree

Unfortunately I don't know enough about NodeRotate other than it's magic and it works. Can you help? Which axis does the NodeRotate work on?

Edited by Angel-125
Link to post
Share on other sites
Posted (edited)

@Angel-125, I'm leaving for holidays tomorrow, so I'll be away from my PC for a couple weeks.

Anyway, I see a few things in the config and log you posted.

"MODULE:NEEDS[DockRotate]" doesn't look like a valid MM syntax: there should be at least a "@" before MODULE. My advice is to separate the part definition and the optional NodeRotate configuration: write a PART { } section ignoring the NodeRotate module, and a separate section like the one in the example file NodeRotate.cfg included in DockRotate distribution.

Quote

PART
{
    name = mk33Strongback
    node_stack_bottom = 0.0, -12.86728, 0.0, 0.0, -1.0, 0.0, 3
    ...
}

@PART[m33Strongback]:NEEDS[DockRotate]
{
    MODULE
    {
        name = ModuleNodeRotate
        ...
    }
}

 

"[LOG 15:49:30.357] [DR:67112] MNR:mk33Strongback:3469451444.findMovingJoint(): has DockRotate, NodeRotate disabled": DockRotate only supports a single NodeRotate or DockRotate module per part, and DockRotate module gets added on every part that has a docking node, so you can't add a NodeRotate module on a part that has a docking node.

"[LOG 15:49:30.506] [DR:67115] [DockingStateChecker] MDN@3469451444_mk33Strongback<338636960>0:"":dj=PJ[0],
    unallowed node state "".isTree": this is weird, looks like the DockingNode module is not properly set up, because it has a bad state (an empty string); check the log, maybe there's something about it.

The axis NodeRotate uses is specified by the fourth, fifth and sixth number in the "node_stack_bottom = ..." line.

Hope this helps!

Edited by peteletroll
Link to post
Share on other sites
8 hours ago, peteletroll said:

@Angel-125, I'm leaving for holidays tomorrow, so I'll be away from my PC for a couple weeks.

Anyway, I see a few things in the config and log you posted.

"MODULE:NEEDS[DockRotate]" doesn't look like a valid MM syntax: there should be at least a "@" before MODULE. My advice is to separate the part definition and the optional NodeRotate configuration: write a PART { } section ignoring the NodeRotate module, and a separate section like the one in the example file NodeRotate.cfg included in DockRotate distribution.

 

"[LOG 15:49:30.357] [DR:67112] MNR:mk33Strongback:3469451444.findMovingJoint(): has DockRotate, NodeRotate disabled": DockRotate only supports a single NodeRotate or DockRotate module per part, and DockRotate module gets added on every part that has a docking node, so you can't add a NodeRotate module on a part that has a docking node.

"[LOG 15:49:30.506] [DR:67115] [DockingStateChecker] MDN@3469451444_mk33Strongback<338636960>0:"":dj=PJ[0],
    unallowed node state "".isTree": this is weird, looks like the DockingNode module is not properly set up, because it has a bad state (an empty string); check the log, maybe there's something about it.

The axis NodeRotate uses is specified by the fourth, fifth and sixth number in the "node_stack_bottom = ..." line.

Hope this helps!

Thanks, I didn't realize that DockRotate was added to every part that has a docking port, but that totally makes sense. it sounds like I need to tweak things so that I get the node rotate on the right node and remove the added dock rotate. Thanks again! :)

Link to post
Share on other sites

Given how wobbly the robotics parts are, DockRotate is a welcome relief. It also makes me wonder why stock robotics can't have stiffer joints. Anyway, now that I understand how DockRotate works, I'm thinking of adapting my servo controller to support them :)

Link to post
Share on other sites
  • 1 month later...

I have some unexpected behaviour from DockRotate. I originally produced it in 1.9.1 but have reproduced it with a minimal mod set and craft in 1.10.1.

http://www.chiark.greenend.org.uk/~damerell/games/ksp/dockrotate/ contains the craft and what I think are now the normal log files to send. I have not played KSP for some years and if there is anything else that is needed please let me know.

The mods installed (via CKAN) are DockRotate, Module Manager, Precise Editor (to allow exact positioning of the second docking port), and HyperEdit (which I didn't use).

To reproduce the issue, put the craft on the runway. Rotate the attached pair of ports 90 degrees so as to put the other pair of ports in alignment. The first oddity emerges when only one of the second pair has "Undock" in its right-click menu. Now "Decouple Node" on the first pair of ports. The rotation controls for the second pair of ports are present, but clicking "Rotate Clockwise" and "Rotate Counterclockwise" does nothing. I would expect now the first pair is uncoupled, the structure can be rotated away from them using the second pair of ports.

Another oddity can be produced by rotating the structure so that both pairs of ports are aligned in the SPH. On launch, DockRotate immediately complains (illuminates in red, shows "Bad state" in right-click menu) the second pair of ports, although it is not obvious to me why they should be in a forbidden state.

 

I originally had difficulty in 1.9.1 with the 1.9.1 DockRotate on a vessel with mirror symmetry - ie, with two of these rotating girder arrangements. With the 1.9.1 DockRotate, the second pair of ports typically didn't appear to dock at all. I tried with the 1.10.1 DockRotate (still in 1.9.1) and produced the symptoms you see here.

Other odd behaviour (which seemed intermittent, although the one constant was that the setup never worked as expected) - sometimes the second pair of ports docks, but immediately Krakens off into the void. Sometimes if you first try on one side of the ship, then the other, you find that now the first side of the ship can be rotated as you would expect. Sometimes on hitting "decouple node", it turns out the other docking port has been pulled off the ship and the whole structure falls off. I mention all this in the hope it may be of some help in debugging.

Link to post
Share on other sites

@damerell, same vessel docking is a DockRotate gray area. I'll probably have to investigate some more into it.

Anyway, I use it in my gameplay, and it can work, with some precautions.

- The motion that brings the second pair together must be small: in your example craft, you get less Kraken if you rotate 75°, then stop, then 15°, than if you rotate all 90° in a single motion;

- As soon as the motion is finished, and the secondary ports are docked, force a reload of the ship: you can F5/F9, or switch to a far away craft and back.

This keeps the Kraken away from my games, I hope it helps you too.

I'll try to fix this, no promises but stay tuned.

 

15 hours ago, damerell said:

The first oddity emerges when only one of the second pair has "Undock" in its right-click menu.

This is normal.

16 hours ago, damerell said:

Another oddity can be produced by rotating the structure so that both pairs of ports are aligned in the SPH. On launch, DockRotate immediately complains (illuminates in red, shows "Bad state" in right-click menu) the second pair of ports, although it is not obvious to me why they should be in a forbidden state.

Couldn't replicate this. What happens if you force a craft reload (see above)?

Link to post
Share on other sites

I've tried the F5-F9 thing. (I was already turning it cautiously, because in my 1.9 game the part being rotated is extremely heavy). Not many Krakenings... but the second pair of ports still doesn't rotate. (It strikes me that maybe it doesn't for you either and that is what you are investigating, in which case, sorry for effectively a duplicate bug report).

I can't replicate the second oddity either. I suspect it's another one of those intermittent issues.

Edited by damerell
aa
Link to post
Share on other sites

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