v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "40d:Item quality"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(→‎Weapons {{ver|0.23.130.23a}}: I removed a bit that somebody wrote that committed two faux pas: 1.) he contradicted toady, and 2.) he did so while he was wrong and toady was right.)
 
(31 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 +
{{av}}{{Quality|Exceptional}}
 
''Also see [[Item designations]].''
 
''Also see [[Item designations]].''
  
 
All items in the game have a [[item value|base value]], which is multiplied by what [[material value|material]] the item is made of and by the item's '''quality'''.  [[Decoration]]s (such as bone, gems, and studding) further increase the value.
 
All items in the game have a [[item value|base value]], which is multiplied by what [[material value|material]] the item is made of and by the item's '''quality'''.  [[Decoration]]s (such as bone, gems, and studding) further increase the value.
  
Item quality can have an effect on an item's properties, especially [[armor]] and [[weapons]].
+
Item quality can have an effect on an item's properties, especially [[armor]] and [[weapon]]s.
  
 
[[Room]]s also have a "quality grade" which determines their [[Room#Specific_room_quality_grades|value]] in the eyes of those owning/using the room, which is the sum of the objects placed within their designated area plus the [[material]]s that surround it plus improvements (such as [[engraving]]) to those materials.  See [[room]] for a more complete discussion of these values, and [[How do I increase the value of a room]] for a complete list of options.
 
[[Room]]s also have a "quality grade" which determines their [[Room#Specific_room_quality_grades|value]] in the eyes of those owning/using the room, which is the sum of the objects placed within their designated area plus the [[material]]s that surround it plus improvements (such as [[engraving]]) to those materials.  See [[room]] for a more complete discussion of these values, and [[How do I increase the value of a room]] for a complete list of options.
Line 10: Line 11:
 
== Quality grades ==
 
== Quality grades ==
  
All crafted items ([[furniture]], [[armor]], [[bolts]], etc.) – but not intermediate materials ([[bars]], [[blocks]], etc. except [[cloth]], which does have quality levels) – are bracketed by characters that show the quality of their craftsdwarfship. Dyeing also has a quality level, as does Decorating/Encrusting (with gems, leathers, cloth, etc). Prepared foods have quality levels. Alcohol has a hidden quality rating that controls the amount of happiness a dwarf gets from drinking it. It is not yet known whether the damage or destruction of masterful alcohol can cause tantrums.
+
All crafted items ([[furniture]], [[armor]], [[bolt]]s, etc.) – but not intermediate materials ([[bar]]s, [[block]]s, etc. except [[cloth]], which does have quality levels) – are bracketed by characters that show the quality of their craftsdwarfship. Dyeing also has a quality level, as does Decorating/Encrusting (with gems, leathers, cloth, etc.). Prepared foods have quality levels.
  
 
{|
 
{|
Line 37: Line 38:
 
When a masterful quality item is created, the game will announce, "<dwarf> has created a masterpiece!"  The loss, destruction or theft of such a masterpiece will cause the dwarf that created it a ''very'' unhappy thought. [[Trading]] a masterpiece item to merchants is always safe. Masterpiece meals can be eaten safely, although allowing the food to rot will provoke the same response as theft or destruction. Using masterpiece bolts will not cause a tantrum, even if the bolts break - however, ''losing'' a bolt, even one left on the battlefield, will. So if a kobold or wild animal steals a used masterpiece bolt which was lying around, or misses its target and falls into the [[chasm]] or is melted by "the impertinent [[magma]]", this also counts as defacement, and the maker's mood will decrease (but not as much as might be - see below).  
 
When a masterful quality item is created, the game will announce, "<dwarf> has created a masterpiece!"  The loss, destruction or theft of such a masterpiece will cause the dwarf that created it a ''very'' unhappy thought. [[Trading]] a masterpiece item to merchants is always safe. Masterpiece meals can be eaten safely, although allowing the food to rot will provoke the same response as theft or destruction. Using masterpiece bolts will not cause a tantrum, even if the bolts break - however, ''losing'' a bolt, even one left on the battlefield, will. So if a kobold or wild animal steals a used masterpiece bolt which was lying around, or misses its target and falls into the [[chasm]] or is melted by "the impertinent [[magma]]", this also counts as defacement, and the maker's mood will decrease (but not as much as might be - see below).  
  
The magnitude of the unhappy thought is equal to 1000 divided by the number of masterworks the dwarf has created{{verify}}.  So an engraver with hundreds of masterwork images on the walls of the fortress or a bonecarver with several dozen masterpiece bone bolts will be merely irked by the destruction of one of their many masterworks, while a dwarf who has only made a single masterwork item would be deeply and significantly affected.
+
The magnitude of the unhappy thought is equal to 1000{{verify}} divided by the number of masterworks the dwarf has created.  So an engraver with hundreds of masterwork images on the walls of the fortress or a bonecarver with several dozen masterpiece bone bolts will be merely irked by the destruction of one of their many masterworks, while a dwarf who has only made a single masterwork item would be deeply and significantly affected.
  
 
Since [[legendary]] dwarves are most likely to be the ones creating masterpieces, keeping these creations safe should be high priority; [[tantrum]]ing legendary dwarves can be very difficult to subdue.
 
Since [[legendary]] dwarves are most likely to be the ones creating masterpieces, keeping these creations safe should be high priority; [[tantrum]]ing legendary dwarves can be very difficult to subdue.
  
 
====Artifacts====
 
====Artifacts====
[[Artifact]] items have a unique name instead of bracketing symbols and are worth 120x base value. Artifacts, like masterpiece items, will cause a significant mood drop in the creator when destroyed or stolen. According to inspections of the memory values, it seems that artifacts have the same quality value as masterpiece items.  It is unclear if this is true for weapons/armor or not - opinions differ as to whether artifact weapons and armor have a 2.0 multiplier or something higher; nothing has been found in the game code to support such, but observation suggests otherwise.
+
[[Artifact]] items have a unique name instead of bracketing symbols and are worth 120x base value. Unlike masterpiece items, the loss of an artifact will not result in any unhappiness in any of your dwarves, but it may result in a significant mood drop in the current overseer (i.e. ''you''). According to inspections of the memory values, it seems that artifacts have the same quality value as masterpiece items.  It is unclear if this is true for weapons/armor or not - opinions differ as to whether artifact weapons and armor have a 2.0 multiplier or something higher; nothing has been found in the game code to support such, but observation suggests otherwise.
  
 
== Skill and quality levels ==
 
== Skill and quality levels ==
  
Tradesdwarves of different [[skill]] levels will produce items of differing quality. "Dabbling" dwarves never (without applicable preference) produce anything above a basic quality item, [[legendary]] dwarves usually produce Exceptional items, and the best legendary dwarves produce Masterful items approximately 27% of the time.
+
Tradesdwarves of higher [[skill]] levels will ''tend'' to produce items of higher quality. Looking at the table below, we see that "Dabbling" dwarves never (without an applicable [[preference]]) produce anything above a basic "no quality" item, Proficient dwarves (the highest possible skill level at [[embark]]) always produce at least some quality and usually +Finely Crafted items+, while [[legendary]] dwarves usually (65% of the time) produce ≡Exceptional items≡, and the best legendary dwarves produce nothing ''less'' than ≡Exceptional≡ and produce ☼Masterful items☼ approximately 27% of the time.
  
Preferences for particular materials and objects make a considerable difference. Although the exact adjustment is unknown, preliminary testing indicates that they can boost effective skill (not quality) by one to three levels (if the craftdwarf likes the item type, subtype and material).
+
Preferences for particular materials and/or objects make a considerable difference in the odds of producing better quality items, with each matching preference boosting the effective skill (not quality) by one level (if the craftdwarf likes the item type, subtype and material) and overlapping preferences being cumulative (such as for both [[silver]] + [[axe]]s, or [[wood|birch]] + [[bed]]s, etc.).
  
 
{| border="1" cellpadding="5" cellspacing="0" valign="bottom"
 
{| border="1" cellpadding="5" cellspacing="0" valign="bottom"
 
|-
 
|-
!Chance for  !!No quality!!-Well-crafted-!!+Finely-crafted+!!*Superior quality*!!≡Exceptional≡!!☼Masterful☼!!Average [[Value]] Multiplier!!Jump in Average Value
+
!Lvl !! Skill of dwarf !! No quality !! -Well-crafted- !! +Finely-crafted+ !! *Superior quality* !! ≡Exceptional≡ !! ☼Masterful☼ !! Average<br />[[Value]] Multiplier !! Jump in<br />Average Value
 
|-
 
|-
|Dabbling|| 100.0%      || || || || || ||1.000||
+
| 0 || Dabbling|| 100.0%      || || || || || ||1.000||
 
|-
 
|-
|Novice|| 63.0% || 31.4%        || 5.2% || 0.38%    || 0.01%    || 0.000089%    ||1.430||0.430
+
| 1 || Novice|| 63.0% || 31.4%        || 5.2% || 0.38%    || 0.01%    || 0.000089%    ||1.430||0.430
 
|-
 
|-
|No|| 36.4%    || 44.1%        || 16.7%        || 2.6% || 0.16%    || 0.0028%    ||1.860||0.430
+
| 2 || Adequate|| 36.4%    || 44.1%        || 16.7%        || 2.6% || 0.16%    || 0.0028%    ||1.860||0.430
 
|-
 
|-
|Competent|| 18.3%      || 43.8%        || 29.4%        || 7.7% || 0.79%    || 0.022%    ||2.291||0.431
+
| 3 || Competent|| 18.3%      || 43.8%        || 29.4%        || 7.7% || 0.79%    || 0.022%    ||2.291||0.431
 
|-
 
|-
|Skilled|| 6.7% || 35.6%        || 39.4%        || 15.8%        || 2.4% || 0.091%    ||2.725||0.434
+
| 4 || Skilled|| 6.7% || 35.6%        || 39.4%        || 15.8%        || 2.4% || 0.091%    ||2.725||0.434
 
|-
 
|-
|Proficient|| || 23.3%  || 44.4%        || 26.4%        || 5.6% || 0.28%    ||3.167||0.441
+
| 5 || ''Proficient''*|| || 23.3%  || 44.4%        || 26.4%        || 5.6% || 0.28%    ||3.167||0.441
 
|-
 
|-
|Talented|| || 15.5%    || 41.5%        || 33.3%        || 9.2% || 0.58%    ||3.415||0.248
+
| 6 || Talented|| || 15.5%    || 41.5%        || 33.3%        || 9.2% || 0.58%    ||3.415||0.248
 
|-
 
|-
|Adept|| || 9.4%        || 36.3%        || 39.2%        || 14.0%        || 1.1% ||3.674||0.259
+
| 7 || Adept|| || 9.4%        || 36.3%        || 39.2%        || 14.0%        || 1.1% ||3.674||0.259
 
|-
 
|-
|Expert|| || 5.0%      || 29.7%        || 43.5%        || 20.0%        || 1.8% ||3.949||0.275
+
| 8 || Expert|| || 5.0%      || 29.7%        || 43.5%        || 20.0%        || 1.8% ||3.949||0.275
 
|-
 
|-
|Professional|| || 1.9% || 22.2%        || 45.8%        || 27.2%        || 2.9% ||4.245||0.296
+
| 9 || Professional|| || 1.9% || 22.2%        || 45.8%        || 27.2%        || 2.9% ||4.245||0.296
 
|-
 
|-
|Accomplished|| || || 14.4%    || 45.6%        || 35.6%        || 4.4% ||4.567||0.322
+
|10 || Accomplished|| || || 14.4%    || 45.6%        || 35.6%        || 4.4% ||4.567||0.322
 
|-
 
|-
|Great|| || || 10.2%    || 42.4%        || 41.4%        || 5.9% ||4.785||0.218
+
|11 || Great|| || || 10.2%    || 42.4%        || 41.4%        || 5.9% ||4.785||0.218
 
|-
 
|-
|Master|| || || 6.7%    || 38.2%        || 47.4%        || 7.7% ||5.021||0.236
+
|12 || Master|| || || 6.7%    || 38.2%        || 47.4%        || 7.7% ||5.021||0.236
 
|-
 
|-
|High Master|| || || 3.9%      || 33.0%        || 53.3%        || 9.8% ||5.276||0.255
+
|13 || High Master|| || || 3.9%      || 33.0%        || 53.3%        || 9.8% ||5.276||0.255
 
|-
 
|-
|Grand Master|| || || 1.6%    || 26.9%        || 59.2%        || 12.2%        ||5.552||0.276
+
|14 || Grand Master|| || || 1.6%    || 26.9%        || 59.2%        || 12.2%        ||5.552||0.276
 
|-
 
|-
|Legendary|| || || || 20.0%    || 65.0%        || 15.0%        ||5.850||0.298
+
|15 || Legendary|| || || || 20.0%    || 65.0%        || 15.0%        ||5.850||0.298
 
|-
 
|-
|Legendary+1|| || || || 15.7%  || 67.2%        || 17.1%        ||6.037||0.187
+
|16 || Legendary+1|| || || || 15.7%  || 67.2%        || 17.1%        ||6.037||0.187
 
|-
 
|-
|Legendary+2|| || || || 11.6%  || 69.1%        || 19.3%        ||6.233||0.195
+
|17 || Legendary+2|| || || || 11.6%  || 69.1%        || 19.3%        ||6.233||0.195
 
|-
 
|-
|Legendary+3|| || || || 7.6%    || 70.8%        || 21.6%        ||6.436||0.203
+
|18 || Legendary+3|| || || || 7.6%    || 70.8%        || 21.6%        ||6.436||0.203
 
|-
 
|-
|Legendary+4|| || || || 3.7%    || 72.2%        || 24.1%        ||6.647||0.211
+
|19 || Legendary+4|| || || || 3.7%    || 72.2%        || 24.1%        ||6.647||0.211
 
|-
 
|-
|Legendary+5|| || || || || 73.3%        || 26.7%        ||6.867||0.219
+
|20 || Legendary+5|| || || || || 73.3%        || 26.7%        ||6.867||0.219
 
|-
 
|-
 
+
|21 || ''Legendary+6''**|| || || || || 72.0%        || 28.0%        ||6.96||0.093
 +
|-
 +
|22 || ''Legendary+7''**|| || || || || 70.7%        || 29.3%        ||7.053||0.093
 +
|-
 +
|23 || ''Legendary+8''***|| || || || || 69.3%        || 30.7%        ||7.146||0.093
 +
|-
 +
|24 || ''Legendary+9''***|| || || || || 68.0%        || 32.0%        ||7.24||0.093
 +
|-
 +
|25 || ''Legendary+10''***|| || || || || 66.7%        || 33.3%        ||7.333||0.093
 
|}
 
|}
  
The above table is based on the formula discovered by [[User:0x517A5D|0x517A5D]]:
+
:''(* Proficient is the highest level a dwarf can have at embark.)''
 +
:''(** Legendary+6 and Legendary+7 can '''only''' be reached by making items that coincide with the dwarf's [[preference]]s)''
 +
:''(*** Legendary+8 thru Legendary+10 are only relevant for certain skills, such as [[farming]], [[fishing]], [[plant gathering]], and [[engraving]])''
 +
::''(The above table is based on the formula discovered by [[User:0x517A5D|0x517A5D]])''
  
First, a skill level is computed, directly related to the dabbling...legendary indicators and likes of the particular crafter. No skill or dabbling is 0, legendary is 15. It is capped at 20.
+
===The math behind the curtain===
 +
The in-game calculations to determine final quality of a product work like this: first, a skill level is computed, directly related to the dabbling through Legendary+5 indicators and preferences of the particular crafter. "No skill" or dabbling is 0, proficient is 5, legendary is 15, etc. In most cases, skill levels are capped at 20 (so levels beyond Legendary +5 don't produce Masterpieces more often), but any bonuses from preferences are added ''afterwards''.
  
 
Item quality is set to 0.
 
Item quality is set to 0.
  
Then dice are rolled. Each roll is independent; all rolls are made even if a previous roll fails.
+
Then dice are rolled between 0 and the target number minus 1 (e.g. "d3" gives a 0, 1, or 2). Each roll is independent; all rolls are made even if a previous roll fails.
  
* If d5 < skill level, quality is bumped.
+
* If d5 < skill level, quality of final product is bumped.
 
* If d10 < skill level, quality is bumped.
 
* If d10 < skill level, quality is bumped.
 
* If d15 < skill level, quality is bumped.
 
* If d15 < skill level, quality is bumped.
 
* If d20 < skill level, quality is bumped.
 
* If d20 < skill level, quality is bumped.
* If d25 < skill level and d3 == 1, quality is bumped.
+
* If d25 < skill level and d3 == 0, quality is bumped.
 
This gives the 6 quality levels (0 to 5).
 
This gives the 6 quality levels (0 to 5).
<!--
 
Here is 0x517A5D's disassembly and analysis, up-to-date as of version .40d9:
 
  
; ---------------------------------------------------------------------------
+
According to inspections of the memory values, it seems that artifacts have a quality of 5.
 +
 
 +
:::::::::''Full code breakdown here:''
 +
{{Spoil small|Here is Quietust's disassembly and analysis, up-to-date as of version 0.28.181.40d:<br /><br />
 +
 
 +
---------------------------------------------------------------------------------
 +
<nowiki>
 +
; First, check what skill is being used
 +
                                        ; arg_4 is the job being completed
 +
                mov    ebx, [esp+44h+arg_4]
 +
                                        ; arg_0 is the unit performing the job
 +
                mov    esi, [esp+44h+arg_0]
 +
                push    1
 +
                mov    ebp, ecx        ; ECX is the item being created
 +
                call    job_getSkill
 +
                cmp    eax, 0FFFFFFFFh
 +
                jnz    short loc_6EA4EC
 +
                xor    edi, edi
 +
                jmp    short loc_6EA4F4
  
loc_6FCB92:
+
; Next, get the level of that skill, if there is one (if not, it will use 0 instead)
 +
loc_6EA4EC:
 
                 push    eax
 
                 push    eax
                 call    get_dorf_level_in_a_skill
+
                 call    unit_getSkillLevel
                 mov    ebx, eax
+
                 mov    edi, eax       ; Get the maker's uncapped skill level for the job
 +
 
 +
; Cap the skill level to a maximum of 20
 +
loc_6EA4F4:
 +
                cmp    edi, 20
 +
                mov    [ebp+60h], edi
 +
                jle    short loc_6EA501
 +
                mov    edi, 20
  
loc_6FCB9A:
+
; Check if the item's type/subtype match any Item preferences in the maker
                 cmp     ebx, 20
+
loc_6EA501:
                 mov    [edi+7Ah], bx  ; Save the creator's true skill level.
+
                 mov     eax, [ebp+0]
                                        ; EDI points to the item being created.
+
                 mov    edx, [eax+4]
 +
                push    1
 +
                push    0FFFFFFFFh
 +
                push    0FFFFFFFFh
 +
                mov    ecx, ebp
 +
                call    edx            ; get the item subtype
 +
                mov    ecx, ebp
 +
                push    eax
 +
                mov    eax, [ebp+0]
 +
                mov    edx, [eax]
 +
                call    edx            ; and the item type
 +
                push    eax
 +
                push    4              ; LikeItem
 +
                call    unit_checkPreference
 +
                test    al, al
 +
                jz      short loc_6EA52A
 +
                add    edi, 1          ; if so, increase skill level by 1
  
                 jle     short loc_6FCBA8
+
; Check if the item's material/matgloss match any Material preferences in the maker
                 mov    ebx, 20        ; EBX is a value in the range of [0..20],
+
loc_6EA52A:
                                        ; and is the (capped) skill level of the
+
                 movzx  eax, word ptr [ebp+58h]
                                        ; creator, possibly adjusted for material
+
                cmp     ax, 0FFFFh      ; skip if item has no material
                                        ; preferences, I didn't check.
+
                jz      short loc_6EA54E
 +
                 movzx  ecx, word ptr [ebp+5Ah]
 +
                push    1
 +
                push    ecx            ;field 5Ah is matgloss
 +
                push    eax            ;field 58h is material
 +
                push    0FFFFFFFFh
 +
                push    0FFFFFFFFh
 +
                push    0              ; LikeMaterial
 +
                call    unit_checkPreference
 +
                test    al, al
 +
                jz      short loc_6EA54E
 +
                add    edi, 1          ; if so, increase skill level by 1
  
 
; We roll a d5 and compare the result with the creator's skill level.
 
; We roll a d5 and compare the result with the creator's skill level.
 
; (Technically, we compare d5 - 1 against skill_level - 1.)
 
; (Technically, we compare d5 - 1 against skill_level - 1.)
  
loc_6FCBA8:                            ; field 78h is quality.
+
loc_6EA54E:                            ; field 5Eh is quality
                xor    eax, eax
+
                 mov    word ptr [ebp+5Eh], 0
 
 
                 mov    [edi+78h], ax  ; Init item quality to 0
 
  
                 call    mt_engine      ; Get a random number (returned in EAX).
+
                 call    mt_trandom      ; Get a random number (returned in EAX)
  
 
                 mov    ecx, eax        ; This mess is a division by 5,
 
                 mov    ecx, eax        ; This mess is a division by 5,
Line 159: Line 221:
 
                                         ; i.e. d5 - 1
 
                                         ; i.e. d5 - 1
  
                 cmp    edx, ebx       ; Compare the "die roll" against the
+
                 cmp    edx, edi       ; Compare the "die roll" against the
                                         ; 0-based skill level (still in EBX).
+
                                         ; 0-based skill level (still in EDI)
                 jge    short loc_6FCBE1
+
                 jge    short loc_6EA588
                add    [edi+78h], bp  ; If the random number was less than
+
                                        ; If the random number was less than
 
                                         ; the skill level,
 
                                         ; the skill level,
                                         ; add 1 to the quality level.
+
                add    word ptr [ebp+5Eh], 1
                                        ; (BP is known to be 1, and
+
                                         ; add 1 to the quality level
                                        ; item quality is known to be 0.)
 
  
 
; Now we roll a d10 and compare.  It's important to note that the roll
 
; Now we roll a d10 and compare.  It's important to note that the roll
 
; of the d10 is independent, not conditional, of the roll of the d5.
 
; of the d10 is independent, not conditional, of the roll of the d5.
  
loc_6FCBE1:                            ; Random number
+
loc_6EA588:                            ; Random number
                 call    mt_engine
+
                 call    mt_trandom
 
                 mov    ecx, eax        ; Modulus
 
                 mov    ecx, eax        ; Modulus
 
                 mov    eax, 3
 
                 mov    eax, 3
Line 187: Line 248:
 
                 shr    edx, 1Ah        ; now EDX is in the range [0..9]
 
                 shr    edx, 1Ah        ; now EDX is in the range [0..9]
 
                                         ; i.e. d10 - 1
 
                                         ; i.e. d10 - 1
                 cmp    edx, ebx       ; Compare
+
                 cmp    edx, edi       ; Compare
                 jge    short loc_6FCC14
+
                 jge    short loc_6EA5BC
                add    [edi+78h], bp  ; If d10 < skill, bump quality.
+
                                        ; If d10 < skill, bump quality
 +
                add    word ptr [ebp+5Eh], 1
  
loc_6FCC14:                            ; Same thing for a d15.
+
loc_6EA5BC:                            ; Same thing for a d15
                 call    mt_engine
+
                 call    mt_trandom
 
                 mov    ecx, eax
 
                 mov    ecx, eax
 
                 mov    eax, 3
 
                 mov    eax, 3
Line 207: Line 269:
 
                 shr    edx, 1Bh
 
                 shr    edx, 1Bh
 
                 cmp    edx, ebx
 
                 cmp    edx, ebx
                 jge    short loc_6FCC47
+
                 jge    short loc_6EA5F0
                add    [edi+78h], bp  ; If d15 < skill, bump quality.
+
                                        ; If d15 < skill, bump quality
 +
                add    word ptr [ebp+5Eh], 1
  
loc_6FCC47:                            ; Same thing for a d20.
+
loc_6EA5F0:                            ; Same thing for a d20
                 call    mt_engine
+
                 call    mt_trandom
 
                 mov    ecx, eax
 
                 mov    ecx, eax
 
                 mov    eax, 3
 
                 mov    eax, 3
Line 228: Line 291:
 
                 add    ecx, edx
 
                 add    ecx, edx
 
                 shr    ecx, 1Ah
 
                 shr    ecx, 1Ah
                 cmp    ecx, ebx
+
                 cmp    ecx, edi
                 jge    short loc_6FCC80
+
                 jge    short loc_6EA62A
                 add    [edi+78h], bp  ; If d20 < skill. bump quality.
+
                                        ; If d20 < skill, bump quality
 +
                 add    word ptr [ebp+5Eh], 1
  
loc_6FCC80:                            ; Now we roll a d25
+
loc_6EA62A:                            ; Now we roll a d25
                 call    mt_engine
+
                 call    mt_trandom
 
                 mov    ecx, eax
 
                 mov    ecx, eax
 
                 mov    eax, 3
 
                 mov    eax, 3
Line 247: Line 311:
 
                 mul    ecx
 
                 mul    ecx
 
                 shr    edx, 1Ah
 
                 shr    edx, 1Ah
                 cmp    edx, ebx       ; Compare against skill,
+
                 cmp    edx, edi       ; Compare against skill,
                 jge    short loc_6FCCE2
+
                 jge    short loc_6EA68B
                 call    mt_engine      ; AND roll a d3
+
                 call    mt_trandom      ; AND roll a d3
 
                 mov    ecx, eax
 
                 mov    ecx, eax
 
                 mov    eax, 3
 
                 mov    eax, 3
Line 263: Line 327:
 
                 mul    ecx
 
                 mul    ecx
 
                 shr    edx, 1Dh
 
                 shr    edx, 1Dh
                test    edx, edx        ; The d3 result must be 1.
+
                                        ; The d3 result must be 1.
 
                                         ; (Technically, d3-1 is tested against 0.)
 
                                         ; (Technically, d3-1 is tested against 0.)
                 jnz    short loc_6FCCE2
+
                 jnz    short loc_6EA68B
                add    [edi+78h], bp  ; If d25 < skill AND d3 = 1, bump
+
                                        ; If d25 < skill AND d3 = 1, bump
 +
                add    word ptr [ebp+5Eh], 1
  
loc_6FCCE2:
+
loc_6EA68B:
                 cmp    word ptr [edi+78h], 5
+
                 cmp    word ptr [ebp+5Eh], 5
                 jnz    loc_6FCE28
+
                 jnz    loc_6EA7BB
                 lea     ecx, [esp+40h+var_2C]
+
                 xor     edi, edi
                 call    ds:??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ
+
                mov    [esp+44h+var_14], 0Fh
                 lea     ecx, [esp-14h+arg_24]
+
                 mov    [esp+44h+var_18], edi
                 push    ecx
+
                 mov     byte ptr [esp+44h+var_28], 0
                 mov     ecx, esi
+
                 push    esi
                 mov    [esp-10h+arg_4C], 0
+
                 lea     ecx, [esp+48h+var_2C]
                 call    get_dorf_name
+
                 mov    [esp+48h+__$EHRec$.state], edi
 +
                 call    formatLanguageName
 
                 add    esp, 4
 
                 add    esp, 4
                 push    offset aHasCreatedAMasterpiece ; " has created a masterpiece!"
+
                push    1Bh
                 lea    ecx, [esp-10h+arg_24]
+
                 push    offset aHasCreatedAMas ; " has created a masterpiece!"
                 call    ds:??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z
+
                 lea    eax, [esp+4Ch+var_2C]
                 cmp    [esp-18h+arg_40], 10h
+
                 call    ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z
                mov    ecx, [esp-18h+arg_2C]
+
                 ...
                jnb    short loc_6FCD2C
+
</nowiki>
                lea    ecx, [esp-18h+arg_2C]
+
}}
-->
 
 
 
According to inspections of the memory values, it seems that artifacts have a quality of 5.
 
  
 
==Effects of Quality==
 
==Effects of Quality==
Line 298: Line 361:
 
===Food===
 
===Food===
  
Higher quality [[prepared meals]] give dwarfs who consume them more [[thought|happiness]].
+
Higher quality [[prepared meal]]s give dwarves who consume them more [[thought|happiness]].
  
 
===Furniture===
 
===Furniture===
Line 358: Line 421:
 
----
 
----
  
=DF 2010: Upcoming changes to artifact weapons=
 
Toady just gave us a further quote on weapon and armor quality, giving the game qualities of an "artifact" in the next version:
 
<div style="width: 50em; padding: 0.5em; margin-bottom: 1em; border: 1px solid #ccc; background: #eee;">
 
#Value*10.
 
#Cannot be owned (can be equipped, you might have to do it explicitly though).
 
#Armor deflection roll has *3 roll modifier instead of the masterwork's *2.
 
#Same for melee attack and archery rolls.
 
#It looks like the artifact edges are the maximum edge for the material, which is also what a masterwork gets, so beyond a masterwork you'd just be getting the hit roll modifier.
 
#Things like artifact bone spears will likely be crap against steel, yeah.  We don't have actual magical artifacts yet, and that's what would be required.
 
</div>
 
  
[[Category:Items|*Quality]]
+
{{Category|Items|*}}

Latest revision as of 01:04, 14 May 2024

This article is about an older version of DF.

Also see Item designations.

All items in the game have a base value, which is multiplied by what material the item is made of and by the item's quality. Decorations (such as bone, gems, and studding) further increase the value.

Item quality can have an effect on an item's properties, especially armor and weapons.

Rooms also have a "quality grade" which determines their value in the eyes of those owning/using the room, which is the sum of the objects placed within their designated area plus the materials that surround it plus improvements (such as engraving) to those materials. See room for a more complete discussion of these values, and How do I increase the value of a room for a complete list of options.

Quality grades[edit]

All crafted items (furniture, armor, bolts, etc.) – but not intermediate materials (bars, blocks, etc. except cloth, which does have quality levels) – are bracketed by characters that show the quality of their craftsdwarfship. Dyeing also has a quality level, as does Decorating/Encrusting (with gems, leathers, cloth, etc.). Prepared foods have quality levels.

Designation Description Value
Modifier
 Damage / To-Hit /
Armor Modifier
 Item Name —     ×1  ×1.0 
-Item Name- Well-crafted ×2  ×1.2 
+Item Name+ Finely-crafted ×3  ×1.4 
*Item Name* Superior quality ×4  ×1.6 
≡Item Name≡ Exceptional ×5  ×1.8 
☼Item Name☼ Masterful ×12  ×2.0 
Unique name Artifact ×120  ×2.0?*
(* An analysis of game memory indicates a base multiplier of 2.0, however observational reports (and some other elements of the game code) imply that the multiplier might be (significantly?) higher. As it stands, it's not perfectly clear - more research is needed.)

Masterpiece[edit]

A masterpiece is more than the highest normal quality and value - it is an artistic expression that is of great importance to the dwarf who created it.

When a masterful quality item is created, the game will announce, "<dwarf> has created a masterpiece!" The loss, destruction or theft of such a masterpiece will cause the dwarf that created it a very unhappy thought. Trading a masterpiece item to merchants is always safe. Masterpiece meals can be eaten safely, although allowing the food to rot will provoke the same response as theft or destruction. Using masterpiece bolts will not cause a tantrum, even if the bolts break - however, losing a bolt, even one left on the battlefield, will. So if a kobold or wild animal steals a used masterpiece bolt which was lying around, or misses its target and falls into the chasm or is melted by "the impertinent magma", this also counts as defacement, and the maker's mood will decrease (but not as much as might be - see below).

The magnitude of the unhappy thought is equal to 1000[Verify] divided by the number of masterworks the dwarf has created. So an engraver with hundreds of masterwork images on the walls of the fortress or a bonecarver with several dozen masterpiece bone bolts will be merely irked by the destruction of one of their many masterworks, while a dwarf who has only made a single masterwork item would be deeply and significantly affected.

Since legendary dwarves are most likely to be the ones creating masterpieces, keeping these creations safe should be high priority; tantruming legendary dwarves can be very difficult to subdue.

Artifacts[edit]

Artifact items have a unique name instead of bracketing symbols and are worth 120x base value. Unlike masterpiece items, the loss of an artifact will not result in any unhappiness in any of your dwarves, but it may result in a significant mood drop in the current overseer (i.e. you). According to inspections of the memory values, it seems that artifacts have the same quality value as masterpiece items. It is unclear if this is true for weapons/armor or not - opinions differ as to whether artifact weapons and armor have a 2.0 multiplier or something higher; nothing has been found in the game code to support such, but observation suggests otherwise.

Skill and quality levels[edit]

Tradesdwarves of higher skill levels will tend to produce items of higher quality. Looking at the table below, we see that "Dabbling" dwarves never (without an applicable preference) produce anything above a basic "no quality" item, Proficient dwarves (the highest possible skill level at embark) always produce at least some quality and usually +Finely Crafted items+, while legendary dwarves usually (65% of the time) produce ≡Exceptional items≡, and the best legendary dwarves produce nothing less than ≡Exceptional≡ and produce ☼Masterful items☼ approximately 27% of the time.

Preferences for particular materials and/or objects make a considerable difference in the odds of producing better quality items, with each matching preference boosting the effective skill (not quality) by one level (if the craftdwarf likes the item type, subtype and material) and overlapping preferences being cumulative (such as for both silver + axes, or birch + beds, etc.).

Lvl Skill of dwarf No quality -Well-crafted- +Finely-crafted+ *Superior quality* ≡Exceptional≡ ☼Masterful☼ Average
Value Multiplier
Jump in
Average Value
0 Dabbling 100.0% 1.000
1 Novice 63.0% 31.4% 5.2% 0.38% 0.01% 0.000089% 1.430 0.430
2 Adequate 36.4% 44.1% 16.7% 2.6% 0.16% 0.0028% 1.860 0.430
3 Competent 18.3% 43.8% 29.4% 7.7% 0.79% 0.022% 2.291 0.431
4 Skilled 6.7% 35.6% 39.4% 15.8% 2.4% 0.091% 2.725 0.434
5 Proficient* 23.3% 44.4% 26.4% 5.6% 0.28% 3.167 0.441
6 Talented 15.5% 41.5% 33.3% 9.2% 0.58% 3.415 0.248
7 Adept 9.4% 36.3% 39.2% 14.0% 1.1% 3.674 0.259
8 Expert 5.0% 29.7% 43.5% 20.0% 1.8% 3.949 0.275
9 Professional 1.9% 22.2% 45.8% 27.2% 2.9% 4.245 0.296
10 Accomplished 14.4% 45.6% 35.6% 4.4% 4.567 0.322
11 Great 10.2% 42.4% 41.4% 5.9% 4.785 0.218
12 Master 6.7% 38.2% 47.4% 7.7% 5.021 0.236
13 High Master 3.9% 33.0% 53.3% 9.8% 5.276 0.255
14 Grand Master 1.6% 26.9% 59.2% 12.2% 5.552 0.276
15 Legendary 20.0% 65.0% 15.0% 5.850 0.298
16 Legendary+1 15.7% 67.2% 17.1% 6.037 0.187
17 Legendary+2 11.6% 69.1% 19.3% 6.233 0.195
18 Legendary+3 7.6% 70.8% 21.6% 6.436 0.203
19 Legendary+4 3.7% 72.2% 24.1% 6.647 0.211
20 Legendary+5 73.3% 26.7% 6.867 0.219
21 Legendary+6** 72.0% 28.0% 6.96 0.093
22 Legendary+7** 70.7% 29.3% 7.053 0.093
23 Legendary+8*** 69.3% 30.7% 7.146 0.093
24 Legendary+9*** 68.0% 32.0% 7.24 0.093
25 Legendary+10*** 66.7% 33.3% 7.333 0.093
(* Proficient is the highest level a dwarf can have at embark.)
(** Legendary+6 and Legendary+7 can only be reached by making items that coincide with the dwarf's preferences)
(*** Legendary+8 thru Legendary+10 are only relevant for certain skills, such as farming, fishing, plant gathering, and engraving)
(The above table is based on the formula discovered by 0x517A5D)

The math behind the curtain[edit]

The in-game calculations to determine final quality of a product work like this: first, a skill level is computed, directly related to the dabbling through Legendary+5 indicators and preferences of the particular crafter. "No skill" or dabbling is 0, proficient is 5, legendary is 15, etc. In most cases, skill levels are capped at 20 (so levels beyond Legendary +5 don't produce Masterpieces more often), but any bonuses from preferences are added afterwards.

Item quality is set to 0.

Then dice are rolled between 0 and the target number minus 1 (e.g. "d3" gives a 0, 1, or 2). Each roll is independent; all rolls are made even if a previous roll fails.

  • If d5 < skill level, quality of final product is bumped.
  • If d10 < skill level, quality is bumped.
  • If d15 < skill level, quality is bumped.
  • If d20 < skill level, quality is bumped.
  • If d25 < skill level and d3 == 0, quality is bumped.

This gives the 6 quality levels (0 to 5).

According to inspections of the memory values, it seems that artifacts have a quality of 5.

Full code breakdown here:


Effects of Quality[edit]

Most obviously, quality influences the monetary worth of an object, for purposes of trading and determining price (the latter once economy starts). Destruction of a masterwork will also cause relevant unhappiness. However, for some items, quality may also influence other things.

Note that this is not a complete list.

Food[edit]

Higher quality prepared meals give dwarves who consume them more happiness.

Furniture[edit]

Because room quality is based on total value of the furniture in a room, high-quality furniture will result in high quality rooms, which provide more satisfaction for the occupants.

Weapons v0.23.130.23a[edit]

To quote Toady:

The quality of any weapon, including crossbows used as launchers, affects the skill of the shooter. I think this even leads to obscene things like master crossbows + master bolts causing recruits to shoot like legends. In general, if the quality Q is from 0 to 5, the skill is modified according to

Skillnew = Skilloriginal × (1.0 + 0.2 × Q) + Q

This is pretty extreme and will probably be reduced for all weapons.

See this chart for the exact levels:

Note: This chart is out of date/wrong due to the facts that the integer that represents a specific skill level is not known, how the formula rounds is not known, and the fact that higher legendaries exist is known.

Result for Well-crafted Finely-crafted Superior quality Exceptional Masterful
Dabbling No label Skilled Talented Expert Accomplished
Novice Competent Proficient Expert Accomplished Master
No label Skilled Adept Professional Master Grand Master
Competent Talented Expert Great High Master Legendary
Skilled Adept Accomplished Master Legendary Legendary
Proficient Expert Great Grand Master Legendary Legendary
Talented Professional Master Legendary Legendary Legendary
Adept Accomplished Grand Master Legendary Legendary Legendary
Expert Master Legendary Legendary Legendary Legendary
Professional High Master Legendary Legendary Legendary Legendary
Accomplished Grand Master Legendary Legendary Legendary Legendary
Great and better Legendary Legendary Legendary Legendary Legendary

If this is true, then it would be possible to:

  1. Train a couple dozen skilled miners
  2. Give them exceptional picks
  3. Draft them and give them decent armor
  4. Kill a goblin siege with a couple dozen legendary speardwarves (picks = 70% damage spears) as long as there are no enemy champions to destroy your armour/shield/wrestling inept speardwarves