Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burn time on endgame engines is woefully insufficient (NSWR, Fusion, Ion engines) #850

Open
nilederg opened this issue Feb 20, 2023 · 3 comments

Comments

@nilederg
Copy link
Contributor

I have seen this issue mainly with my modpack's inertial confinement fusion engines and alternative ion engines. These are high isp, low thrust engines designed to be run for days, weeks, or even years on end, but they default to 10/40 minutes of burn time. I don't seek a "solution" of simply removing the limit for certain engines. I think a better solution would be analytical; Find the high isp or high tech level engines in other mods and remove their burn time limits. I would also like to know if functionality is provided to modders to change their engines' stats in kerbalism, or if it is all created by the kerbalism mod exclusively.

@gotmachine
Copy link
Collaborator

The engine reliability stuff is designed to tune itself, but it doesn't really handle non-stock engine types at all, this is a recurring issue with all mods adding new types of engines, anything that isn't a classic chemical engine really.

It's definitely possible to make additional/specific support configs, however I'm not very confident it's possible to make satisfactory heuristics for these type of engines, but you can try if you want. Take a look at https://github.com/Kerbalism/Kerbalism/wiki/TechGuide-~-PartModules-~-Reliability and

@PART[*]:HAS[@MODULE[ModuleEngines*],!MODULE[Reliability]:HAS[#type[ModuleEngines]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
MODULE
{
name = Reliability
type = ModuleEngines
}
}
@PART[*]:HAS[@MODULE[ModuleEngines*]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]]
{
title = Engine
redundancy = Propulsion
repair = Engineer
mtbf = 0
extra_cost = 1.5
extra_mass = 0.05
turnon_failure_probability = 0.007
rated_operation_duration = 600
rated_ignitions = 1
}
}
// this calculates ignitions from thrust, and vac/atm ISP ratio:
// - the lower the thrust, the higher the ignition count.
// - the higher the difference between vacuum and atmosphere ISP, the higher the ignition count.
// thrust 0-350 gives 64-1 ignitions (custom exponential-ish scale).
// vac/atm ratio gives no bonus if below 150%, and then a linear bonus of +1 ignitions for every extra 20%.
// some specific engine types will receive further bonus.
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[#maxThrust,@atmosphereCurve]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]]
{
// Parse and store atmosphere ISP as a temporary value
__tmp_isp_atm = #$../MODULE[ModuleEngines*]/atmosphereCurve/key,1$
@__tmp_isp_atm ^= :^[\d\.]* (\d+) *.*$:$1:
// Parse and store vacuum ISP as a temporary value
__tmp_isp_vac = #$../MODULE[ModuleEngines*]/atmosphereCurve/key,0$
@__tmp_isp_vac ^= :^[\d\.]* (\d+) *.*$:$1:
// Give ignitions based on the ratio between vacum and atmosphere ISP
// ----
// Example results for typical stock engines:
// Spider => 1
// Ant => 13
// Twitch => 1
// Terrier => 13
// Thud => 1
// LV-T30 => 1
// Poodle => 12
// Mainsail => 1
@rated_ignitions = #$__tmp_isp_vac$
@rated_ignitions /= #$__tmp_isp_atm$ // Get the ratio between vacum and atmosphere ISP
@rated_ignitions -= 1.5 // Zero the curve to a ratio of 1.5
@rated_ignitions ^= :^-.*$:0: // If negative, set to zero
@rated_ignitions *= 5 // Give a power of 5 to the curve
@rated_ignitions += 1 // Set a minimum value of 1
// Give extra ignitions the smaller the engine is
// ----
// Example results for typical stock engines:
// Spider => +64
// Ant => +64
// Twitch => +32
// Terrier => +10
// Thud => +8
// LV-T30 => +4
// Poodle => +2
// Mainsail => +0
__tmp_thrust_factor = #$../MODULE[ModuleEngines*]/maxThrust$
@__tmp_thrust_factor ^= :^[0-9]$:_64: // if thrust between 0 and 9, give +64 ignitions
@__tmp_thrust_factor ^= :^1[0-9]$:_32: // if thrust between 10 and 19, give +32 ignitions
@__tmp_thrust_factor ^= :^[2-4][0-9]$:_16: // if thrust between 20 and 49, give +16 ignitions
@__tmp_thrust_factor ^= :^[5-9][0-9]$:_10: // if thrust between 50 and 99, give +10 ignitions
@__tmp_thrust_factor ^= :^1[0-4][0-9]$:_8: // if thrust between 100 and 149, give +8 ignitions
@__tmp_thrust_factor ^= :^1[5-9][0-9]$:_6: // if thrust between 150 and 199, give +6 ignitions
@__tmp_thrust_factor ^= :^2[0-4][0-9]$:_4: // if thrust between 200 and 249, give +4 ignitions
@__tmp_thrust_factor ^= :^2[5-9][0-9]$:_2: // if thrust between 250 and 299, give +2 ignitions
@__tmp_thrust_factor ^= :^3[0-9][0-9]$:_1: // if thrust between 300 and 349, give +1 ignitions
@__tmp_thrust_factor ^= :^[^_].*$:_0: // if thrust is 350 or more, give +0 ignitions
@__tmp_thrust_factor ^= :_:: // remove the "_" prefix
// Combine the two ignitions values
// ----
// Final sum for the previous examples:
// Spider => 65
// Ant => 77
// Twitch => 33
// Terrier => 23
// Thud => 9
// LV-T30 => 5
// Poodle => 14
// Mainsail => 1
@rated_ignitions += #$__tmp_thrust_factor$
@rated_ignitions ^= :\.\d+:: // Floor value to get an integer
// Remove all temporary variables
!__tmp_* = dummy
}
}
// SRBs
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[SolidFuel]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]]
{
@rated_ignitions = 0
@rated_operation_duration = 0
@turnon_failure_probability = 0.005
}
}
// NERV
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[LiquidFuel]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]]
{
@rated_operation_duration = 800
@repair = Engineer@2
}
}
// your standard garden variety rocket engine
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]]
{
@rated_operation_duration = 350
@turnon_failure_probability = 0.007
@repair = true
}
}
// ion engines
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[XenonGas]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]] {
@rated_operation_duration = 0
@turnon_failure_probability = 0.002
@repair = Engineer@2
}
}
// jet engines
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[IntakeAir]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]] {
@rated_operation_duration = 86400
@rated_ignitions = 0
@repair = true
}
}
// hypergolic or monoprop engines
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[MonoPropellant]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]] {
@rated_operation_duration = 0
@rated_ignitions = 0
@repair = true
@turnon_failure_probability = 0.001
}
}
@PART[*]:HAS[@MODULE[ModuleEnginesRF]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
MODULE
{
name = Reliability
type = ModuleEnginesRF
title = Engine
redundancy = Propulsion
repair = Engineer
mtbf = 0
extra_cost = 1.0
extra_mass = 0.1
rated_operation_duration = 12000
}
}

@lordcirth
Copy link
Contributor

Would it be a problem to just set all Xenon-fueled engines to an arbitrarily high burn time? This could then easily be copied for other ion fuels.

@gotmachine
Copy link
Collaborator

Would it be a problem to just set all Xenon-fueled engines to an arbitrarily high burn time? This could then easily be copied for other ion fuels.

Unless there is a bug in the config, any engine using xenon as a propellant should already have infinite burn time :

// ion engines
@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[XenonGas]]]:NEEDS[FeatureReliability]:FOR[KerbalismDefault]
{
@MODULE[Reliability]:HAS[#type[ModuleEngines*]] {
@rated_operation_duration = 0
@turnon_failure_probability = 0.002
@repair = Engineer@2
}
}

If someone wants to contribute adjusted configs for other modded propellants or specific engines, I will gladly merge them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants