While reviewing the alchemy code, I discovered that the method used for computing the success rate of some recipes is too pessimistic in many cases, because the "difficulty" of the recipes is (approximatively) multiplied by the level of the result. This causes a lot of variation from the original difficulty level specified in the file lib/formulae. I suspect that this effect has been overlooked when difficulties were introduced for recipes in January 2003. This affects both trunk (2.x) and branch (1.x).
To understand what the code does, we can consider that the success rate for a recipe is computed as "ability" / "difficulty", where:
ability = 1 + skill_level * (1 + cauldron_bonus/4)
difficulty = recipe_difficulty * (result->level + 2)
Let's consider two examples: The recipe for the "potion of fire resistance" is rated as "diff 50" in lib/formulae. The recipe for the "potion of fiery destruction" is also rated as "diff 50".
If we consider the rather extreme case of a player who is level 110 in alchemy (almost impossible to reach for most players) and uses a cauldron+4, then we find:
- for the potion of fire resistance, the success rate is 147%, so it will always be successful, but
- for the potion of fiery destruction, the success rates drop to only 7%.
And that's for a level 110 player using a cauldron +4!
A player who is level 50 in alchemy (difficult to reach, but possible) and who uses a standard cauldron would only have 1% chance of success for the potion of fiery destruction. This is MUCH too low.
Suggested fix: remove the dependency on the level of the result when calculating the difficulty, and adjust the difficulty level of the existing recipes as appropriate. If adjustments are needed for the difficulty of some recipes, it is much easier and better to tweak the "diff" level written in lib/formulae than to adjust the item->level of the result (because the latter has many side-effects).
Log in to post a comment.