Affix Enchanting & Item Optimization Analysis

Asia-Pacific Spring Championships 2016 - Decklists, Meta Breakdown, Information
Gul'dan Confirmed & Model Info
Class Trials, Legion Profession Q&A, Brawler's Guild Hiatus, Blue Posts, BlizzCon

Affix Enchanting & Item Optimization Analysis

How would you like to go bonkers with end-game calculations on how to optimize the enchantment process of your ancient items? MarioVX has shared on Reddit an insanely detailed and well crafted document that kind of theorycrafting to the next level.

 

He describes and explains in detail every proposed formula - quoting eduw from Reddit, the guy probably has a degree on Horadric Studies or Nephalem Resource Development. A very interesting read if you're willing to spend some time to understand it. Check it out.

 

Introduction

This document is meant as a guide on how to accurately calculate the expected values of the costs and gains of enchanting items in Diablo 3. The guide mostly addresses ambitious players with already really good gear, such that the timer required for the calculation is small compared to the time potentially wasted on maxing out enchantment possibilities in the wrong order. It introduces and applies the mathematical tools that are also a prerequisite to a more difficult item reforging analysis.


The following calculations require the specific affix chances to be known in order to be applicable. Fortunately, they have successfully been datamined and can be looked up here. Without this great achievement, no accurate analysis on this subject would be possible.

Affix Rolls & Enchanting Basics

When an item is generated in Diablo 3, a certain number of stats called affixes are randomly chosen for it following a weighted probability distribution comprised of all eligible affixes (which can be looked up at d3planner for instance) each with their specific weight from the previously linked table. When an affix is chosen, it is removed from the pool for this item and can’t roll twice. This alters the probability distribution of the subsequent rolls and means that the entire sequence of rolls for all affix slots of one item is not a sequence of independent and identical random processes. The sequence as a whole instead follows a weighted hypergeometric distribution, but using the combined information of eligibility and weights of each affix for each item, the precise probability of a certain set of affixes on a certain item can be calculated as the sum of all the set’s permutations’ probabilities. This is most important for rerolling items as a whole, but through the presentation of a choice between two rolled affixes which cannot be the same during enchantment, it becomes relevant to enchantment as well. Enchanting can present two incompatible affixes, but never two identical ones.


Furthermore, affixes are separated in two categories, primary and secondary. They don’t influence each other except - and this is important - if Resistance to All is rolled as primary, single elemental resistances cannot be rolled as secondary. Strictly it is not known and not backed up by statistical testing whether the secondary affixes are rolled first and a single resistance realization restricts all resistance, or primaries are rolled first and an all resistance realization restricts single resistances, but the naming as “primary” and “secondary” affixes strongly suggests the latter to be the case, which hence will be assumed to be the case from now on.


There are several instances of affixes in the same category being mutually exclusive, like elemental damage bonuses on bracers and amulets and weapon damage on weapons. In these cases, a realization removes not only the realized affix itself from the set of eligible affixes but also others for subsequent rolls.


Apart from deciding which affixes are chosen, the game also decides the values of each affix. These follow a uniform distribution, meaning that every possible value is equally likely.

Probability & Math Basics

This chapter is a brief introduction to the discrete probability calculus tools we need for this analysis.

Discrete Random Variables, Expected Value

Let X be a discrete random variable that may assume any value xi with probability pi for a countable (not necessarily finite) number of possible values.

Then E[X]=ipi*xiis the expected (or average) value of that random variable, if the sum exists. It is also the barycenter of the underlying probability distribution.

Benefit & Efficiency

Not a traditional subject of mathematics but important to our application to video games is the consideration of benefit and efficiency of certain stat increases for certain costs.


Benefit means the relative increase of a considered value function due to the increase in the stat. For most simple stats in Diablo 3, we can take Damage and Toughness as the value functions in question, with notable exceptions being attack speed, cooldown reduction, resource cost reduction and resource generation. In general, we have ben=new valueold value-1. If competing upgrades with different benefits and costs are to be compared in regards to efficiency, there are two ways to define a metric for it:

eff=bencost and eff=cost1+ben-1.


It is often difficult to distinguish which is the proper one to use, and in fact, not even clear on the subject treated here (enchanting / rerolling efficiency). More on this later.



If an actual benefit is not certain but subject to a random variable, we consider the expected benefit instead.



(continues...)
2

Comments

Posts Quoted:
Reply
Clear All Quotes