|This article is about an older version of DF.|
Also see Item designations.
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.
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.
| Damage / To-Hit /|
|*Item Name*||Superior quality||×4||×1.6|
- (* 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.)
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.
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
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. 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), and overlapping preferences seem to be 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
- (* Proficient is the highest level a dwarf can have at embark.)
- (The above table is based on the formula discovered by 0x517A5D)
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. Skill levels are capped at 20 (so Legendary +5 don't appear to produce Masterpieces more often in their preferences).
Item quality is set to 0.
Then dice are rolled. 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 == 1, 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:
|Here is Quietust's disassembly and analysis, up-to-date as of version 0.28.181.40d:|
; 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 ; Next, get the level of that skill, if there is one (if not, it will use 0 instead) loc_6EA4EC: push eax call unit_getSkillLevel 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 ; Check if the item's type/subtype match any Item preferences in the maker loc_6EA501: mov eax, [ebp+0] 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 ; Check if the item's material/matgloss match any Material preferences in the maker loc_6EA52A: movzx eax, word ptr [ebp+58h] cmp ax, 0FFFFh ; skip if item has no material 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. ; (Technically, we compare d5 - 1 against skill_level - 1.) loc_6EA54E: ; field 5Eh is quality mov word ptr [ebp+5Eh], 0 call mt_trandom ; Get a random number (returned in EAX) mov ecx, eax ; This mess is a division by 5, mov eax, 3 ; retaining the modulus. mul ecx ; It's done this way in the hope mov eax, ecx ; that three multiplies is less sub eax, edx ; expensive than a single divide. shr eax, 1 ; This technique is called add eax, edx ; "multiplying by the reciprocal." shr eax, 1Eh imul eax, 80000001h add ecx, eax mov eax, 4FFFFFFFh mul ecx shr edx, 1Bh ; now EDX is in the range [0..4] ; i.e. d5 - 1 cmp edx, edi ; Compare the "die roll" against the ; 0-based skill level (still in EDI) jge short loc_6EA588 ; If the random number was less than ; the skill level, add word ptr [ebp+5Eh], 1 ; add 1 to the quality level ; 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. loc_6EA588: ; Random number call mt_trandom mov ecx, eax ; Modulus mov eax, 3 mul ecx mov eax, ecx sub eax, edx shr eax, 1 add eax, edx shr eax, 1Eh imul eax, 80000001h add ecx, eax mov eax, 4FFFFFFFh mul ecx shr edx, 1Ah ; now EDX is in the range [0..9] ; i.e. d10 - 1 cmp edx, edi ; Compare jge short loc_6EA5BC ; If d10 < skill, bump quality add word ptr [ebp+5Eh], 1 loc_6EA5BC: ; Same thing for a d15 call mt_trandom mov ecx, eax mov eax, 3 mul ecx mov eax, ecx sub eax, edx shr eax, 1 add eax, edx shr eax, 1Eh imul eax, 80000001h add ecx, eax mov eax, 0EFFFFFF3h mul ecx shr edx, 1Bh cmp edx, ebx jge short loc_6EA5F0 ; If d15 < skill, bump quality add word ptr [ebp+5Eh], 1 loc_6EA5F0: ; Same thing for a d20 call mt_trandom mov ecx, eax mov eax, 3 mul ecx mov eax, ecx sub eax, edx shr eax, 1 add eax, edx shr eax, 1Eh imul eax, 80000001h add ecx, eax mov eax, 3FFFFFE3h mul ecx sub ecx, edx shr ecx, 1 add ecx, edx shr ecx, 1Ah cmp ecx, edi jge short loc_6EA62A ; If d20 < skill, bump quality add word ptr [ebp+5Eh], 1 loc_6EA62A: ; Now we roll a d25 call mt_trandom mov ecx, eax mov eax, 3 mul ecx mov eax, ecx sub eax, edx shr eax, 1 add eax, edx shr eax, 1Eh imul eax, 80000001h add ecx, eax mov eax, 0C7FFFFFDh mul ecx shr edx, 1Ah cmp edx, edi ; Compare against skill, jge short loc_6EA68B call mt_trandom ; AND roll a d3 mov ecx, eax mov eax, 3 mul ecx mov eax, ecx sub eax, edx shr eax, 1 add eax, edx shr eax, 1Eh imul eax, 80000001h add ecx, eax mov eax, 0BFFFFFFFh mul ecx shr edx, 1Dh ; The d3 result must be 1. ; (Technically, d3-1 is tested against 0.) jnz short loc_6EA68B ; If d25 < skill AND d3 = 1, bump add word ptr [ebp+5Eh], 1 loc_6EA68B: cmp word ptr [ebp+5Eh], 5 jnz loc_6EA7BB xor edi, edi mov [esp+44h+var_14], 0Fh mov [esp+44h+var_18], edi mov byte ptr [esp+44h+var_28], 0 push esi lea ecx, [esp+48h+var_2C] mov [esp+48h+__$EHRec$.state], edi call formatLanguageName add esp, 4 push 1Bh push offset aHasCreatedAMas ; " has created a masterpiece!" lea eax, [esp+4Ch+var_2C] call ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z ...
Effects of Quality
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.
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.
To quote Toady:
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|
|No label||Skilled||Adept||Professional||Master||Grand Master|
|Great and better||Legendary||Legendary||Legendary||Legendary||Legendary|
If this is true, then it would be possible to:
- Train a couple dozen skilled miners
- Give them exceptional picks
- Draft them and give them decent armor
- 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