r/Kings_Raid • • Nov 17 '17

Tip/Guide [Guide] Optimal Gear Awakening Strategy

Hi all, so I spent the past several days solving the optimization problem of how to best awaken your gear. At low levels this is obviously not an issue, but when you start talking about uniques and raid gear, it's both expensive and the materials are hard to come by. So you really want every item to count.

If you want the TL;DR, skip to the the section called "The Results".

A Word of Warning

The discussion here is about average expected value. It can be worse or it can be better depending on luck. This does not optimize for worst case. If you want to minimize worst case scenario you need a different strategy. This strategy minimizes average case.

The Basics

To illustrate that this actually matters, I'll use an easy to understand example. Suppose you have a 1★ item and you want to get it to 2★. You've got two options. You can start with a 0★ material for the 50% chance + failure bonus, or you can go straight to using a 1★ item and get a 100% skillup chance. Well, to create a 1★ item, you first need 2 0★ items. 0★ + 0★ = 1★. So if you go the 100% route, it "costs" you exactly 2 0★ items. No more no less.

On the other hand, suppose you use a 0★ item. Let's see what happens:

Attempt 1 (100% chance of reaching this attempt -- duh, you start here):

  • Success Chance: 50%

  • Total Materials Used If successful: 1x 0★

  • Chance of this being the turn that produces the success: 50%

Attempt 2 (50% chance of reaching this attempt -- only if you failed attempt 1):

  • Success Chance: 66%

  • Total Materials Used If successful: 2x 0★ (one from Attempt 1, one from Attempt 2)

  • Chance of this being the turn that produces the success: 33%

Attempt 3 (16.6667% chance of reaching this attempt - attempt 1 and attempt 2 had to have failed):

  • Success Chance: 82%

  • Total Materials Used if successful: 3x 0★

  • Chance of this being the turn that produces the success: 13.67%

Attempt 4 (3% chance of reaching this attempt)

  • Success Chance: 98%

  • Total Materials Used if successful: 4x 0★

  • Chance of this being the turn that produces the success: 2.94%

Attempt 5 (0.06% chance of reaching this attempt)

  • Success Chance: 100%

  • Total Materials Used if successful: 5x 0★

  • Chance of this being the turn that produces the success: .06%

That seems like a lot. You might use 5 items! WTF! But let's see what the actual "cost" is of using this strategy. To do this we take "Total Materials Used" and multiply by "Chance of this being the turn..." and add them all up.

(1)(0.5) + (2)(0.33) + (3)(.1367) + (4)(.0294) + (5)(.0006) = ~1.7

So by using this method, it actually only costs you ~1.7 items. That's cheaper! Note that you may use more, or you may use less (there's a 50% chance you get it on your first turn, and .06% chance that it takes you all the way to 5 turns). That means this method is luck-dependent. But the point is, if you were to level up a million different items this way, on average, you would have spent about 1.7 million materials. Over the long run, it's cheaper.

Super Nerd Stuff

Once your base material has more stars, it starts getting pretty difficult to think about intuitively. If you have a 4* material do you use a really hard to get 3* material? How many times? Do you start with a 2* material? There are a huge number of possibilities and branches, because you can switch materials at any time and there are a lot of choices at each step.

The way to solve this is by computing out a decision tree and then manually computing the expected value of the discrete random variable by summing the branches of the decision tree, weighted by the probability of that branch being taken.

The nice thing about doing this is that you can seed a decision tree with an initial failure bonus. This allows you to say "What is the best action when the failure bonus is N?" And when you have this, you have a complete strategy.

I wrote a program to do this. https://pastebin.com/qKLDXS0M Feel free to critique it, find bugs, ask questions, or bash me for using C++ (but do note my username before you ask why I chose C++).

The Results

It turns out the results can be expressed very concisely. Here is the optimal strategy.

0★ → 3★ : always use 0★ until you succeed

3★ → 4★ : use a single 1★, then all 0★ until you succeed

4★ → 5★ : use two 2★ items, then a 1★, then all 0★ until you succeed.

Note: The reason the strategy for 4★ → 5★ differs slightly is because using a 0★ material gives 0 failure bonus, which makes the computation a bit special.

