PDA

View Full Version : Item stats (research)


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.

Miraculix
01-31-2011, 10:56 PM
Thanks for this very interesting information!

If it is any help, when I was reverse-engineering the formulas for the xp to make the calculators for the Inquisition tools, if my results were off by 1-2 or something similar, I tried to move the stage at which I rounded intermediate results; For example, if there was some calculation like, oh say:

a/b + c/d

Since you need to display integers like in-game, I'd instinctively do:

round(a/b + c/d)

When this would give close but not exact results, I'd move the rounding in the intermediate results, like so:

round(a/b) + round(c/d)

Usually, this would solve most of the trouble I had when results were off by 1-2 points when compared to in-game numbers. Hope this helps!

Thanks for the info again :)

Narzoul
02-02-2011, 06:35 PM
Thanks for this very interesting information!

If it is any help, when I was reverse-engineering the formulas for the xp to make the calculators for the Inquisition tools, if my results were off by 1-2 or something similar, I tried to move the stage at which I rounded intermediate results; For example, if there was some calculation like, oh say:

a/b + c/d

Since you need to display integers like in-game, I'd instinctively do:

round(a/b + c/d)

When this would give close but not exact results, I'd move the rounding in the intermediate results, like so:

round(a/b) + round(c/d)

Usually, this would solve most of the trouble I had when results were off by 1-2 points when compared to in-game numbers. Hope this helps!

Thanks for the info again :)

Have tried many of these combinations too... but there are so many variables it's hard to go through every possibility.

Currently this is the most accurate "item level" formula I've found for 1-handed melee weapons (excluding spears):
(ROUND(average_base_damage) + material.bonus - 1) // speed.factor - 1

This is incorrect only for one item in the test database: Guardian mace of Bronze, which has a level requirement of 45, but the formula gives 46. There are 322 other (weapon name + material) combinations in the test database and all of them are correct according to the above formula.

Let's take a look at this basic formula for now:
(average_base_damage + material.bonus) / speed.factor - level

In the above case, don't apply rounding to the result of the division. Then I get results between 1.125 and 2.25. Since the min-max difference is 1.125, no combination of constant offset and rounding will give a correct formula. But the max value of 2.25 is only for Guardian mace of Bronze, if we remove this from the test, then the max would become 2.0 instead. Which means if we subtract 1.125 from the above formula and FLOOR the results, then we'd get a constant 0 difference and a working formula for every other item.

The reason I applied rounding to average_base_damage is because there's also only one item on the lower end of the differences (1.125). After applying rounding, the lower end goes up to 1.25, and the upper end still remains 2.25 (or 2.0 if we remove the Guardian mace of Bronze). So again, subtracting 1.25 from the end results and taking the FLOOR of the result, we get steady 0s and another working formula.

Basically, I got the same results instead by subtracting 1 from material.bonus instead, and then only subtracting 1 from the end result. If I try to add/subtract a different value from material.bonus, however, then the min-max difference is only going to get higher than 1, not lower.

Then, there are a bunch of other possibilities, e.g. applying rounding to the individual components of average_base_damage (average slashing damage + average piercing damage + ...). I tried many of these combinations too, even bringing the division by speed.factor inside this, with no luck...

If you want a puzzle, try to find a formula that works for these two items:

Broad sword of Bronze
Damage: 34-45 slashing
Speed: medium
Level: 8

Guardian mace of Bronze
Damage: 50-60 slashing, 104-170 blunt
Speed: medium
Level: 45

material.bonus = -3 and speed.factor = 4 for both.

These are the two "extremes" I mentioned earlier (1.125 and 2.25).


Two handed weapons are even more problematic because they have (approx.) 4/3 as much average_base_damage, so first we have to multiply average_base_damage by 0.75, which can introduce even more rounding errors...

And then there are bows and staves, with their added "range" stat... erm, let's just try to figure out melee weapons first I guess, that should make ranged weapons somewhat easier.



EDIT:

