Jump to content

Simple mod request: make control surfaces not respond to attitude control when not in atmosphere


Recommended Posts

I remember a thread moons ago, that asked the question how the engines and control surfaces moved even with no air/ throttle/ or electrical power.

Various options given included string or wires, or quantum entanglement.

The best answer given was: Code.

 

However it would be nice, even if a mod sorted this out, that Squad did a pass to resolve it 1.3.1?

Peace.

Link to comment
Share on other sites

@Claw's  Stock Bug Fixes (or more accurately, the StockPlus part of it) already added this functionality, I think both for control surfaces and engine gimbals (not mentioned in the description, but I seem to remember seeing it in 1.1.3):

On 10/18/2014 at 10:08 AM, Claw said:

disabling flight control surfaces when in space (so they aren't moving around when maneuvering)

The thread doesn't seem to have anything newer than for 1.1.3. But you could have a peek at that code if you plan taking it on yourself.

Link to comment
Share on other sites

On 4/30/2017 at 1:41 PM, theJesuit said:

I remember a thread moons ago, that asked the question how the engines and control surfaces moved even with no air/ throttle/ or electrical power.

Various options given included string or wires, or quantum entanglement.

The best answer given was: Code.

 

However it would be nice, even if a mod sorted this out, that Squad did a pass to resolve it 1.3.1?

Peace.

? Control surfaces CAN'T use air itself to move normally, because they fight AGAINST the air as a general rule. I.e. in real life, they use wires, hydraulic tubes, motors, etc. Gimbals may possibly use exhaust sometimes, but definitely at least sometimes also use motors and such (though probably fed by the propellant's energy itself). 

I.e. it would be perfectly possible in real life to operate flaps in a vacuum. The point is just that there's no reason to do so, so it looks silly, that's all. not that it's impossible. Gimbals are less likely to work at zero throttle, but sometimes might be able to depending on the design of the engine, especially smaller engines.

Link to comment
Share on other sites

On 4/30/2017 at 7:06 PM, swjr-swis said:

@Claw's  Stock Bug Fixes (or more accurately, the StockPlus part of it) already added this functionality, I think both for control surfaces and engine gimbals (not mentioned in the description, but I seem to remember seeing it in 1.1.3):

okay, so it seems that stock bug fix and stock plus work fine in 1.2 but neither actually contain the functionality that I want. Unless I'm missing something the files and code are straight up not on github.

Link to comment
Share on other sites

It would be nice if one of the action group mods included enable/disable control surface axes.  Then for instance the same action group that switches RAPIER rocket mode could disengage control surfaces (plenty of gimbal in the RAPIER itself) etc

Link to comment
Share on other sites

2 hours ago, Iamsodarncool said:

okay, so it seems that stock bug fix and stock plus work fine in 1.2 but neither actually contain the functionality that I want. Unless I'm missing something the files and code are straight up not on github.

Between 1.1.x and 1.2.x, the codebase for KSP got completely revamped. Plugin-based mods for 1.1 won't work in 1.2 without at least a recompile, if not a rewrite to some degree. I was hoping @Claw would update that mod, but no luck to date. I'm surprised KSP didn't yell at you in some manner for trying to use those mods. (Well, maybe it did in the logs... Unless KSP got smart about ignoring plugins/*.DLLs it can't run.)

Link to comment
Share on other sites

3 hours ago, Iamsodarncool said:

Unless I'm missing something the files and code are straight up not on github.

https://github.com/ClawKSP/KSP-Stock-Bug-Fix-Modules/tree/master/Source

That there is it, isn't it?

C# is not my forté, but I browsed the code. Oddly enough there doesn't seem to be any statements in the latest revision that affect the control surface movement in the way discussed here. So I dug deeper and checked the history, and sure enough, it's there in older versions:

private float vacuumRange = 1.0f; // disables flight controls when in vacuum

(...)

            if (FlightGlobals.getStaticPressure(part.transform.position) < 0.001f)
            {
                vacuumRange = 0.01f;
            }
            ctrlSurfaceRange = ControlSurfaceModule.ctrlSurfaceRange;
            ControlSurfaceModule.ctrlSurfaceRange = ctrlSurfaceRange * Authority * vacuumRange;

(...)

                if (FlightGlobals.getStaticPressure(part.transform.position) < 0.001f)
                {
                    if (vacuumRange > 0.01f)
                    {
                        vacuumRange -= 0.05f;
                    }
                    else
                    {
                        vacuumRange = 0.01f;
                    }
                }
                else
                {
                    if (vacuumRange < 1.0f)
                    {
                        vacuumRange += 0.05f;
                    }
                    else
                    {
                        vacuumRange = 1.0f;
                    }
                }
                ControlSurfaceModule.ctrlSurfaceRange = ctrlSurfaceRange * Authority * vacuumRange * Mathf.Sign(ControlSurfaceModule.ctrlSurfaceRange);

 

So the code was in there but was removed at one point, not sure why (*), and the OP was not updated to reflect that.

But as @StahnAileron mentions, the above code excerpts probably would need adapting to the 1.2 framework (and soon now, 1.3, whenever it drops) to work anyway.

 

*: I only found the following in the release thread:

Looks like it was a quick stopgap measure with the intention to add it back in soon... and then it never was.

Edited by swjr-swis
Link to comment
Share on other sites

This is something I've wanted for a while now so I just went and recompiled/deleted a bunch of stuff and I have a working version in 1.2.2. I still need to clean up a lot more junk that's left over from 1.1 (like an extra authority limiter) but I should be good to post a release by morning (Eastern Time).

xLTAmyI.png

Edited by TheRagingIrishman
Link to comment
Share on other sites

I don't have time to do a proper release so I'll just leave this here for now https://www.dropbox.com/s/m90x9d168t2oy86/MCS.zip?dl=0. Licence is CC-BY-NC-SA with lots of credit to Claw. Source is in the download. To install simply put the StockBugFix.dll anywhere in your GameData. I'm going to do an actual release in about 12 hours. If any of you find any problems let me know. Also, I need a name for this mod so ya if you have any ideas please speak up.

Link to comment
Share on other sites

The moving of control surfaces is not bound to being in the atmosphere, It's the fact that they are controlled with Hydraulic fluids.

 

 

(I'd love to see 'Hydraulic Fluid' as a resource that controls surfaces though, Makes it easier to have a 'disaster')

Link to comment
Share on other sites

58 minutes ago, TheKorbinger said:

The moving of control surfaces is not bound to being in the atmosphere, It's the fact that they are controlled with Hydraulic fluids.

(I'd love to see 'Hydraulic Fluid' as a resource that controls surfaces though, Makes it easier to have a 'disaster')

While that's definitely a cool idea, it's not really the direction I want to take this mod. The next thing to do is to get gimbals not to move if the engine is off.

Link to comment
Share on other sites

56 minutes ago, TheRagingIrishman said:

The next thing to do is to get gimbals not to move if the engine is off.

In the historical code, you'll also find airbrakes had the option to stop reacting to pitch/yaw inputs once in space. That seems to be in the same vein as these and perhaps worth including.

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