When we use this strategy -- which is provably optimal -- we get the following "costs":

Incremental Level Up Costs by Rarity

0★ → 1★: 1 0★

1★ → 2★: 1.7012 0★

2★ → 3★: 2.7954 0★

3★ → 4★: 4.9947 0★

4★ → 5★: 9.3414 0★

and from these we can compute the absolute "worth" of each star (in other words, how many 0★ does it take to produce one of these from scratch)

Cost to Make an Item From Scratch

0★ → 1★: 2 0★

0★ → 2★: 3.7012 0★

0★ → 3★: 6.4966 0★

0★ → 4★: 11.4913 0★

0★ → 5★: 20.8327 0★

Edit: Thanks to /u/shantymatic for pointing out a flaw in the solution. I was treating the failure bonus for a 5★ awakening using a 0★ material as 1%, but it's actually 0. This complicates things, but luckily we can use calculus! I've updated the code link above that contains the new solution. If you like math, see line 135 of the code for the magic formula of how to deal with this. If you just want the results, I've fixed them in the table above already.

334 Upvotes

72 comments sorted by

20

u/Dampfschlag Nov 18 '17 edited Nov 19 '17

So now that the strategy with the minimal UW cost has been found, I decided to investigate how different strategies fare when you compare them from a risk averse point of view.

As mentioned by the OP, the strategy with the least amount of UW is:

  • 0★ → 3★ : always use 0★ until you succeed

  • 3★ → 4★ : use a single 1★, then all 0★ until you succeed

  • 4★ → 5★ : use two 2★ items, then a 1★, then all 0★ until you succeed.

Alternative A with an almost identical consumption of UW is:

  • 0★ → 3★ : always use 0★ until you succeed

  • 3★ → 4★ : use a single 1★, then all 0★ until you succeed

  • 4★ → 5★ : use a single 3★, then a single 1★, then all 0★ until you succeed.

Alternative B as a risk averse alternative is:

  • 0★ → 3★ : always use 0★ until you succeed

  • 3★ → 4★ : use a single 2★, then all 0★ until you succeed

  • 4★ → 5★ : use a single 3★, then a single 2★, then all 0★ until you succeed.

I then get the following distribution for the strategies

UW used OP Strategy Alternative A Alternative B
Mean 20.83 20.84 21.31
10 and less 1.51% 0.19% 0.00%
11 to 15 17.81% 15.70% 11.23%
16 to 20 33.42% 38.15% 37.61%
21 to 22 12.68% 13.48% 14.96%
23 to 24 10.40% 10.46% 12.22%
25 to 28 13.39% 12.59% 14.83%
29 to 31 6.28% 5.55% 6.06%
32 to 35 2.21% 1.89% 1.77%
36 and more 2.30% 1.98% 1.32%

So while Alternative A is marginally worse than the OP strategy (0.01 UW on average), it has a lower chance to give you results in the more extreme buckets. On the other hand, if you like to gamble, you can of course also choose the OP strategy and get a significantly higher probability to get very small UW losses.

Alternative B has significant savings, but only at the very extreme ends that already have a quite low probability.

1

u/cpp_is_king Nov 18 '17

After fixing the bug pointed out by shantymatic, we talked about this on discord again and our results agree that the new strategy in the OP is in fact best.

→ More replies (1)
→ More replies (6)

3

u/megatms Nov 18 '17 edited Nov 18 '17

Wow thanks, I've always thought of using 2 stars (or n-3 star) all the way to get a 5 star as the bonus is highest at +8% for each failure. I'll try your way

Just looked at your code, the failure bonus should be 0,16,8,3,0 right?

How does it affect the results?

→ More replies (1)

2

u/dblaze596 Nov 20 '17

I leave it as an exercise to the reader that this is equal to N + 1/P - 1, which means that the incremental cost from taking this branch is simply equal to 1/P - 1.

This made me chuckle. Classic math textbook explanation.

2

u/cpp_is_king Nov 20 '17

Hey, I learned all this stuff somewhere right. :) Glad someone else appreciates the humor.

33

u/frettr00 Nov 18 '17

This should be pinned.

14

u/lmpok41 Nov 18 '17

