Fix the discontinuity in craft skillup formula#7441
Merged
Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom Apr 18, 2025
Merged
Fix the discontinuity in craft skillup formula#7441Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom
Xaver-DaRed merged 1 commit intoLandSandBoat:basefrom
Conversation
Contributor
Author
|
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
approved these changes
Apr 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I affirm:
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)toif (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.
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.