Jump to content

[1.12.x] Throttle Limit Extended


linuxgurugamer

Recommended Posts

New release, 2.0.6:

  • Added tooltips to settings window
  • Added 3 more buttons for the Thrust Limit, now can do set thrust immediately to one of four presets
  • Added 4 sliders to settings window to configure the presets
  • Now using the predefined buttons applies the limit immediately.
Link to comment
Share on other sites

Thanks for maintaining another great mod.

Small issue. The mod only seem to activate when using keyboard throttle controls. If I only use my joystick throttle, or an autopilot mod (I use Gravity Turn) I always have 100% throttle depth. TLE only seems to wake up and work as expected after I press Shift or Ctrl, then all inputs are limited, including the joystick throttle and GT. 

EDIT: I've done a bit more fiddling and found more weirdness. If I use the joystick throttle without touching Shift, Ctrl or Z, then I get full 100% throttle depth. When I press Shift, Ctrl or Z then my throttle inputs are limited by the mod, as expected. But as soon as I press X to zero my throttle, I just go back to having 100% throttle depth again.

 

Edited by Daedalus451
Link to comment
Share on other sites

Another quirk I've noticed is that the mod seems to change the way the thrust limit sliders on engines work, which confuses other mods such as KER and BetterBurnTime and causes them to miscalculate.

Example: on an engine with 80-100% throttle depth, TLE understands a 25% thrust limit to actually mean 85%, while every other mod understands 25% to mean 25%. That means that any thrust limit setting other than 100% will cause other mods to miscalculate TWR and burn times.

I don't know if it's possible, but I think it would be much better to treat thrust limiters in a similar way to how player throttle inputs are already handled by the mod. I.e. any thrust limit setting below the hard lower limit for that engine would be ignored, so that setting an 80-100% engine to 25% would just mean it works at 80% in practice (just like setting 25% throttle on that engine), but setting the limiter to 85% would still mean 85%. As long as players tweak their thrust limits within the throttle depth of their engines, all TWR calculations made by other mods would still be correct - which is better than at present. (You would still run into problems if you set the tweakable throttle limit too low for a given engine, but I'm fine with that - you deserve to suffer unpredictable overthrust for trying to shoehorn an oversized engine into a purpose it wasn't built for!).

Setting universal throttle limits through the mod's own UI would also need a slight tweak. Clicking the 25% button should set all engines' thrust limiters to corrected values: i.e. 85% for an 80-100 engine, 55% for a 40-100 engine, and 40% for a 20-100 engine. That might need a bit of explaining though.

Thoughts?

Edited by Daedalus451
Link to comment
Share on other sites

Hi all and thanks linuxgurugamer for all your great mods !

I have two questions :
-
Does this mod adds a delay for engine thrust ? (if not, what mod can do that ?)
- Does MKS/ USI mods and near futures mods engines have configurations for limited throttle ?

Thanks !

Link to comment
Share on other sites

18 hours ago, chateaudav said:

Hi all and thanks linuxgurugamer for all your great mods !

I have two questions :
-
Does this mod adds a delay for engine thrust ? (if not, what mod can do that ?)

No.  I'm not aware of any mod which does, I assume you are referring to the time it takes for an engine to spool up?  That is most usually needed for jet engines, rockets are usually able to throttle almost instantly.  KWRocketry does have configs which does that

18 hours ago, chateaudav said:

- Does MKS/ USI mods and near futures mods engines have configurations for limited throttle ?

There is a config for USI included, I don't have one for the Near Futures one,and am not aware of one included with that mod.  In that case, there is a standard config which gets applied

Edited by linuxgurugamer
Link to comment
Share on other sites

On 8/14/2018 at 8:25 PM, Daedalus451 said:

Another quirk I've noticed is that the mod seems to change the way the thrust limit sliders on engines work, which confuses other mods such as KER and BetterBurnTime and causes them to miscalculate.

Example: on an engine with 80-100% throttle depth, TLE understands a 25% thrust limit to actually mean 85%, while every other mod understands 25% to mean 25%. That means that any thrust limit setting other than 100% will cause other mods to miscalculate TWR and burn times.

I don't know if it's possible, but I think it would be much better to treat thrust limiters in a similar way to how player throttle inputs are already handled by the mod. I.e. any thrust limit setting below the hard lower limit for that engine would be ignored, so that setting an 80-100% engine to 25% would just mean it works at 80% in practice (just like setting 25% throttle on that engine), but setting the limiter to 85% would still mean 85%. As long as players tweak their thrust limits within the throttle depth of their engines, all TWR calculations made by other mods would still be correct - which is better than at present. (You would still run into problems if you set the tweakable throttle limit too low for a given engine, but I'm fine with that - you deserve to suffer unpredictable overthrust for trying to shoehorn an oversized engine into a purpose it wasn't built for!).

Setting universal throttle limits through the mod's own UI would also need a slight tweak. Clicking the 25% button should set all engines' thrust limiters to corrected values: i.e. 85% for an 80-100 engine, 55% for a 40-100 engine, and 40% for a 20-100 engine. That might need a bit of explaining though.

Thoughts?

The thrust limit section is a new addition.  For right now, I'd suggest using only one or the other (ie:  Either throttle limits or thrust limits, but not both).

The problem isn't the way the mod updates the thrust limits, I'm pretty sure that if you are using the throttle limits and adjust the thrust limiter manually, you will experience the same problem.  Can you try that and let me know?

Changing the way it works would be both somewhat problematic, and somewhat hard to explain.

Link to comment
Share on other sites

  • 2 months later...

Any chance of just introducing an option to turn off the minimum throttle levels altogether - i.e. just so the action groups work, without all the minimum throttle levels and hard-coded keybindings? I just can't get the more sophisticated parts of this mod to behave properly with a HOTAS throttle, or with Engine Ignitor.

Either that, or it could do with some way of rebinding keys, so that I don't keep magically igniting my engines without ignitors, every time i press Right Alt. <_<

Link to comment
Share on other sites

17 hours ago, Daedalus451 said:

Any chance of just introducing an option to turn off the minimum throttle levels altogether - i.e. just so the action groups work, without all the minimum throttle levels and hard-coded keybindings? I just can't get the more sophisticated parts of this mod to behave properly with a HOTAS throttle, or with Engine Ignitor.

Either that, or it could do with some way of rebinding keys, so that I don't keep magically igniting my engines without ignitors, every time i press Right Alt. <_<

Have you tried disabling that in the settings?

Link to comment
Share on other sites

  • 9 months later...
  • 2 months later...
  • 1 year later...
On 8/19/2018 at 11:13 AM, chateaudav said:

- Does this mod adds a delay for engine thrust ? (if not, what mod can do that ?)

This can be done with an mm config. It is available in the community module manager database:

Spoiler

//Add engine response time to engines that pump fluids but have no engine spooling.
//Author: Aelfhe1m & Aquilux
////////////////////////////////////////////////////////////////////
//This script adds engine spooling delay to engines that pump at least one liquid for a chemical reaction.
//Engine spooling delay is dependent on the momentum of the turbines in the engine.
//This script assumes that turbine mass is an average fraction of engine mass, thus delay is derived from engine mass.
//
//equations for accel/decel/mass relationships loosely derived from KW rocketry values:
//
//engineAccelerationSpeed = -1.16878m + 0.0875252m^2 + -0.00253789m^3 + 0.0000260111m^4 + 5.74868
//
//engineDecelerationSpeed = 1.14632m + 0.0856818m^2 + -0.00246803m^3 + 0.0000251029m^4 +  5.82994
//
//values and derived trend lines can be found here: https://goo.gl/733mKw (published google sheets chart)
//////////////////////////////////////////////////////////////////


//Spooling for engines with oxidiser (to account for hybrid and other exotic chemical engines using oxidiser)
@PART[*]:HAS[!MODULE[MultiModeEngine],@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer],~useEngineResponseTime[True]]]
//find parts containing ModuleEngines* that uses Oxidiser, but does not have useEngineResponseTime
{
    @MODULE[ModuleEngines*]
    {
        useEngineResponseTime = True             //create useEngineResponseTime

//////////////////////////////////////////////////begin polynomial math for engineAccelerationSpeed
        MATHa = #$/mass$                         //start first component temp variable
        @MATHa *= -1.16878                         //complete first component
                                                //
        MATHb = #$/mass$                        //start second component temp variable
        @MATHb != 2                                //incorporate exponent
        @MATHb *= 0.0875252                        //complete second component
                                                //
        MATHc = #$/mass$                        //start third component temp variable
        @MATHc != 3                                //incorporate exponent
        @MATHc *= -0.00253789                    //complete third component
                                                //
        MATHd = #$/mass$                        //start fourth component
        @MATHd != 4                                //incorporate exponent
        @MATHd *= 0.0000260111                    //complete fourth component
                                                //
        engineAccelerationSpeed = #$MATHa$        //combine first component
        @engineAccelerationSpeed += #$MATHb$    //combine second component
        @engineAccelerationSpeed += #$MATHc$    //combine third component
        @engineAccelerationSpeed += #$MATHd$    //combine fourth component
        @engineAccelerationSpeed += 5.74868        //combine fifth component
                                                //keep variables initialised
//////////////////////////////////////////////////begin polynomial math for engineDecelerationSpeed
        @MATHa = #$/mass$                         //start first component temp variable
        @MATHa *= 1.14632                         //complete first component
                                                //
        @MATHb = #$/mass$                        //start second component temp variable
        @MATHb != 2                                //incorporate exponent
        @MATHb *= 0.0856818                        //complete second component
                                                //
        @MATHc = #$/mass$                        //start third component temp variable
        @MATHc != 3                                //incorporate exponent
        @MATHc *= -0.00246803                    //complete third component
                                                //
        @MATHd = #$/mass$                        //start fourth component
        @MATHd != 4                                //incorporate exponent
        @MATHd *= 0.0000251029                    //complete fourth component
                                                //
        engineDecelerationSpeed = #$MATHa$        //combine first component
        @engineDecelerationSpeed += #$MATHb$    //combine second component
        @engineDecelerationSpeed += #$MATHc$    //combine third component
        @engineDecelerationSpeed += #$MATHd$    //combine fourth component
        @engineDecelerationSpeed += 5.82994        //combine fifth component
                                                //
        !MATHa = clear                            //clear temp variable
        !MATHb = clear                            //clear temp variable
        !MATHc = clear                            //clear temp variable
        !MATHd = clear                            //clear temp variable
//////////////////////////////////////////////////end polynomial math
    }
}

//Spooling for engines with MonoPropellant
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[MonoPropellant],~useEngineResponseTime[True]]]
//find parts containing ModuleEngines* that uses MonoPropellant, but does not have useEngineResponseTime
{
    @MODULE[ModuleEngines*]
    {
        useEngineResponseTime = True             //create useEngineResponseTime
        
//////////////////////////////////////////////////begin polynomial math for engineAccelerationSpeed
        MATHa = #$/mass$                         //start first component temp variable
        @MATHa *= -1.16878                         //complete first component
                                                //
        MATHb = #$/mass$                        //start second component temp variable
        @MATHb != 2                                //incorporate exponent
        @MATHb *= 0.0875252                        //complete second component
                                                //
        MATHc = #$/mass$                        //start third component temp variable
        @MATHc != 3                                //incorporate exponent
        @MATHc *= -0.00253789                    //complete third component
                                                //
        MATHd = #$/mass$                        //start fourth component
        @MATHd != 4                                //incorporate exponent
        @MATHd *= 0.0000260111                    //complete fourth component
                                                //
        engineAccelerationSpeed = #$MATHa$        //combine first component
        @engineAccelerationSpeed += #$MATHb$    //combine second component
        @engineAccelerationSpeed += #$MATHc$    //combine third component
        @engineAccelerationSpeed += #$MATHd$    //combine fourth component
        @engineAccelerationSpeed += 5.74868        //combine fifth component
                                                //keep variables initialised
//////////////////////////////////////////////////begin polynomial math for engineDecelerationSpeed
        @MATHa = #$/mass$                         //start first component temp variable
        @MATHa *= 1.14632                         //complete first component
                                                //
        @MATHb = #$/mass$                        //start second component temp variable
        @MATHb != 2                                //incorporate exponent
        @MATHb *= 0.0856818                        //complete second component
                                                //
        @MATHc = #$/mass$                        //start third component temp variable
        @MATHc != 3                                //incorporate exponent
        @MATHc *= -0.00246803                    //complete third component
                                                //
        @MATHd = #$/mass$                        //start fourth component
        @MATHd != 4                                //incorporate exponent
        @MATHd *= 0.0000251029                    //complete fourth component
                                                //
        engineDecelerationSpeed = #$MATHa$        //combine first component
        @engineDecelerationSpeed += #$MATHb$    //combine second component
        @engineDecelerationSpeed += #$MATHc$    //combine third component
        @engineDecelerationSpeed += #$MATHd$    //combine fourth component
        @engineDecelerationSpeed += 5.82994        //combine fifth component
                                                //
        !MATHa = clear                            //clear temp variable
        !MATHb = clear                            //clear temp variable
        !MATHc = clear                            //clear temp variable
        !MATHd = clear                            //clear temp variable
//////////////////////////////////////////////////end polynomial math
    }
}

 


EDIT: @linuxgurugamer I seem to have found another bug and incompatibility. The 'x' keybind for setting throttle to minimum ignores the throttle limit extended functionality. Also, the mod gravity turn's throttle adjustments also seem to bypass the throttle limits.

Edited by Errol
Link to comment
Share on other sites

5 hours ago, Errol said:

EDIT: @linuxgurugamer I seem to have found another bug and incompatibility. The 'x' keybind for setting throttle to minimum ignores the throttle limit extended functionality. Also, the mod gravity turn's throttle adjustments also seem to bypass the throttle limits.

I can look at the bug,  but not going to touch the GravityTurn issue.

I'll add an option to allow X to turn off the engine or not.

It's not a bug.  From the OP:

Additionally, the mod now puts a minimum throttle setting on  (currently) stock engines.  What this means is that , for example, the Rapier which has a minimum throttle of 20%, will throttle from 100% down to 20% (using the full range of the throttle), and then to 0%.  

So X set the throttle to 0

Edited by linuxgurugamer
Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:

I can look at the bug,  but not going to touch the GravityTurn issue.

I'll add an option to allow X to turn off the engine or not.

It's not a bug.  From the OP:

Additionally, the mod now puts a minimum throttle setting on  (currently) stock engines.  What this means is that , for example, the Rapier which has a minimum throttle of 20%, will throttle from 100% down to 20% (using the full range of the throttle), and then to 0%.  

So X set the throttle to 0

Ahh, ok, I guess what confused me was that when you hold ctrl to go all the way to zero the engines stay running at the minimum allowed throttle setting instead of cutting off like when you press x. 

The gravity turn autopilot control of the throttle does ignore the throttle limit extended function though.  I posted in that thread too, not sure how complicated it would be to make throttle control from the gravity turn ai optional, but you do maintain that one too...

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 3 months later...
  • 9 months later...

