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

Rules rework #4

Open
gotmachine opened this issue Nov 18, 2020 · 0 comments
Open

Rules rework #4

gotmachine opened this issue Nov 18, 2020 · 0 comments
Labels
cfg code enhancement New feature or request

Comments

@gotmachine
Copy link
Contributor

The idea is to rewrite the whole rule handling with the following objectives :

  • No more hardcoded rules, fully customizable config defined
  • Rules resource input/output use processes (code de-duplication, better resource sim coherency)
  • Ability to have multiple process based modifiers and multiple custom regen/degen modifiers per rule
  • Ability define custom effects

Implementation

  • A rule becomes a KerbalValue representing a kerbal "stat" that can range from 0 to a maxValue
  • maxValue can receive various bonus depending on kerbals level, traits and profession
  • Each KerbalValue can have multiple KerbalValueModifier that define a rate of change for the value, and an expression modifier that scale, enable or disable that rate. The expression can use resources (ex : food amount), high level variables (ex : radiation level) and the kerbal stock stats (and possibly others KerbalValue, but that introduce a lot of complexity)
  • Each KerbalValue can have have multiple KerbalValueEffect, triggered when the KerbalValue reach customizable thresholds. We provide a set of predefined effects : kill, "touristify", and the various breakdown effect from the current stress rule. Effects have a customizable cooldown duration that determine how soon that effect can happen again and/or how long it lasts.

Default profile rules rework

This is a proposition of a radically different set of rules than what we currently have. The main goal is to make long durations missions more accessible, mainly by rebalancing the effects of radiation and stress. Secondary goal is to simplify the rule set by merging all "health hazards" rules into a single one. Specifically :

  • Separation of radiation effects between short term high level exposure from which you can recover and long term exposure effects that will inevitably reduce you life expectancy (cancer risk).
  • Separation of short term stress from which you recover from long term homesickness and mental state degradation.

The proposed system would have 5 rules :

  • Health : removed by hunger (no food), thirst (no water), temperature (maybe), lack of oxygen, co2 poisoning, high level radiation. Recover slowly when everything is fine
  • Fitness : affected by lack of gravity and exercise comforts
  • Radiation : affected by inverse squared radiation, never recover even on KSC recovery.
  • Stress : affected by stress comforts and living space, regenerate quickly when conditions are optimal. Effects are those of the current stress rules.
  • Homesickness : same modifiers as stress, but regenerate very slowly on optimal conditions. "touristify" effect (depression)

Additional thoughts

Comforts as we know them will probably go away.

  • Every gravity ring could have a config to provide X Gee for X Kerbals (or should it be by volume ?), giving an average "Gee/Kerbal" value used as a modifier in the Fitness rule
  • Exercise could be implemented as (large) inventory "threadmill" parts that should be placed inside habitats, providing exercise for X Kerbals (could have a quality too ?), feeding another modifier for the fitness rule.
  • Following the same idea, we could have other comfort inventory items, like a "home cinema" or a "kitchen".
  • "Global" comforts like "not alone", "call home" and "firm ground" should be direct modifiers for the Fitness / Stress / Homesickness rules
  • Extra habitat specific comforts could add global bonuses, for example "panorama" (for cupolas), "plants" (for greenshouses), "mess room" (for large "base/station center" parts). Eventually those could also have a "for X kerbals" property, allowing some diversification based on the part.

Remarks

  • This is relatively easy to implement, at least from the internal code logic and config parsing POV. The simple fact that this would eliminate the resource sim special handling of rules is a huge gain in code complexity.
  • Would require quite a bit of work on the UI side, and given that a large portion of the current planner/flight UI codebase is dedicated to rules, it would be really silly to do the work without leveraging the new UI framework. But this significantly expand the work needed to make it releasable. This said, the current UI is already missing a lot of things.
  • This would be a huge breaking change and would kill a lot of the existing work regarding other mods support.
@gotmachine gotmachine changed the title [4.0] Rules rework Rules rework Jan 21, 2021
@gotmachine gotmachine transferred this issue from Kerbalism/Kerbalism Jul 29, 2021
@gotmachine gotmachine mentioned this issue Jul 29, 2021
11 tasks
@gotmachine gotmachine added enhancement New feature or request code cfg labels Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cfg code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant