Thursday, November 8, 2012

Building a suit on a budget

In a previous post I talked about the costs and benefits available from socketing. Here I'm going to use that to do some calculations about how to maximize a given stat on a budget.

So the key here is to consider how much % and how much + you get for your ¢. At the maximum you will have spent the same amount on % as on + when you consider your innate bonuses as virtual ¢. If you run out of slots you switch to the next cheapest way of adding % and +.

Clear as mud? Here's an example: We're going to take a level 30/30 LUK based character with no LUK skill and give him a cheap set. I'm going to assume that he's got 16 slots of t2% epic LUK equipment, fully enchanted with t2+ LUK. This kind of equipment should be pretty cheap to come-by and pretty cheap to enchant ( a couple of million max ).

Now adding a t1% rune is going to be the cheapest way to get % and I'd estimate one as costing about 1.5M, or 2.3/1.5 = 1.53% per million. Adding a t2+ rune is the cheapest way to get + and I'd estimate the total cost for one to be about 1M, so about 25 per million. (In contrast t1+ costs about 750k for 12.5, so 17 per million, and t3+ costs 1.6M so 24 per million - If you can get cheap t3+ then that'd be better)

Now lets say we have 100M to spend on adding runes/socketting etc. We have a total of $60 + 4 \times 16 = 124$ slot to fill, so we know we wont fill them all on this budget.

Here's my working table

Innate Innate ¢ Equip Equip ¢ Total ¢
+ 390
$30 \times 3 + 60*5$
15.6M
$390/25$
1200
$16*3*25$
48M
$1200/25$
63.6M
$15.6 + 48$
% 100 65M
$100/1.53$
68.8
$4.3*16$
44.9
$68.8/1.53$
110.3
$65.4+44.9$
TOTAL $63.6 + 110.3 = 173.9$M

So we have a total of 173.9M in virtual cash spent, and we have 100M more to spend. For that spending to be split evenly between each type of enchant we need to have spent $(100+173.9)/2 = 137$M on each type. To work out what that means in terms of runes we use the following table

VirtualTargetTo spend# runes
+63.613773.473
%110.313726.726.7/1.5=17

So according to the table we should maximize our luck if we buy 73 t2+ uncs and 17 t1% uncs. Since we've got only 60 rune slots, we'll need to socket 30 runes. This configuration will give us $390 + 1200 + 73*25 = 3415$ base stat, and $100 + 17*2.3 = 139$% muti, for a total of 4746 of the stat.

However a non-luk skilled toon would be a bad choice for this, so lets assume we're getting 40% from our skills - Then the tables would become:

Innate Innate ¢ Equip Equip ¢ Total ¢
+ 390
$30 \times 3 + 60*5$
15.6M
$390/25$
1200
$16*3*25$
48M
$1200/25$
63.6M
$15.6 + 48$
% 140
$100+40$
93.3M
$140/1.53$
68.8
$4.3*16$
44.9
$68.8/1.53$
138.2
$93.3+44.9$
TOTAL $63.6 + 138.2 = 201.8$M
VirtualTargetTo spend# runes
+641518787
%1381511313/1.5=9

This gives a grand total of 3765 base, and 165%, for a grand total of 5835.

Can we do better if we switch to t3% epics, or legends?

Yes, but only if you get those items cheaply.

If you can grab yourself a t3% epic rather than a t2% epic you gain $5.6-4.3 = 1.3$%, which is "worth" about 2M. So if you pay less than 2M for the t3% epic you'll be ahead.

The cost associated with using a legend instead of an epic is trickier to calculate. You can consider it as converting one t2+ rune into a spare space in the legend. The saving in freeing up that t2+ rune is about 1M. Thus if you spend less than 1M on a t2% legend, or 3M on a t3% legend, you're ahead.

However the calculation for legends is only valid since we're not fully socketing everything, a legend adds 0.1M in cost per socket, and you'd need to use 3 sockets to reach the same total number of slots, reducing the price you should pay by about 0.3M.

Can we do better if we switch to myths

No. Simply put, you're better off scrapping the myth and increasing your budget by 3.5M. A nilla myth will cost you 4.3%, but gain you +75. This works out to a net of +0.14M, while selling it will get you +3.5M. This is even before you add in the large socketing cost for myths (1M+ per socket)

How much should I pay for a t6% epic? Or a t6% rare?

A t6% epic will change your stats by $5.6*2-4.3=6.9$%, $-25$. This is worth $6.9/1.5 - 1$ or 3.6M (to this suit). So if you can get it for less than that, go for it.

A t6% rare will change your stats by $5.6*2-4.3=6.9$%, $-50$. This is worth (to this suit) about 2.6M. Again if you can get it for less than that, go for it.

Things to watch out when using non t2% epic equipment

The prices calculated above are approximate value when replacing a piece in the t2% epic suit. If you replace one or two pieces only then these value should be accurate, However if you replace too many pieces you may push yourself away from the optimum balance of % and + enchants and your overall score may fall. Just rerun the calculations with the new equipment to find out what you need.

Wednesday, October 24, 2012

Socketing

Socketing seems to be considered a bit of a black art, something that you shouldn't do except with your best items, using your best runes. I'm going to show that it should not be viewed that way, and show how you can use it to your benefit

There are two key issues to consider when socketing, what is the cost to me now, and what is the cost in future flexibility.

I'm going to try to illustrate the cost by considering the cost to obtain N slots in an item of a given rarity

Rarity 1 2 3 4 5 6 7 8 9 10 11 12 13
Nota - 0.0M 0.5M 1.0M
Rare - - 0.0M 0.5M 1.0M 1.5M
Uni - - - 0.1M 0.6M 1.1M 1.6M 2.1M
Leg - - - - 0.7M 1.3M 1.9M 2.5M 3.2M 4.7M
Myth - - - - - 3.5M 5.0M 6.5M 8.0M 9.6M 12.1M 23.6M

This table includes the cost for creating the socket, buying the nilla base object, buying the correct number of unc runes to socket into the object, and socketing all the runes.

One way to interpret this is: If you currently planing on wearing an unsocketed nilla myth (3.5M), then instead sell it for scrap and use that scrap to buy a uni (0.1M), socket it twice (1.0M) and pocket the 2.4M you've saved - as you've got the same number of slots.

The downside is loss of future expandability. However in this case the loss is not total, as you still have two spare sockets to use, and even when they're all filled you're ahead of the 2 socketed myth in cost.

Does this mean its just a way of making cheap low-end myth items? Quite the opposite in my opinion.

Lets say you'd love a myth T3% POW neck. Depending on how heavily you're planning on socketing it you'd probably be better off buying a T3% uni and socketing that. In fact that way you can probably get a T6% or T9% without really breaking your budget. Again though you're trading future expandability against getting those stats now.

However there's an additional upside - Our T9% myth equiv neck is equippable at 40, rather than 70 - which may make it more attractive for some uses.

Where I think this really shines is on those strange enchants that you cant get except on slots 3 and beyond. A T6% Life with HPR myth would cost an exorbitant amount, but with a HPR rare and two T3% Life uncs you can have the equivalent for under 8M.

Note: You may have noted the massive jump in cost between 5 and 6 socketed myths. It turns out that this jump is so expensive you're better off socketing a nota earlier than every creating that 6th socket, if you're only socketing with uncs. If you're socketing with something more expensive then you're better of creating the socket than upgrading the rarity of one of the runes.

Tuesday, October 23, 2012

Building an uber suit

This post is going to talk about building a suit that maximises a single stat. In this post I'm going to assume you dont have budget constraints and show roughly how much that will cost you and how much stat you can gain, and in a later post I'll do a comparison with a low budget suit.

But first we need to set some ground rules...

  • Socketing myths is expensive.
    socketcreateembed
    11001M
    21k1M
    310k1M
    4100k1M
    51M1M
    610M1M
    Total11.11M6M
    This works out to an average of 2.6M per socket. In contrast legends come out at about 300k per socket, and uniques 35k per socket. Of course you can partially socket an item, but we'll ignore that for now.
  • We're only going to consider some simplified values for what we might use in the no budget uber suit, to show that even relatively cheap socketing items mean that we spend a lot of cash. For the budget suit we'll only consider socketing unc runes.

The no-budget ubersuit

I'm going to use some basic assumptions that will keep the overall price of this suit "reasonable". However in this context reasonable is still going to be significantly more than most players will ever be able to spend.

The first assumption here is that all equipped items are fully socketed T3% myths. And that all other enchantment slots on the items have been filled with T3+ enchants. Much better equipment is available, and if you already have it you can tweak the calculations below accordingly.

The second assumption is that all runes that get socketed or put in the inventory are T3% uncs or T3+ nota runes.

Final assumption is that we're working with an 80/80 character with a single class/race bonuses to the stat of +50%, and all points allocated to that stat.

source+%rune slots
base stats8001.5060
equipment16*5*37.5=300016*0.054=0.86416*6=72
total38002.364132

Now depending on how we socket, each rune slot gives us +75 or +5.4%. From the previous post we get the maximum value when we have the number of + slots equal to the number of % slots, provided we count the unruned totals as virtual runes.

Our 3800 unruned base stat is equivalent to approx 51 notas, and out 2.364 base multiplier is equivalent to 44 T3% uncs. So we have 95 virtual runes.

So we need $(95+132)/2 = 113$ runes of each type counting virtual runes. This means we need $113-51 = 62$ notas, and $113-44 =69$ T3% uncs. Thats a lot of runes. There's also one unfilled spot that can be either a nota or unc, the provide about the same bonus

How good is it?

To calculate the total stat provided by the suit we can use $$ 75 * 0.054 * (113.5)^2 = 52173 $$

How much does it cost

I'm going to use some very ballpark figures to cost out the suit

item#eachtotal
T3% myths 16 6M 96M
Enchanting myths 5*16=80 0.5M 40M
Socketing myths 16 17M 272M
T3+ Notas 62 6M 378M
T3% Uncs 69 4M 276M
Total 1062M
So this kind of suit will cost around the 1 billion coin mark. This is about 49 stat points per million coin.

There are some manipulations that will allow you to knock the price down a bit though. Each switch from a T3% unc to a T3% nota would allow you to avoid a costly myth socket, saving about 11M, so if you can get a t3% nota for under 15M you're better off doing this.

Also most people able to build this kind of suit will already have a lot of items that they'd use in the suit, high % legend runes, or higher % myths. They'd need to adjust the calculations to find the right balance of notas to uncs, and what their final value would be.

Friday, October 19, 2012

Optimising stats

Megalodon has done a series of posts detailing the combination of % gear and stat gear on the official DoH blog.  While his derivations are good, they work in a way that doesn't generalise well, and that obscures some of the nice properties of the model.

Note that this is not criticizing Megas work at all, he used the right tools that he had available to him, and I know and use some other techniques - the same numbers will fall out of my method and his.

The model

I'm going to write the basic model as $$ \begin{align} V &= (a_1 + n_1 s_1 ) (a_2 + n_2 s_2) \\ &= \prod_{i=1}^2 (a_i + n_i s_i) \end{align} $$ The parameters are:
  • $V$ is the final resulting stat
  • $a_1$ is the base amount of the stat
  • $n_1$ number of flat enchants
  • $s_1$ amount of stat per flat enchant
  • $a_2$ base amount of multi
  • $n_2$ number of slots assigned to multi enchants
  • $s_2$ amount of multi per multi enchant.
There is also a constrain on the total number of slots you are using $$\Phi = n_a + n_b = n$$

The ugly maths (skip this if you dont like math)

When $V$ is maximised $\ln V$ is also maximised, and it is the maximum of this that we will look for as it simplifies our calculus slightly. $$ \ln V = \sum_{i=1}^2 \ln ( a_i + n_i s_i ) $$ We can use the Lagrange multiplier method from calculus for constrained optimization to find the optima of this. $$ \begin{align} \nabla V &= \lambda \nabla \Phi \\ \begin{bmatrix} s_1 / ( a_1 + n_1 s_1 ) \\ s_2 / ( a_2 + n_2 s_2 ) \\ \end{bmatrix} &= \lambda \begin{bmatrix} 1 \\ 1 \end{bmatrix} \end{align} $$ Some rearanging of this gives: $$ n_i = \left( \frac{1}{\lambda} - \frac{a_i}{s_i} \right ) $$ Summing these and solving for $1/\lambda$ gives $$ \frac{1}{\lambda} = \frac{1}{2}\left( N + \sum \frac{a_i}{s_i} \right) $$ Which finally gives us $$ n_i = N/2 + \frac{1}{2}\sum\frac{a_j}{s_j} - \frac{a_i}{s_i} $$

Isn't this uglier than Megas math?

Now you may ask why we bothered with the complicated formulae above ... and the reason is that I expect that the general form above will cary through to determining the optimal balance mult, pow multi and flat pow for damage, but thats a topic for another post...

A simpler interpretation of the results

The formulae in the previous section seems very tricky to interpret, but there's actually a very simple interpretation:

The neat interpretation relies on this result: If $a + b$ is a constant then $a\times b$ is maximized when $a = b$. Interestingly this still holds when you are trying to maximize $(s_a a ) \times (s_b b)$ as the $s_a$ and $s_b$ coefficients factor out.

So here's how the nice interpretation of the formulae works.

Assume I want to maximize Luck using T3+ and T3% enchants on my halfling pirate at level 80/80. With unsocketed myth equipment and a full inventory of notable runes I have $16*6 + 2*60 = 212$ slots to fill. Since I'm a halfling pirate I get +88% to my luck multi from skills giving me a base of 1.88, also I get about 900 stat points from gaining levels.

My base multi of 1.88 is equivalent to $1.88/0.056 \approx 34$ T3% enchants. My stats are equivalent to $900/37.5 \approx 24$ T3+ enchants. So we have a total of $34 + 24 + 212 = 270$ slots equivalent. For best performance we need them equally split, so 135 each in t3% and t3+. But we already have equivalent to 34 T3% enchants so we need 101 more. We have already have the equivalent of 24 T3+ enchants so we need 111 more.

For a character that does not get the +0.88 to the base luck multiplier, they only have $1.0/0.056 \approx 17$ T3% enchants. Running through the maths in the same way we find that they hit their maximum with 109 T3% and 103 T3+ enchants.

Thursday, October 18, 2012

What is DoH Science

DoH Science is a project to investigate the underlying rules that govern an online multiplayer game called Domain of Heroes.

Domain of Heroes is an strange AFK game that I've been playing on and off for years. I find a lot of the design decisions and rules governing the game play interesting and illustrative of many good game design points.

So I'm going to try to dissect these rules to determine how the game works under the covers, and then talk about how these rules may apply to game design in general.

Note: I'm not a developer on Domain of Heroes, so all info I obtain will be from the public interface of the game, hopefully through analyzing masses of collected data.