#596 some alchemy recipes are much more difficult than needed

closed
nobody
5
2014-01-18
2008-07-07
No

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)

and:

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).

Discussion

• tlhonmey - 2008-07-10

Logged In: YES
user_id=1604414
Originator: NO

Does this explain a lot of the recipes I can't get to work reliably, even with level 94 alchemy. (And my hiding is almost level 10. Yes, I have no life.)

The two low-level recipes for potions of life and figurines of clay seem to have about an 90% failure rate. Or at least succeed and produce nothing, I'm not sure if I can tell the difference. Most other low level recipes work fine. Is this the same issue? Or do I just have a character with hideously bad luck?

• Raphaël Quinet - 2008-07-17

Logged In: YES
user_id=8913
Originator: YES

Thanks for mentioning the example of the potion of life. This is supposed to be a reasonably easy alchemy recipe (difficulty 10). However, the potion is level 130. Taking this into account, a level 94 player using a nice cauldron +4 would have a success rate of only 15%.

This also explains why it is very difficult to create arrows or bolts of Assassinating Dragons (recipe difficulty 30, but the result is level 50): a player who is level 50 in the bowyer skill and who uses a standard workbench would have only 3% chance of success. Even a level 115 bowyer has only 7% chance.

• Nicolas Weeger - 2010-11-07

Revision 14075 removed the dependency on the various ingredients or final item, only using recipe difficulty and skill level.

The scale can of course be adjusted if needed.

• Nicolas Weeger - 2010-11-07
• status: open --> closed-fixed

• Kevin Zheng - 2014-01-18
• Status: closed-fixed --> closed