Changes

ADVERTISEMENT
From Diablo Wiki
Jump to: navigation, search

Item Generation Tutorial

6,241 bytes added, 12:53, 11 May 2008
no edit summary
For a similar article discussing item generation in earlier versions of the game, check out the [[Item_Generation_v1.09|v1.09 Item Generation Tutorial]].
 
Item Generation Tutorial for Patch 1.11
v1.0
 
The Table of Contents
 
1. Basics
2. Terminology
3. Short Explanation of Drop Process
4. Game data files
4.1. TreasureClassEx.txt
4.2. Monstats.txt
4.3. MagicPrefix.txt and MagicSuffix.txt
4.4. Weapons.txt
4.5. Armor.txt
4.6. Misc.txt
4.7. ItemTypes.txt
4.8. Itemratio.txt
5. Area, monster and item levels
6. TC selection and number of dropped items
7. Item type selection
8. Item quality selection
9. Set and unique item selection
10. Sockets' number selection
11. Affix selection
12. Item generation at shops
13. Gambling
14. Ethereal items
15. Rune and charm generation
16. Quest drop and Andariel bug
17. Object drops
18. Countess
19. Crafting
20. Imbue
21. Cubing
22. Circlets and Magic Level
23. Runes in Hell Forge
24. Magic Find
25. 1.11 Drop Changes
26. Thanks
=1. Basics=
* '''Area Level:''' Area Level. All areas in the game also have levels. These determine or at least factor into mlvl, ilvl, and more.
* '''Alvl:''' Affix Level. It is a level of prefix or suffix. They are stored in MagicPrefix.txt and MagicSuffix.txt in "Level" column. The name "Affix Level" is used to differ them from other "Levels".
* '''TC:''' Treasure Class. All item types in the game are organized into treasure classes 30 . In v1.10 there are 29 weapon adn 30 and 29 armor Treasure Classes([[TC_1.10|see those here]]), with additional TCs covering all the smaller, miscellaneous items such as runes, charms, gems, potions, etc. All TCs are recursive: this means that one treasure class may include another treasure class. E.c. Hell Baal drop all his items from "Baal (H)" treasure class, which consists of "Act 5 (H) Equip B", "Act 5 (H) Junk" and "Act 5 (H) Good" treasure classes. Each of them consists of several other treasure classes, each containing fewer entries and growing more specific.
* '''Clvl:''' Character Level. It is one of few levels, that you can actually see in the game.
* '''Rarity:'''Rarity is a value assigned to every set and unique item in the game. This comes into play largely when there are more than one unique or set item of the same type, and makes some such items much more common than others. For example, the unique ring Stone of Jordan has a Rarity of 1, while the far more common unique ring Manald Heal has a Rarity of 15.
Many parameters of drops are stored in txt files, that are packed to MPQ files when ''Diablo II'' is installed. If you have installed [[ATMA]] you may find that files unpacked in its data folder. These files are stored in CSV format, a plain text format that may be viewed with Excel or OpenOffice.org. You do not need to know everything about these complicated files to be effective in item hunting, but it will help if you know something about their structure. Truly dedicated item hunters will want to dig deeper into the files, and will find the D2 file guides posted at the Phrozen Keep, of value.
==4.1. TreasureClassEx.txt==
 
This is the most important file. It organizes all droppable items into a system of Treasure Classes. Since each source of items in the game (except NPCs) drop items from Treasure Classes, this is crucial to understand.
 
We'll start with description of all fields of TreasureClassEx.txt table.
 
* '''Treasure Class:''' The name of a TC, one the game usually refers to.
* '''Group:''' An identification number of similar TCs. This is used in TC upgrade process according to Mlvl.
* '''Level:''' The level of a given TC. It is also used in TC upgrade process.
* '''Picks:''' A quantity of iterations of the selection process.
** '''Unique:''' A modification number for chance to drop unique item from given TC (more is better).
** '''Set:''' A modification number for set chance.
** '''Rare:''' A modification number for rare chance.
** '''Magic:''' A modification number for magic chance.
* '''NoDrop:''' A rate of skipping drops from the TC (the higher NoDrop, the less items the TC will generate).
* '''Item1-Item10:''' A code of item to drop or a name of TC to drop from (item codes are stored in weapons.txt, armor.txt and misc.txt data files).
* '''Prob1-Prob10:''' A rate of selecting respective Item1-Item10 (more is better).
* '''SumItems''', '''TotalProb''', '''DropChance''', '''Term''' Unimportant fields for item drop routine.
 
TreasureClassEx.txt file doesn't contains all treasure classes. At run time the game adds quite a few additional TCs. Their names are ArmoXX and WeapXX, where XX is two digit number. The game creates them from the armor.txt and weapons.txt files, by looking at quality levels. The first TC of armors, Armo03, contains all armor items with levels from 1 to 3: Cap, Quilted Armor, Leather Armor, Buckler, Gloves, Boots and Sash. The next armor TC, Armo06 contains all armor items with levels from 4 to 6, and so on. The last armor TC, Armo87, contains all armor items with levels from 85 to 87. Weapons are organized in their TCs, Weap03-Weap87 by the same manner.
 
