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.