Skip to content

feat(balance): Targeted Mutations Respect New Mutation System#8510

Draft
AzmodiusX wants to merge 9 commits intocataclysmbn:mainfrom
AzmodiusX:Mutation-Skew
Draft

feat(balance): Targeted Mutations Respect New Mutation System#8510
AzmodiusX wants to merge 9 commits intocataclysmbn:mainfrom
AzmodiusX:Mutation-Skew

Conversation

@AzmodiusX
Copy link
Copy Markdown
Collaborator

@AzmodiusX AzmodiusX commented Apr 14, 2026

Purpose of change (The Why)

When not using the legacy mod, random mutations use the new system for mutations that skews the points towards a trend value. The problem is that targeted mutations do not do this.

Describe the solution (The How)

Implement the functionality for targeted mutations.
Handle the extreme cases
Add a new option that exposes the hard-coded direction bias.
I also tried making the code easier to read, specifically the part that handles the legacy path.

Testing

The extreme values seem to work correctly.
Passes the vibe check.
I wrote a test, it passes. We'll see how prescient that is.

@github-actions github-actions Bot added src changes related to source code. JSON related to game datas in JSON format. labels Apr 14, 2026
@autofix-ci
Copy link
Copy Markdown
Contributor

autofix-ci Bot commented Apr 14, 2026

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

@AzmodiusX AzmodiusX changed the title feat(balance): Targeted Mutations Respects New Mutation System feat(balance): Targeted Mutations Respect New Mutation System Apr 14, 2026
@github-actions github-actions Bot added the tests changes related to tests label Apr 14, 2026
@chaosvolt
Copy link
Copy Markdown
Member

chaosvolt commented Apr 16, 2026

Looking at this and realizing mods are gonna be affected by this, not sure how to handle those...
image

Copy link
Copy Markdown
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image Something is amiss here that makes me suspect it's bugging out and refusing to hand out positive mutations when point cost target otherwise would.

@AzmodiusX
Copy link
Copy Markdown
Collaborator Author

I don't know how you want to handle this serum that apparently adds new mutations, for free, that are meant to bypass the point limit.
They seem like they need to be handled differently.
The debug field would work for making the system ignore them, but you'd have to manually add them via Lua.
The other major issue should be fixed, though.

@AzmodiusX AzmodiusX requested a review from chaosvolt April 17, 2026 00:25
@chaosvolt
Copy link
Copy Markdown
Member

I don't know how you want to handle this serum that apparently adds new mutations, for free, that are meant to bypass the point limit.

I'm guessing it's something I'd have to special-case in but I uh...not sure the best method for that...

@AzmodiusX
Copy link
Copy Markdown
Collaborator Author

If you simply made the mutations ignore the system, other mutations could just override them.
It's pretty awkward.

@chaosvolt
Copy link
Copy Markdown
Member

Ah right, hmm. I'm uh...not sure how best to handle this, bleh. I'm really reluctant to approve this just yet, because it breaks multiple mods in ways I have zero real workaround for, plus I'd want to test

To be honest, when I mused on this idea and added it to my list, I was actually thinking that the better approach would be for it to try to pick positive or negative based on point target value, but if it can't mutate closer towards the target then pick one at random as a fallback behavior. That method would not only mean no changes need to be made to mutations in mods that're balanced differently, but also means that this mechanic won't cause any potential unfinished dead-end situations for categories that might not have a wide range of options or are known to have trouble crossing thresholds.

@AzmodiusX
Copy link
Copy Markdown
Collaborator Author

To be clear, based on the structure of the code and comments and documentation:
The way dragonblood mutations currently work look like it's a misuse of the mechanics.
I think another type of serum that bypasses limits, and a field that says "only get these through the bypass serum" might be the best bet.

@chaosvolt
Copy link
Copy Markdown
Member

Hmm. That's...a problem, because this also means it completely precludes being able to structure a mutation category where every mutation is mixed effect and tied together, without either making them negative points or making some traits arbitrarily negative. Gwuh

@AzmodiusX
Copy link
Copy Markdown
Collaborator Author

No it... doesn't?
0 cost mutations work fine.
The issue is that you want to force add mutations at random from a category.
The changes make serums work better with the new system, and that involves them not being instant get mutation from category machines.
Unless I'm missing something here, then I don't understand how this blocks give / take mutations.
Random mutations can already do that too.

@AzmodiusX
Copy link
Copy Markdown
Collaborator Author

I'm not trying to be adversarial here or anything. I want your use case to work out too. I'd rather it not block us from making mutations balance-able.

@chaosvolt
Copy link
Copy Markdown
Member

I guess I'll test again now that the bug has been fixed and see if it works better now, it's just I don't now what JSON changes would need to be made to prevent this from breaking other things.

Copy link
Copy Markdown
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs fixing: it should not be acting like purifier at all, let alone completely removing unpurifable mutations.
Image

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

Labels

JSON related to game datas in JSON format. src changes related to source code. tests changes related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants