Skip to content

Combined all of the basic stats modifier - #3621

Open
Crepestrom wants to merge 95 commits into
PixelGuys:masterfrom
Crepestrom:Basic-Stat-Modifier-Combined
Open

Crepestrom wants to merge 95 commits into
PixelGuys:masterfrom
Crepestrom:Basic-Stat-Modifier-Combined

Conversation

@Crepestrom

@Crepestrom Crepestrom commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: #3611
increases maintainability of the code as you do not need to modify 8 basic stat modifiers in the same exact way
Breaks many addons that use the old system of modifiers
Also negative and positive modifiers are combined instead of being applied seperatly
eg: a +50% durability and -50% durability modifier will cancel out to +0% durability instead of -25% durability (75% of total durability)

Before:
image
After:
image

@Wunka Wunka added the Addon Migration Guide Things that should be noted in the Addon migration section of the changelog label Sep 19, 2026
@Wunka Wunka moved this to WIP/not ready for review in PRs to review Sep 19, 2026
@Crepestrom

Crepestrom commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

https://www.desmos.com/calculator/evdonhlker
Changed to match this
a slightly modified old version of this pr

@IntegratedQuantum

Copy link
Copy Markdown
Member

But clamping it makes no sense. -100% should not be reachable, just like +∞.

This reverts commit 02325b5.
funny thing is that this function contains both the - and + modifier functions embadded in it
@Crepestrom

Copy link
Copy Markdown
Contributor Author
image

@Crepestrom

Copy link
Copy Markdown
Contributor Author

its been seperated

@Crepestrom Crepestrom closed this Oct 25, 2026
@Crepestrom Crepestrom reopened this Oct 25, 2026
@Argmaster

Argmaster commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator
  1. What is the plan for custom property handling?
    I see you have hard coded mapping property-modifier_fancy_name
  2. Hot take: leave only the fancy name, give the numbers only on hover+shift or toggle them with F9 or something like this. So you have advanced and not advanced tooltip.
  3. It seems to sacrifice modularity, what is the motivation for that change? Was it discussed before? What kind of influence will it have over mod developers? Will they also prefer monolith modifiers over small ones?

@IntegratedQuantum

Copy link
Copy Markdown
Member

It seems to sacrifice modularity, what is the motivation for that change?

The motivation is to reduce an explosion of different modifier types once more stats are introduced for armor and accessories.
Ideally all our modifiers should be generalized where possible to give more options to addons.

Hot take: leave only the fancy name, give the numbers only on hover+shift or toggle them with F9 or something like this.

I actually have a hot counter-take for you: Move the fance names into the name, and leave only the numbers in the tooltip

@Argmaster

Argmaster commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

I actually have a hot counter-take for you: Move the fance names into the name, and leave only the numbers in the tooltip

While it should work fine I'm English, how will it work with translation into languages that require different adverb suffixes depending on the "sex/gender" (idk the proper language term translation) of the item?

Obviously I have an example in Polish.
Pickaxe (pl. Kilof) is a male noun and requires the prefix eg. Powerful (pl. Potężny) so a Powerful Pickaxe translates into Potężny Kilof
On the other hand, a Shover (pl. Łopata) is a feminine noun and requires pl. Potężna (suffix changes from "-ny" to "-na") ie. Potężna Łopata

While example is in Polish and one might say that's a weird language, I am pretty sure there are other languages with tricks like this that will make translation of procedural names quite tricky, especially declarative translation.

@Argmaster

Argmaster commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

The motivation is to reduce an explosion of different modifier types once more stats are introduced for armor and accessories.

I would expect a linear growth, exponential only when modder creativity is involved, and for the latter I doubt we can avoid it.
I guess I don't have a strong opinion on that, maybe except the fact I don't like the hard coded mapping involved.

@Crepestrom

Copy link
Copy Markdown
Contributor Author

i think the reason we use this scaling is because
say we have a pickaxe with 20 slots
and we fill them with branches with a +5% durability bonus
the pickaxe would have +100% durability

@Crepestrom

Copy link
Copy Markdown
Contributor Author

though honestly that doesnt sound that bad as you have a weak pickaxe
even if you can fill a tool with stuff

@IntegratedQuantum

Copy link
Copy Markdown
Member

While it should work fine I'm English, how will it work with translation into languages that require different adverb suffixes depending on the "sex/gender" (idk the proper language term translation) of the item?

At some point language writers have to get creative. Maybe you can say something like Pickaxe of Power (google translate turns that into Kilof Mocy/Łopata Mocy not sure if that is anything you'd actually say). Or maybe we'll need to find ways to incorporate some of these specialties when they arise. Either way, Cubyz as a game will be english first, we have enough other stuff to worry about right now.

I would expect a linear growth, exponential only when modder creativity is involved, and for the latter I doubt we can avoid it.

Linear growth, but the factor will get quite high, and we already have 4 with just multiplicative and good at/bad at. I'm sure at some point we want additive/subtractive, that's 6 modifiers for each property, and they all need unique IDs too, I think this will be a nightmare.

@Crepestrom

Copy link
Copy Markdown
Contributor Author

that could be a cool feature for materials to have
where putting gold in your pickaxe makes it a gold pickaxe

@Crepestrom Crepestrom mentioned this pull request Oct 29, 2026

@IntegratedQuantum IntegratedQuantum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I approve of this from a technical standpoint, though I would like to still get some more opinion on whether it should have parenthesis or not. I'll make a poll on discord for this.

This branch has not been deployed

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

Labels

Addon Migration Guide Things that should be noted in the Addon migration section of the changelog

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Combine all Basic Stat Modifiers

8 participants