Skip to content

Fix the discontinuity in craft skillup formula#7441

Merged
Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom
wccbuck:base
Apr 18, 2025
Merged

Fix the discontinuity in craft skillup formula#7441
Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom
wccbuck:base

Conversation

@wccbuck
Copy link
Copy Markdown
Contributor

@wccbuck wccbuck commented Apr 17, 2025

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

The formula LSB uses to calculate the chance a player will increase their crafting skill with a synth is piecewise when using the "Modern System." This means if the server variable CRAFT_MODERN_SYSTEM is set to true, a separate skillup formula is used for crafts above a player's skill level versus crafts below their skill level. The formula appears to be designed such that players should have a lower chance to skill up on crafts below their skill level, which makes sense.

Edit: I realized after posting this that all of these percentages are assuming CRAFT_CHANCE_MULTIPLIER = 2. With default settings, you can cut all those numbers in half. My point still stands, though.

However, a problem arises when a player's skill level is fractional, such as 108.9. If such a player were attempting to craft a level 109 item, their chance to skill up would be only 2%. If instead they attempted a level 108 or level 110 synth, their chance to skill up would be much higher: 14.7% or 22.3% respectively. This discontinuity in the curve is counterintuitive.

My suggestion is to simply change the baseDiff check in doSynthSkillUp from if (baseDiff > 0) to if (baseDiff > 1). This change would have no impact at all on the curve if a player's synth level was a round number. But in the above case, a player with 108.9 skill attempting a level 109 craft would have a 17.2% to skill up, a number that cleanly sits between 14.7% and 22.3%.

The charts below show skill-up rates for the following player craft levels: 50.0, 50.5, 50.9, 108.0, 108.5, and 108.9. You can see the dip in skill-up rate occurs whenever the craft level is not a round number, but this suggested fix smooths the curve in those cases.

image

image

image

image

image

image

Thanks to @ariel-logos for bringing my attention to this issue.

Steps to test these changes

Attempt a craft with craft level 0.1 higher than your skill level; repeat with 1 level below or 1 level above, and the difference is apparent.

@wccbuck
Copy link
Copy Markdown
Contributor Author

wccbuck commented Apr 17, 2025

Important note for those not familiar with this part of the code: The formula I'm plotting in those curves is the base skill up rate, before considerations like breaks (which cut the skillup chance in half) or skill up amount.

@Xaver-DaRed Xaver-DaRed merged commit 0e2d3f8 into LandSandBoat:base Apr 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants