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

feat(balance): mutations can modify power value of mutant toxins, adding a vanilla use for Robust Genetics #4163

Merged
merged 6 commits into from
Mar 2, 2024

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Jan 27, 2024

Purpose of change

Minor idea on my to-do list, basically making it so mutations (and by extension mods) can alter how mutations and thresholds interact with the whole "point value total that mutant toxins tries to mutate towards" system.

Describe the solution

C++ changes:

  1. In character.cpp, added support for mutagen_target_modifier to mutation_value_map.
  2. In mutation.cpp, Character::mutation_chances now factors in any bonuses/penalties from a mutation value called mutagen_target_modifier, that is used to increase or decrease the mutation point target used when mutating via toxins. Also added a debug message for testing.
  3. In mutation.h, added definition for mutagen_target_modifier.
  4. In mutation_data.cpp, added JSON support for mutagen_target_modifier to mutation_branch::load.

JSON changes:

  1. Defined mutagen_target_modifier values for all threshold mutations. Idea here is the point bonuses pick the highest of the relevant category JSON's iv_hunger, iv_thirst, and iv_fatigue value. So basically, crossing a threshold gives you a head start on picking up better post-thresh mutations based on how physically disruptive that category is implied to be, since those tend to be the more spicy categories with a lot of high-risk-high-reward proporties. Most of these thresholds use 10 since hardcoded defaults are 10+10+5, as most categories don't define different values.
  2. De-obsoleted Robust Genetics in mainline, now having a mutagen_target_modifier of +8. Re-allowed as a starting trait as it once was, with an updated description.
  3. As I discovered that toxin mutations aren't affected by this (and for fun, for the matter), added a penalty of -50 to Genetic Downward Spiral.

Doc updates:

  1. Documented new property in json_info.md

Describe alternatives you've considered

  1. Not also re-mainlining Robust Genetics.
  2. Making the bonus stronger.
  3. Conversely, making the point cost lower than its old default of 3 since right now point-target mutations are only implemented for one source of mutation.
  4. Adding it to Genetically Unstable and Genetic Chaos for bonus lulz.
  5. Figuring out a way to hack the other mutation methods to actually factor mutation point cost in somehow. Could save for a followup tho.

Testing

  1. Checked affected JSON for syntax and lint errors.
  2. Compiled and load-tested.
  3. Debugged myself a high duration of the mutating effect.
  4. Observed that target value was default of 8, as expected.
  5. Repeated test after giving myself Chimera threshold, target value was correctly reported as 28.
  6. Re-tested with Genetic Downward Spiral instead, value was strongly negative as expected.
  7. Checked affected C++ files for astyle.

Additional context

Checklist

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Jan 27, 2024
@github-actions github-actions bot added the docs PRs releated to docs page label Jan 27, 2024
@Coolthulhu
Copy link
Member

8 points for 3 points is too good. Try 6.

10 points for thresholds is also a lot. It would be fine for bad trees, like plant, but not for medical or alpha.

@chaosvolt
Copy link
Member Author

chaosvolt commented Jan 28, 2024

8 points for 3 points is too good. Try 6.

10 points for thresholds is also a lot. It would be fine for bad trees, like plant, but not for medical or alpha.

I wasn't sure what'd be good numbers to use, ye. That said, it's 10 for most categories, 5 for Alpha and Medical, 20 for Chimera.

Also note that in the case of Robust Genetics, 3 of that bonus it grants is effectively eaten up by its own point cost.

@chaosvolt
Copy link
Member Author

I'll leave this one to wait until seeing whether @Coolthulhu would still prefer a particular nerf to the bonuses or not, given the aforementioned "part of the bonus is eaten up by the mutation's point bonus" thing.

@chaosvolt chaosvolt requested a review from Coolthulhu February 7, 2024 04:15
@scarf005 scarf005 merged commit 762448d into cataclysmbnteam:main Mar 2, 2024
13 checks passed
@chaosvolt chaosvolt deleted the mutation-value-target branch March 2, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PRs releated to docs page JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants