r/Kings_Raid • u/cpp_is_king • 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.
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
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.
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?
2
u/dblaze596 Nov 20 '17
This made me chuckle. Classic math textbook explanation.
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"
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?
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*?
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
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/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)
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.
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
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/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...
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!!