Hi, many thanks for this mod (and all the others I'm using!), much appreciated. I'm having a small bug related to probes - when using the throttle limit option, when a probe is out of comms range with the option for signal being required for control activated, instead of engine and throttle control being completely disabled, hitting z or shift sets the throttle to max or the minimum possible for that engine (20%, 80% etc) and then locks the engine there, burning away til the fuel's gone. (Oddly, I can't then turn the engine off using ctrl or x or shutting down the engine, it's just stuck there). All other probe control (attitude control, part deployment etc) remains disabled as normal, and every other part of the mod seems to function as intended.

This only happens when throttle limits are enabled - using the Global Thrust Limit Window has no such issues.

This is all on the latest version  of KSP (1.12.3), latest version of module manager (4.2.2), latest version of this mod (2.0.9.1). I've tested this on a clean installation of KSP with no other mods to check if it was an interaction with another mod, and as the bug persists, it doesn't seem to be.

Any help in figuring this out would be greatly appreciated, let me know if there's any other information that would be helpful. Thanks again for all your time working on this and taking the time to read this.

Link to comment
Share on other sites

22 hours ago, gturkey said:

Hi, many thanks for this mod (and all the others I'm using!), much appreciated. I'm having a small bug related to probes - when using the throttle limit option, when a probe is out of comms range with the option for signal being required for control activated, instead of engine and throttle control being completely disabled, hitting z or shift sets the throttle to max or the minimum possible for that engine (20%, 80% etc) and then locks the engine there, burning away til the fuel's gone. (Oddly, I can't then turn the engine off using ctrl or x or shutting down the engine, it's just stuck there). All other probe control (attitude control, part deployment etc) remains disabled as normal, and every other part of the mod seems to function as intended.

This only happens when throttle limits are enabled - using the Global Thrust Limit Window has no such issues.

This is all on the latest version  of KSP (1.12.3), latest version of module manager (4.2.2), latest version of this mod (2.0.9.1). I've tested this on a clean installation of KSP with no other mods to check if it was an interaction with another mod, and as the bug persists, it doesn't seem to be.

Any help in figuring this out would be greatly appreciated, let me know if there's any other information that would be helpful. Thanks again for all your time working on this and taking the time to read this.

As always, no logs, no support

 

Link to comment
Share on other sites

16 hours ago, linuxgurugamer said:

As always, no logs, no support

 

Ah, my apologies. Dropbox link to log: https://www.dropbox.com/s/4mac7cwjz5btqus/Player.log?dl=0

Test was done with a small probe using a terrier engine sent to solar orbit, and once it was there with no comms contact, pressing l-shift leading to thrust activating.

Looking through, the one possible error that sticks out is the excerpt below, but I confess my coding skills aren't at the point to be certain/know exactly what it's referring to.
 

Spoiler

[HighLogic]: =========================== Scene Change : From EDITOR to FLIGHT (Async) ===================== 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Unloading 12 Unused Serialized files (Serialized files now loaded: 6)
Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
  at KSP___ActionGroupEngines.Main.ThrottleLimiterModule.LateUpdate () [0x000d2] in <4c08f4b0c4204d388e6a5505c496d9be>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)

 

Edited by gturkey
Link to comment
Share on other sites

19 hours ago, gturkey said:

Ah, my apologies. Dropbox link to log: https://www.dropbox.com/s/4mac7cwjz5btqus/Player.log?dl=0

Test was done with a small probe using a terrier engine sent to solar orbit, and once it was there with no comms contact, pressing l-shift leading to thrust activating.

Looking through, the one possible error that sticks out is the excerpt below, but I confess my coding skills aren't at the point to be certain/know exactly what it's referring to.

Thanks, I'll review the log.

The specific error you listed only occurs once,  and is most likely a timing issue with flight not being fully initialized.  I've added a check for it (I don't like Nullrefs at all), but I don't think it affected this problem.  However, the code to set the thottle to 0 is in LateUpdate, it might have been related

Right now I'm trying to remember why I disable the window if the limits are enabled :D

Edited by linuxgurugamer
Link to comment
Share on other sites

19 hours ago, gturkey said:

Ah, my apologies. Dropbox link to log: https://www.dropbox.com/s/4mac7cwjz5btqus/Player.log?dl=0

