[Diablo3] MPQ \GameBalance\AffixList.gam menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Muaziz's Avatar Corporal
    Reputation
    22
    Join Date
    Sep 2011
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Diablo3] MPQ \GameBalance\AffixList.gam

    This thread discusses the \GameBalance\AffixList.gam file in the CoreData.mpq file. Please check out my MPQ game files and *.gam file info ([Diablo3] MPQ game files and *.gam file info) thread for general MPQ information and basic information about how GameBalance (*.gam) files are encoded.

    AffixList Structure
    As of version 7318, the AffixList structure size is 0x220 (from 0x218 in the core beta). While I haven't deciphered all of it, here is what I have so far:

    struct Affix //sizeof 0x220
    {
    DWord unknown1; // +0x000 (this value is always 0x00000000)
    DWord affixName[256]; // +0x004 (the non-NLS key name of the affix)
    DWord unknown2; // +0x104 (not unique so it's not an id)
    DWord iLvl; // +0x108 (iLvl of the affix?)
    DWord supMask; // +0x10C (seems to be a mask for superior or socket affixes)
    DWord unknown3; // +0x110 (increasing values)
    DWord unknown4; // +0x114 (values range from 0 to 3F)
    DWord unknown5; // +0x118 (cLvl of the affix?)
    DWord param1; // +0x11C (used for some affixes such as elemental dmg and class skills)
    DWord param2; // +0x120 (used for some affixes such as MF and elemental dmg)
    DWord rareNameStringId; // +0x124 (file Id of the RareNameStrings_*.stl file)
    DWord groupId; // +0x128 (affix group id?)
    DWord rareNameId; // +0x12C (mapped from the RareNames.gam file)
    DWord unknown6; // +0x130 (populated for all affixes)
    DWord unknown7; // +0x134 (only populated for some affixes)
    DWord unknown8; // +0x138 (only populated for some affixes)
    DWord unknown9[5]; // +0x13C (these values are always 0xFFFFFFFF)
    DWord itemGroupIds[6]; // +0x150 (item group ids which can have this affix, up to 6 ids)
    DWord qualityMask; // +0x168 (some kind of item quality mask)
    DWord socketMask; // +0x16C (some kind of socket mask)
    DWord primaryRareNameId; // +0x170 (RareNames.gam group for secondary affixes)
    DWord unknown10; // +0x174 (this value is always 0x00000000)
    ModCode modCodes[4] // +0x178 (see ModCode structure below)
    DWord unknown11[18]; // +0x1D8 (these values are always 0x00000000)
    }
    struct ModCode //sizeof 0x18
    {
    DWord modCode; // +0x00 (modcode)
    DWord modParam; // +0x04 (param used for elemental dmg and resists)
    DWord unused[2]; // +0x08 (these values are always 0x00000000)
    DWord varDataOffset; // +10 (variable data offset from the start of the data section)
    DWord varDataNumBytes; // +14 (number of variable data bytes)
    }


    Additional Affix Details
    0x118: This DWord was always 0x00 prior to Patch 7318.
    0x108, 0x114, 0x118: All three of these DWords are in the 0-3F range. This could correspond to iLvl, cLvl, and mLvl, but not sure.
    0x110: These values increase for the affixes in a given affix group. Not really sure what this corresponds to.
    0x150 - 0x164: Every affix will have between 1 and 6 item group ids. These are item types which are eligible for this affix. These item types are defined in the "Items_Other.gam", "Items_Armor.gam", "Items_Weapons.gam", and "ItemTypes.gam" files. For example,
    1CF0A9AA: Melee
    071BAA81: Helm:
    D3D8D042: Jewlery
    00405070: Ring
    EA3AD528: Amulet

    I will be discussing the Item files in more detail in an upcoming post.


    Affixes and ModCodes
    Click here for the localized (enUS) Affix list.

    An item "mod" is a single property on an item; for example, "+2 Precision". Many affixes contain only a single mod; for example, "Prec 1" (of the Hawk) only increases the Precision. However, there are many affixes which apply multiple mods; for example, "PrecVit I" (Feral) increases both Precision and Vitality.

    Each affix belongs to an affix group; for example, "Presion 1" through "Precision 16" (of the Hawk, of Cruelty, of Pain, of Torment) all belong to the same affix group. An item can only have a single affix from a given group. In Diablo 2 there were mods such as MF (Magic Find) that could appear on both the prefix and the suffix which belonged to different groups; as a result, it was posisble to find MF rings with 25% MF (10% on prefix and 15% on suffix). Not sure yet whether overlapping mods will exist in D3.

    All affixes in the AffixList are broken down into mods. The Affix structure contains 4 "ModCode" structures (0x18 bytes each) starting at offset 0x178. Currently, no affix uses more than 2, with the "Inferior" quality being the exception (using 3). Note that Inferior and Superior items have their stats adjusted via affixes. "Gemmed" items (both normal and magical items with sockets) also use affixes to add the sockets.

    A given modCode can be used by multiple affixes; for example the "Precision" modCode (0x0A) is used by the "Prec", "AttPrec", "PrecDef", and "PrecVit" affixes.


    ModCode Variable Data
    The size of the variable data varies based on the modcode. The possible values are 0 (in the case of no modcode), 0x0C, 0x1C, 0x28,0x34, and 0x40. Here are some of the modcodes with their corresponding sizes:
    0x0C: Block, GoldPickUpRadius, HitMana, HitLife
    0x1C: Experience, Resists, Attack, Prec, Def, Vit, Will, AllStats, Life, MinD, MaxD, Thorns, DR, KillMana, KillLife
    0x28: Damage, CriticalD, Defense, Life, Gold, MF, Haste, Cast, LifeS, Regen, Run
    0x34: Inferior, Superior
    0x40: ItemCost

    While I have been able to figure out most of the general Affix structure, I am at a complete loss trying to understand the variable ModCode structure. Let me give an example to illustrate what I mean. Here are the first 7 levels of "Prec" from the core file. Note that this is the raw byte dump (with no LSB/MSB byte reversal):

    Code:
    Prec 1 06 12 14 FF 00 00 80 3F 06 0E 10 FF 00 00 00 41 01 0E 10 FF 04 0D 10 FF 00 0C 0F FF
    Prec 2 06 15 18 FF 00 00 10 41 06 16 18 FF 00 00 88 41 01 15 18 FF 04 15 18 FF 00 14 18 FF
    Prec 3 06 10 11 FF 00 00 90 41 06 0F 11 FF 00 00 D0 41 01 10 12 FF 04 11 13 FF 00 11 14 FF
    Prec 4 06 0F 11 FE 00 00 D8 41 06 14 18 FF 00 00 0C 42 01 16 1A FF 04 14 18 FF 00 11 16 FF
    Prec 5 06 0F 12 FF 00 00 10 42 06 11 13 FF 00 00 30 42 01 11 13 FF 04 11 12 FF 00 10 13 FF
    Prec 6 06 12 16 FF 00 00 34 42 06 13 15 FF 00 00 54 42 01 12 15 FF 04 12 16 FF 00 13 17 FF
    Prec 7 06 00 00 00 00 00 58 42 06 00 00 00 00 00 78 42 01 00 00 00 04 00 00 00 00 00 00 00
    Note that "Prec 7" looks like it is missing a whole bunch of data. That could very well be due to this information not being populated in the beta since this affix is too high level to be obtained.

    Looking at the other variable data, it seemed like most of the data was junk! The only bytes that seemed to follow any pattern were:
    * byte 1: always 0x06
    * bytes 7-8: starts at a value (e.g., 0x3F80) and always increments, but not necessarily with the same step size.
    * bytes 15-16: starts with a value (e.g., 0x4100) and always increments, but not necessarily with the same step size. In most cases, this value is greater than that of bytes 7-8.

    These values look more like offsets than anything else, but I am not sure what they are offsets into! I was hoping that this variable data would contain information such as the min/max values for the mod (a la Diablo 2), but no such luck.

    I then looked at the same variable data in the 7334 Patch and it is quite different:
    Code:
    Prec 1 06 1A 77 FF 00 00 80 3F 06 2B BB FF 00 00 00 41 01 37 E7 FF 04 3A F3 FF 00 3F FA FF
    Prec 2 06 00 00 00 00 00 10 41 06 00 00 00 00 00 88 41 01 00 00 00 04 00 00 00 00 00 00 00
    Prec 3 06 00 00 00 00 00 90 41 06 00 00 00 00 00 D0 41 01 00 00 00 04 00 00 00 00 00 00 00
    Prec 4 06 00 00 00 00 00 D8 41 06 00 00 00 00 00 0C 42 01 00 00 00 04 00 00 00 00 00 00 00
    Prec 5 06 00 00 27 00 00 10 42 06 00 00 26 00 00 30 42 01 00 00 26 04 00 00 25 00 00 00 24
    Prec 6 06 00 00 04 00 00 34 42 06 00 00 06 00 00 54 42 01 00 00 0A 04 00 00 0C 00 00 00 0E
    Prec 7 06 00 00 00 00 00 58 42 06 00 00 00 00 00 78 42 01 00 00 00 04 00 00 00 00 00 00 00
    It appears that most of the "junk" bytes have been zeroed out, although there still appears to be some random stray data.

    This structure appears to contain runtime pointers. But why in the world would you load this from a variable data structure on disk? That makes no sense at all. So clearly, I must be missing something.

    Once I get access to the beta (one can dream right?), I will look into what these structures look like at runtime.

    In the meantime, if any of you have any idea how these variable data stuctures work, please chime in.

    [Diablo3] MPQ \GameBalance\AffixList.gam
  2. #2
    Muaziz's Avatar Corporal
    Reputation
    22
    Join Date
    Sep 2011
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have made significant updates to the AffixList.gam page. Due to forum formatting constraints, I will keep the master on my site (see the link), but want to continue discussions here.

    In the coming week, I will be posting a full list of affixes, their mods, and the value ranges for each one. I will also cross-reference the item group tables so that you can see all the affixes that are available for each type of item.

    Special thanks chippydip for the help and especially for the mechanism for variable data decoding!

  3. #3
    mongoosed's Avatar Member
    Reputation
    1
    Join Date
    Feb 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Muaziz this is some excellent information. Really appreciate it.

Similar Threads

  1. [Diablo3] MPQ game files and *.gam file info
    By Muaziz in forum Diablo 3 Memory Editing
    Replies: 8
    Last Post: 05-19-2012, 10:19 AM
  2. [Diablo3] Reverse-Engineering MPQ game files
    By Muaziz in forum Diablo 3 Memory Editing
    Replies: 2
    Last Post: 09-26-2011, 12:43 PM
  3. Can someone upload me dbc.mpq?
    By pandaman in forum World of Warcraft General
    Replies: 3
    Last Post: 08-25-2006, 09:05 PM
  4. What .MPQ editor do you use?
    By Dave-evad in forum World of Warcraft General
    Replies: 2
    Last Post: 08-15-2006, 02:45 AM
  5. Campfire model MPQ path
    By Lazyeye in forum World of Warcraft General
    Replies: 2
    Last Post: 08-11-2006, 06:59 PM
All times are GMT -5. The time now is 12:34 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search