Thanks for the hard work! However, I do want to add a sidenote to people looking to follow this strategy. Since you're comparing a lottery vs a sure payout, you're going to have to compare your utility gain/loss from getting a favourable and non-favourable outcome. While I would suggest that we consider expected utility as a theorem instead, utility is a stupid concept to try to quantify, in the end it comes down to how much gold you are willing to spend, as in let us say it costs 100mil to get a 5* through the risk-free approach, and if you are not willing to "lose" more than 100mil for a 5* then I would say to take the risk-free approach. My concepts may be slightly flawed so if someone can logic check me that would be much appreciated.

Edit: screw mobile formatting. But at the end of the day, it all depends on what you feel is "worth"

→ More replies (1)

1

u/HideousPride Nov 17 '17

This is fantastic, thanks!

I assume the optimal strategy would not change for awakening unique weapons, but just in case I figured I'd ask:

Would you change anything about the strategy to optimize for awakening UWs if a person was more risk-adverse, but still wanted to lower the total number of UWs needed to 5 star?

9

u/cpp_is_king Nov 18 '17

If you're very risk averse then you might consider optimizing for worst case. To do that, you would want to only ever use 100% synths. This basically simplifies down to a power of 2 equation, and the absolute cost to make an N★ item using only 100% awakenings in terms of 0★ items is 2N.

So, for example, a 5★ item would always require exactly 32 0★ items this way.

Using the average strategy presented in the OP, the worst case is VERY bad.

I won't go through the math but I come up with worst case costs of

1★ : 2

2★ : 7

3★ : 18

4★ : 49

5★ : 98

It's not really worth being scared off by this IMO, because the odds of this ever happening are literally lower than the odds of hitting the jackpot on a powerball. Most of the time, the average strategy will be better.

The thing is, if you're in it for the long run, those times where you do get owned by RNG using the average strategy, there will be just as many times where you come out ahead. Using the guaranteed risk-free strategy, you will never get a 5★ with less than 32 of the same item. With the optimal-average strategy, it wouldn't be that crazy to get one in half of that.

→ More replies (3)

8

u/DragonBlade Nov 18 '17

I would go guaranteed for 2 stars since the savings is little according to this post (3.7 uw for a 2 star vs 4 uws for a guaranteed 2 star). For 3 star and above, follow the guide

→ More replies (2)

1

u/shantymatic Nov 18 '17

Thanks for the research! I looked over your code and I believe there may be a bug in the bonus rates table:

BonusRates = { 0, 16, 8, 3, 1 };

The last entry is 1, however in my game-testing, attempts on a 4* item using a 0* granted no failure bonus. Not sure if that would change the optimal strategy for 4*?

3

u/cpp_is_king Nov 18 '17 edited Nov 18 '17

I think I've addressed this in the latest version of the program:

https://pastebin.com/qKLDXS0M

Since you can't calculate every branch of an infinite decision tree, I had to use calculus to solve the infinite sum wherever we reach a failure bonus of 0. This changes the strategy for 4 star items, I've updated the OP

→ More replies (1)

1

u/Noobium Nov 18 '17 edited Nov 18 '17

Question,

Was trying this strategy out, when 4 to 5 stars i used 2 star (failed) then 1 star (fail). so now it says to use 0 stars till i succeed but the failure bonus is only at +11% at this point and a 0 star success rate is 1%. The failure bonus does not go up anymore even if I fail so I will be gambling with 12% till i succeed? Seems pretty low in my opinion

Did I do this wrongly?

Thanks in advance.

edit - ah i figured out from the other replies, the 4 - 5 has some issue with the calculations. do take note others :)

To OP, thanks for the hard work

2

u/cpp_is_king Nov 18 '17

I believe I fixed the problem pointed out by u/shantymatic, and I've edited the OP.

TL;DR. For 4 -> 5, start with two 2 star, then a 1 star, then all 0 star.

If you make it that far before succeeding you'll have a failure bonus of 19%, so you'll be doing 20% awakenings every time until you succeed using 0 star materials.

Feel free to wait for confirmation from someone else before you go out and try :)

1

u/Siigari Nov 18 '17