Had another look at 2-handed melee weapons (excluding spears, as usual). It seems the above formula works rather well for this too. We could get a few less mismatches if we used separate formulas for 1-handed and 2-handed weapons, but I prefer to have one unified formula (it's unlikely that NGD uses different formulas, too).

So, for now, I suggest using the following formula for all melee weapons, excluding spears:
((ROUND(average_base_damage) + material.bonus) * category.level_factor - 1) // speed.factor - 1

The value of category.level_factor is 1 for all 1-handed weapons, and 0.75 for all 2-handed weapons.


Using this formula, we can now (approximately) calculate the actual levels of some interesting melee weapons, such as magnanite, boss drop and world cup event weapons. Of course, I don't know the exact value of material.quality for Magnanite and Gold, but I know a good approximate value for them: +21 and +3 respectively (with +/-1 accuracy).


1-handed weapons:

lv54 (54.0000) Ancestral Axe of Magnanite (Artisan)
lv54 (54.0000) Ancient Hammer of Magnanite (Artisan)
lv56 (56.6667) Ancestral Sword of Magnanite (Artisan)

lv59 (59.0000) Desert Thunder of Fine Steel (Master)
lv58 (58.5625) Evendim's Power Sweep of Fine Steel (Master)
lv58 (58.8000) Thorkul's Crush of Fine Steel (Master)

lv54 (54.6667) Sword of the Champion of Gold (Artisan)


2-handed weapons:

lv52 (52.9500) Two handed ancestral axe of Magnanite (Artisan)
lv52 (52.9500) Two handed ancient hammer of Magnanite (Artisan)
lv53 (53.6875) Two handed ancestral sword of Magnanite (Artisan)

lv57 (57.3000) Divine Slayer of Fine Steel (Master)
lv56 (56.2083) Evendim's Power Strike of Fine Steel (Master)
lv43 (43.8000) Thorkul's Slaying Jaw of Fine Steel (Master)

lv50 (50.8500) Satarco's two handed sword of Fine Steel (Master)


The result on Thorkul's Slaying Jaw is rather odd, because Kyrottimus already posted a screenshot of its item level (from Amun), and it's supposedly level 46... I'm not sure where those extra 3 levels are coming from. Every item in my test database is accurate according to the used formula, up to a +/-1 difference. Weird.

Gabburtjuh
02-03-2011, 12:00 AM
I don't know if you acctually checked, but the last time I was in amun(2 days ago) my thorkul bow had item lvl 67, magn wep lvl 55, so for magn weps it seems to work with the +-1, but for bosses you seem abit off

Narzoul
02-03-2011, 12:33 AM
I don't know if you acctually checked, but the last time I was in amun(2 days ago) my thorkul bow had item lvl 67, magn wep lvl 55, so for magn weps it seems to work with the +-1, but for bosses you seem abit off

I wish I could check, but I don't have any magna or boss weapons. :P

Which magna weapon was it?

Bows, as I said I haven't looked into much. I know that material affects bow level a lot more than it does for melee weapons. This is true even for normal bows.

For example, a Composite Elven Bow of Soft Wood is level 41, while a Composite Elven Bow of Hardened Wood is level 46. The same amount of material.bonus difference for melee weapons only causes a difference of 2 or 3 in levels at most.

Gabburtjuh
02-03-2011, 02:12 PM
http://imgur.com/UZDgd No idea if the gems matter, I got different gems in horus but they aren't in amun yet >.> I'll get a pic of the thork bow to asap, but I'm letting someone borrow it so I got no acces, dun have any boss weps, for armor: All dragon items(except the ammu, which is lvl 127 if I remember right) are lvl 55.

Narzoul
02-03-2011, 04:27 PM
http://imgur.com/UZDgd No idea if the gems matter, I got different gems in horus but they aren't in amun yet >.> I'll get a pic of the thork bow to asap, but I'm letting someone borrow it so I got no acces, dun have any boss weps, for armor: All dragon items(except the ammu, which is lvl 127 if I remember right) are lvl 55.

Gems don't matter as far as I can tell. It would be weird if it did, imagine putting a gem into some normal loot item, and its level requirement would suddenly get higher... would be rather funny. :P

Dragon items being level 55 is definitely also wrong according to the formula I used for armors. Now it's becoming obvious to me that boss loot uses a different formula than normal loot.

The difference, based on dragon loots being level 55, seems to be that it also adds quality.bonus and enchantment.bonus into the calculation.

If I rewrite the armor level requirement formula this way:
(armor_points + material.bonus + quality.bonus + enchantment.bonus) // 4 - 1

then indeed dragon loot is level 55. Using the normal loot formula they would only be level 51.

I assume superboss weapons use a modified formula as well then.
Let's try this on Thorkul's Slaying Jaw:
(average_base_damage + material.bonus + quality.bonus + enchantment.bonus) * category.factor // speed.factor - 1

This gives level 47 (47.075), quite close to 46 now...

Thanks for the input, keep it coming. :)

Narzoul
02-17-2011, 03:29 PM
Updated the downloadable tables in the first post (link has been replaced).

- Added the following materials: Ethereal Weave, Gold, Alloy Steel, Magnanite
- Added the following quality: Artisan

Note that I set the bonus of Ethereal Weave to 16, although currently 13, 14 and 15 are also possible values. (Based on the new level 60 warmaster mage armors.) Can't tell more accurately until we see more armors made of Ethereal Weave.

All other values should be accurate.


EDIT: The bonus is confirmed to be 16 by new loot.

Narzoul
06-12-2011, 12:03 AM
Time for another update. List of changes:

Updated the downloadable tables
Corrected the block chance and item level formulas
Added item level formulas for the previously missing categories (arrows, bows, staves and spears)
Added price and repair cost formulas
Restructured the entire post

blood-raven
06-12-2011, 12:20 PM
just to check if i get it right: if i buy steel arrows instead of iron ones, i'll get more damage and more hc?

edit: at the dmg bonus you say "*class bonus" but what and how much is a class bonus? :p (sorry if this is a stupid question)

Narzoul
06-12-2011, 12:36 PM
just to check if i get it right: if i buy steel arrows instead of iron ones, i'll get more damage and more hc?

edit: at the dmg bonus you say "*class bonus" but what and how much is a class bonus? :p (sorry if this is a stupid question)

No, damage and hit chance bonuses are for weapons only, not for arrows. (I'll add this to the descriptions to clarify.) But price is still affected, so it's not really worth buying steel arrows over iron ones.

class.bonus refers to the "bonus" column of the "class" table, this is also included in the attachment. "class" is the class requirement of the item in question.