Narzoul
01-31-2011, 09:39 PM
This research is an attempt to "reverse engineer" the formulas used for calculating certain attributes of in-game items.
Everything posted in this topic is speculation based on research done by myself. None of it is official data. Nevertheless, most of the formulas I'll provide have been tested on hundreds of items, so I consider them highly accurate.
This may not have a lof of practical use, but it could be used as a basis for further research, or maybe even some balance discussions.
Notation and terminology:
Information is organised into tables. If you're familiar with spreadsheets or relational databases, you should find your way around easily. But even if you're not, it's not really difficult to figure out how it works.
x.y refers to column y of table x
x ^ y is exponentiation (x to the power of y)
Rounding functions:
F: Floor (round towards negative infinity)
C: Ceiling (round towards positive infinity)
R: Round to nearest integer. Round .5 towards positive infinity.
P: Special rounding used by purchase prices. Depends on the number of digits before the decimal point. For 1-3 digits, use ceiling. For 4-5 digits, round up to the nearest multiple of 10. For 6 digits, round up to the nearest multiple of 100. (I have not yet seen more than 6 digits.)
Note that the given formulas are applicable only to items that can be looted from normal mobs or purchased from NPCs and lucky boxes. Magnanite items and "unique" boss items may use different formulas.
I've attached the tables that are referenced by the formulas: 31938
Armor bonus
Description: Bonus armor points, shown in parentheses on armors.
Formula: (material.bonus + quality.bonus + enchantment.bonus) / 4
Rounding: C
Block chance
Description: Block chance for shields.
Formula: R(armor_points / 4) / 2
Rounding: R
Notes:
I know the double rounding and division looks odd, but simply dividing by 8 and rounding the end result (with any of the rounding methods) does not seem to work. Block chance was halved in one of the game updates, so this still makes some sense.
I have not verified this formula for all shields yet.
Damage bonus
Description: Bonus damage, shown in parentheses on weapons. (Arrows do not gain a damage bonus.)
Formula: (material.bonus + quality.bonus + enchantment.bonus) * class.bonus
Rounding: C
Durability (maximum)
Description: Maximum durability points of any armor or weapon.
Formula: 4 * (material.durability + quality.durability) + 2 * level
Rounding: -
Note: level is the level requirement of the item, *not* the "item level" attribute.
Hit chance bonus
Description: Hit chance bonus for weapons. All weapons have this, but special/magical/epic weapons may have additional hit chance bonuses. (Arrows do not gain a hit chance bonus.)
Formula: (material.hit_chance + quality.hit_chance) * class.bonus
Rounding: C
Item level
Description: The "item level" of any weapon, armor or arrow. Usually the same as the level requirement, but not always.
Formula:
For armors: (armor_points + material.bonus) / 4 * 1.002088 - 1
For arrows: damage + C(material.bonus / 4) - 1
For weapons: (damage + C(material.bonus * class.bonus)) / speed.factor * class.level * (range + 39) / 40.731285 - 1
Rounding: F
Notes:
For spears, use range = 2.5, for other melee weapons, use range = 1.5
For bows, use the old bow range (current bow range minus 5)
damage is the average base damage (summed for all damage types), not counting the damage bonus in parentheses and other damage bonuses (special/magical/epic bonuses)
Regarding the weird constants (1.002088, 39 and 40.731285): they don't make much sense to me yet either, but they work, and even tiny modifications can break the formulas. The non-integer constants are fine-tuned so that the price of a "normalized" level 50 weapon or full level 50 set of armors would be a "nice" number (250 000 in both cases - see the price formula). The constant for armors is otherwise not needed and can be dropped (set to 1).
"Big round metal shield" has consistently -8 item levels compared to what it should have. (This affects price calculations too.)
Price
Description: Cost of purchasing an item from an NPC.
Formula:
For arrows: (((item_level + 1) / 50) ^ 2.6 * 298.13 + 50) * material.price * quality.price
For weapons and armors: (((item_level + 1) / 50) ^ 2.6 * category.price * 250000 + 50) * material.price * quality.price
Rounding: P
Note: For arrows, the price is meant for a quantity of 50.
Repair cost
Description: Repair cost of a partially damaged item.
Formula: (max_durability - current_durability) / max_durability * P(price) / 4 + random
Rounding: ?
Note: random is not a joke - there really is a small random amount added every time when a point of durability is lost. The amount can be different for every "test run" even for the same amount of current_durability. It's probably a random portion of the cost for repairing 1 point of durability - needs more examination. (The random amount does not change until the next point of durability is lost.)
Selling price
Description: Selling price for a fully repaired item.
Formula: P(price) / 8
Rounding: F
Note: Selling price for damaged items is lower - exact amount is not yet determined. The same random amount that appears in the repair cost seems to affect this too.
Everything posted in this topic is speculation based on research done by myself. None of it is official data. Nevertheless, most of the formulas I'll provide have been tested on hundreds of items, so I consider them highly accurate.
This may not have a lof of practical use, but it could be used as a basis for further research, or maybe even some balance discussions.
Notation and terminology:
Information is organised into tables. If you're familiar with spreadsheets or relational databases, you should find your way around easily. But even if you're not, it's not really difficult to figure out how it works.
x.y refers to column y of table x
x ^ y is exponentiation (x to the power of y)
Rounding functions:
F: Floor (round towards negative infinity)
C: Ceiling (round towards positive infinity)
R: Round to nearest integer. Round .5 towards positive infinity.
P: Special rounding used by purchase prices. Depends on the number of digits before the decimal point. For 1-3 digits, use ceiling. For 4-5 digits, round up to the nearest multiple of 10. For 6 digits, round up to the nearest multiple of 100. (I have not yet seen more than 6 digits.)
Note that the given formulas are applicable only to items that can be looted from normal mobs or purchased from NPCs and lucky boxes. Magnanite items and "unique" boss items may use different formulas.
I've attached the tables that are referenced by the formulas: 31938
Armor bonus
Description: Bonus armor points, shown in parentheses on armors.
Formula: (material.bonus + quality.bonus + enchantment.bonus) / 4
Rounding: C
Block chance
Description: Block chance for shields.
Formula: R(armor_points / 4) / 2
Rounding: R
Notes:
I know the double rounding and division looks odd, but simply dividing by 8 and rounding the end result (with any of the rounding methods) does not seem to work. Block chance was halved in one of the game updates, so this still makes some sense.
I have not verified this formula for all shields yet.
Damage bonus
Description: Bonus damage, shown in parentheses on weapons. (Arrows do not gain a damage bonus.)
Formula: (material.bonus + quality.bonus + enchantment.bonus) * class.bonus
Rounding: C
Durability (maximum)
Description: Maximum durability points of any armor or weapon.
Formula: 4 * (material.durability + quality.durability) + 2 * level
Rounding: -
Note: level is the level requirement of the item, *not* the "item level" attribute.
Hit chance bonus
Description: Hit chance bonus for weapons. All weapons have this, but special/magical/epic weapons may have additional hit chance bonuses. (Arrows do not gain a hit chance bonus.)
Formula: (material.hit_chance + quality.hit_chance) * class.bonus
Rounding: C
Item level
Description: The "item level" of any weapon, armor or arrow. Usually the same as the level requirement, but not always.
Formula:
For armors: (armor_points + material.bonus) / 4 * 1.002088 - 1
For arrows: damage + C(material.bonus / 4) - 1
For weapons: (damage + C(material.bonus * class.bonus)) / speed.factor * class.level * (range + 39) / 40.731285 - 1
Rounding: F
Notes:
For spears, use range = 2.5, for other melee weapons, use range = 1.5
For bows, use the old bow range (current bow range minus 5)
damage is the average base damage (summed for all damage types), not counting the damage bonus in parentheses and other damage bonuses (special/magical/epic bonuses)
Regarding the weird constants (1.002088, 39 and 40.731285): they don't make much sense to me yet either, but they work, and even tiny modifications can break the formulas. The non-integer constants are fine-tuned so that the price of a "normalized" level 50 weapon or full level 50 set of armors would be a "nice" number (250 000 in both cases - see the price formula). The constant for armors is otherwise not needed and can be dropped (set to 1).
"Big round metal shield" has consistently -8 item levels compared to what it should have. (This affects price calculations too.)
Price
Description: Cost of purchasing an item from an NPC.
Formula:
For arrows: (((item_level + 1) / 50) ^ 2.6 * 298.13 + 50) * material.price * quality.price
For weapons and armors: (((item_level + 1) / 50) ^ 2.6 * category.price * 250000 + 50) * material.price * quality.price
Rounding: P
Note: For arrows, the price is meant for a quantity of 50.
Repair cost
Description: Repair cost of a partially damaged item.
Formula: (max_durability - current_durability) / max_durability * P(price) / 4 + random
Rounding: ?
Note: random is not a joke - there really is a small random amount added every time when a point of durability is lost. The amount can be different for every "test run" even for the same amount of current_durability. It's probably a random portion of the cost for repairing 1 point of durability - needs more examination. (The random amount does not change until the next point of durability is lost.)
Selling price
Description: Selling price for a fully repaired item.
Formula: P(price) / 8
Rounding: F
Note: Selling price for damaged items is lower - exact amount is not yet determined. The same random amount that appears in the repair cost seems to affect this too.