In this TCs Prob1-Prob10 values determine how likely the given items in those TCs are to drop. Some items have penalties and are therefore seen less frequently. A few of these, for illustrative purposes:
* Normal items: 3
* Assassin claws: 2
* All other class-specific items: 1
* Wands/Staves/Scepters: 1
These values interact with how many items are found in a given TC to create item shortages and abundances. The given items in a TC with 12 items will be comparatively less common than the items in a TC with 7 items. And if those 7 items include several wands and claws, the normal items in that TC will be highly overrepresented. Breast Plates, for instance.
 
To further demonstrate, let's look at the process of item selection from a given TC.
 
All monsters have treasure classes, written in monstats.txt file. When you kill a monster in normal difficulty the game simply uses its TC to drop items. However in Nightmare and Hell difficulty the given TC may be upgraded. When determining the TC for a monster, the game selects the highest level TC in the group that is equal to or less than the Mlvl. If there is no group for TC of this monster, than it doesn't upgrade TC. Treasure classes that are included in the selected TC aren't upgraded.
 
Selecting from a TC the game makes one or several attempts of dropping according to Picks field. Each pick choses from several possibilities, including NoDrop, and each non-empty entry from Item1-Item10 fields. The chance of every choice is equal to X/Sum, where X is respective value from Prob1-Prob10 fields for Item1-Item10, or NoDrop value for NoDrop choice, and Sum is the sum of all that values (NoDrop+Prob1+Prob2+...+Prob10).
 
If the game selects another TC during this process it will initiates the same cycle for it, then another cycle for newly selected TC, then another and another until it selects an item or NoDrop.
 
In multilayer game NoDrop value is reduced.
 
NewNoDrop=int( ProbSum/(1/((NoDrop/(NoDrop+ProbSum))^N)-1) ), where N=int (1+AdditionalPlayers/2+ClosePartiedPlayers/2), AdditionalPlayers — the number of all additional players in the game, where the monster is killed, ClosePartiedPlayers — the number of players in your party near you (not far than two screens away), ProbSum=Prob1+Prob2+Prob3+...+Prob10, int — operation of truncating fractional part of a number.
 
In SP the [[Player_Settings#The_Players_X_Command|Players X command]] sets the number of NON-partied players, e.g. /players8 command sets N=4.
 
For example: a character kills a non-boss Devilkin in The Pit level 1 in Hell in /players8 mode (or in a full game on Battle.net). The Devilkin has Mlvl=85. In monstats.txt file Devilkin is figured under "fallen3" name. Non-unique fallen3 drop items from "Act 1 (H) H2H B" TC in Hell difficulty. In TreasureClassEx.txt file "Act 1 (H) H2H B" TC has group=7 and level=66. Because Mlvl=85 the TC is upgraded to "Act 5 (H) H2H C" TC, which has level=85 (less or equal to mlvl). So Devilkins in The Pit drop items from "Act 5 (H) H2H C" TC.
 
It has 1 pick from fallowing possibilities:
* NoDrop (100);
* gld (21);
* Act 5 (H) Equip C (16);
* Act 1 (H) Junk (21);
* Act 5 (H) Good (2).
The numbers in (parenthesis) are probabilities.
 
Lets calculate NewNoDrop:
* ProbSum=21+16+21+2=60.
* NoDrop=100.
* N=4.
* NewNoDrop=int( 60/(1/((100/(100+60))^4)-1) )=11.
 
So The Pit Devilkin has fallowing chances:
* 11/71 for dropping nothing
* 21/71 for dropping gold
* 16/71 for dropping from Act 5 (H) Equip C
* 21/71 for dropping from Act 1 (H) Junk
* 2/71 for dropping from Act 5 (H) Good
 
Lets assume, that the game decided to drop from "Act 5 (H) Equip C" TC. Here it is: Picks=1, NoDrop=0, Item1="weap81", Prob1=2, Item2="armo81", Prob2=1, Item3="weap84", Prob3=6, Item4="armo84", Prob4=3, Item5="weap87", Prob5=14, Item6="armo87", Prob6=7, Item7="weap87", Prob7=1, Item8="armo87", Prob8=1, Item9="Act 5 (H) Equip B", Prob9=1530. Note, that weap87 and armo87 TCs are mentioned twice, it is not a error.
 
So this TC has fallowing chances:
* 2/1565 for dropping from weap81;
* 1/1565 for dropping from armo81;
* 6/1565 for dropping from weap84;
* 3/1565 for dropping from armo84;
* 15/1565 for dropping from weap87;
* 8/1565 for dropping from armo87;
* 1530/1565 for dropping from "Act 5 (H) Equip B".
 
Lets assume, that the game decided to drop from armo87. This TC has picks=1, NoDrop=0, Item1="Diadem", Prob1=3, Item2="Corona", Prob2=3, Item3="Sacred Armor", Prob3=3, Item4="Ogre Gauntlets", Prob4=3, Item5="Myrmidon Greaves", Prob5=3, Item6="Colossus Girdle", Prob6=3, Item7="Dream Spirit", Prob7=1, Item8="Guardian Crown", Prob8=1, Item9="Vortex Shield", Prob9=1, Item10="Bloodlord Skull", Prob10=1.
So armo87 has fallowing chances:
* 3/22 for Diadem;
* 3/22 for Corona;
* 3/22 for Sacred Armor;
* 3/22 for Ogre Gauntlets;
* 3/22 for Myrmidon Greaves;
* 3/22 for Colossus Girdle;
* 1/22 for Dream Spirit;
* 1/22 for Guardian Crown;
* 1/22 for Vortex Shield;
* 1/22 for Bloodlord Skull.
Administrators
2,378
edits