Test was done with a small probe using a terrier engine sent to solar orbit, and once it was there with no comms contact, pressing l-shift leading to thrust activating.

Looking through, the one possible error that sticks out is the excerpt below, but I confess my coding skills aren't at the point to be certain/know exactly what it's referring to.
 

  Reveal hidden contents

[HighLogic]: =========================== Scene Change : From EDITOR to FLIGHT (Async) ===================== 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Unloading 12 Unused Serialized files (Serialized files now loaded: 6)
Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
  at KSP___ActionGroupEngines.Main.ThrottleLimiterModule.LateUpdate () [0x000d2] in <4c08f4b0c4204d388e6a5505c496d9be>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)

 

I'd like you to do the following, please

  1. First, verify that this issue is repeatable for you.
  2. Then, install this beta:  https://www.dropbox.com/s/fym3pcdzudqmsiw/ThrottleLimitExtended-2.0.9.1.zip?dl=0 and try it again

I looked at my notes and realized that it either throttle limits on each individual engine or on all engines, not both.  Still trying to remember why.

I will say that the mod won't be happy if you change the mode in flight, without leaving flight and coming back.  I'm wondering if that might have been your issue

Link to comment
Share on other sites

18 hours ago, linuxgurugamer said:

I'd like you to do the following, please

  1. First, verify that this issue is repeatable for you.
  2. Then, install this beta:  https://www.dropbox.com/s/fym3pcdzudqmsiw/ThrottleLimitExtended-2.0.9.1.zip?dl=0 and try it again

I looked at my notes and realized that it either throttle limits on each individual engine or on all engines, not both.  Still trying to remember why.

I will say that the mod won't be happy if you change the mode in flight, without leaving flight and coming back.  I'm wondering if that might have been your issue

Cheers, much appreciated.

1. Verified - I repeated the test with the exact same craft, and then with another craft switching out the terrier for a reliant to check the issue wasn't specific to deep throttle engines - same issue, no change. Log here in case of use: https://www.dropbox.com/s/8vedarov5ri14js/Player2.log?dl=0

(On the changing mode - assuming you mean between the throttle limits and global thrust limit window in the difficulty settings? All of these tests were done on throttle limits only with no switching between the two. When the issue initially arose when I was playing normally, I only started switching mode after the problem arose to see what effect it would have/try to narrow down the cause, so I don't think that's at root.)

2.  Installed the beta, tested with the terrier craft on a fresh sandbox save, same settings. Afraid the issue persists, log here: https://www.dropbox.com/s/8slzvi0ho8qzsqi/Player3.log?dl=0

 

Edited by gturkey
Clarification in text
Link to comment
Share on other sites

1 hour ago, gturkey said:

Cheers, much appreciated.

1. Verified - I repeated the test with the exact same craft, and then with another craft switching out the terrier for a reliant to check the issue wasn't specific to deep throttle engines - same issue, no change. Log here in case of use: https://www.dropbox.com/s/8vedarov5ri14js/Player2.log?dl=0

(On the changing mode - assuming you mean between the throttle limits and global thrust limit window in the difficulty settings? All of these tests were done on throttle limits only with no switching between the two. When the issue initially arose when I was playing normally, I only started switching mode after the problem arose to see what effect it would have/try to narrow down the cause, so I don't think that's at root.)

2.  Installed the beta, tested with the terrier craft on a fresh sandbox save, same settings. Afraid the issue persists, log here: https://www.dropbox.com/s/8slzvi0ho8qzsqi/Player3.log?dl=0

All right, thank you.

Can you provide me with a craft file and save file, I just want to verify I'm testing the same thing.

I wasn't sure the beta would fix it, but I did make a few changes and since I couldn't reproduce it myself, I wanted to see if it did fix the problem.

Also, instead of a save file, this would be more helpful:

The exact steps you did to reproduce it, starting with a new save file (in sandbox mode) in the editor.  If you could provide a narrated video, that would be even more helpful.

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