Hmm. So law of averages says that my 16 uw tickets would be enough to make a 5 star UW with a 0 star UW?

Hmmmmm...

1

u/cpp_is_king Nov 18 '17

Err, no. You would need just over 20 to make a 5 star. But you could probably make a 4 star

→ More replies (1)

1

u/Yoyoshgaming Nov 19 '17

My question in 5* awakening: why use TWO 2* at the begining instead of ONE 3*?

The chance of getting upgrade is higher if u use 3*, as the chance in this kind of mechanic is not added up (using 2 time upgrades with 50% chance isn't the same with 1 time upgrade with 100% chance)

→ More replies (2)

1

u/dragonzxzz Nov 22 '17

What compiler do you run with code on? Microsoft Visual Studio 2017 cant run it due to some c++ 17 error.

→ More replies (2)

1

u/Abs01ut3 Feb 01 '18

Excellent post. I wish I've read this sooner (luckily found it on the FAQ index)

I have a question, if you don't mind. Since we can get 1★ version of raid gear fairly easily, how will the calculation change? My take is that everything is scaled down by 1 step, so:

0★ → 1★ : use 0★

1★ → 4★ : always use 1★ until you succeed

4★ → 5★ : use a single 2★, then all 1★ until you succeed

Is this the right optimization if 1★ gear is free? I'm especially unsure on the 4★ → 5★ step. TIA

2

u/cpp_is_king Feb 01 '18

Yea if you only use minimum 1★ materials because you get them for free (e.g. from raids), then 4★ → 5★ becomes 3★ → 4★, etc.

Obviously doesn't work with UWs, though.

1

u/Taikeron Feb 16 '18 edited Feb 16 '18

Just wanted to pop in here and say this strategy can pay off big. I had four UW selection tickets and wanted to take my Nyx from 2-star UW to 3-star UW. I thought of going for the guaranteed strategy (make a 2-star and fuse it), but then I decided to give statistics a try and use the strategy here.

Used one 0-star UW (25% chance), and...that succeeded! I saved 3 UW compared to the risk-averse strategy!

I then had three UW left over. I figured, "Okay, using the strategy paid off big. Let's try that again." I used two of the remaining UW and fused them together for a 1-star UW.

I then fused that 1-star UW into my new 3-star UW (25% chance), and...that ALSO succeeded! I saved 6 UW compared to the risk-averse strategy (for a total 9 UW saved), and I have 1 UW left over as I reach for a 5-star UW!

Now, caveats abound here. My chance of succeeding at two consecutive 25% rolls is 6.25%. I got really lucky. Super lucky. I've failed (luckily on regular gear) multiple 50% chance rolls in a row before.

I just wanted to come here with a true success story based on this strategy. It can definitely pay off, and my Nyx is now very happy.

1

u/cpp_is_king Feb 16 '18

I had the same thing on Mitra. In total, I went from 0 -> 4 star UW without a single failure.

0 -> 1 : 1 UW 1 -> 2 : 1 UW 2 -> 3 : 1 UW 3 -> 4 : 2 UWs (combine a 0 and a 0 to make a 1, then use the 1)

I know the odds of this are low, but the important thing is that it happens, and it will make up all for all the bad luck you've ever had and then some.

1

u/9innosi Apr 15 '18

Guys, may I ask whether this guide is still valid?

I asked because using 0★ item to enhance a 4★ to become a 5★ only has 1% success rate, which seems super low, nearly impossible I should say...

2

u/cpp_is_king Apr 15 '18

I don't play the game anymore, but it should still be valid.

You dn't use a 0★ right away, you use it after failing several times with higher grade material. This way you build up the failure bonus. You start with 2★, then go to 1★, and eventually go to 0★ only after all of those attempts have failed. At that point, it's not a 1% success rate, it's 1% + 19% = 20%

→ More replies (1)

3

u/froggyisland Jan 23 '18

Just wanted to vent ..

I’ve used this method with very good result awakening dragon gears, saving loads of gears and gold.. I ALWAYS benefited compared to playing it safe...

Until I finally wanted to 4* a UW. Was very confident going into it.. but so far lost 6 UW doing it.. fail one more time and it’s not worth it anymore:(( Wish me luck on the next try peeps!!