Genshin crit optimization


Crit damage and crit rate and Genshin

Crit damage and crit rate are one of thr most wanted attributes in genshin. Almost everybody heard about 2:1 ratio but it's not true. Things are more complicated. Lets start with general equation for expected damage

expecteddmg=atk×skill×(1critrate)+atk×skill×(1+critdmg)×critrate

This can be simplified in case of crit analysis to this:

expecteddmg=critdmgcritrate

Using this we can use derivatives to find extreme. Let's assume exiting of constant critconstant that symbolize the whole "pie" of attributes on artifacts. Crit rate and crit damage are slices of critconstant. This is our constrain:

critg=critconstant+critdmg+critrate

This equation symbolizes alternative cost and limit how far in terms of crit can we go. Now with constrain we can write lagrangian function.

L(critdmg,critrate,λ)=critdmgcritrateλ(critconstant+critdmg+critrate)Lλ=critconstantcritdmgcritrateLcritrate=critdmgλLcritdmg=critrateλcritdmg=critconstant2critrate=critconstant2λ=critconstant2

Results shows that one to one ration gives most damage. It's quite intuitive, if we want rectangle to have as much area with smallest circumference, we would draw square. But what about well known 2:1?!!. Constrain written above is lying.

Max artifacts attributes

5 star circlet of logos boost crit dmg up 62.2% or 31.1% crit rate. Minor stats follow same rule. With this we need to modify constrain. Twice as much effort is needed to get the same in stat for critrate. So applying this gives:

critg=critconstant+critdmg+2critrate

And re-calculating gives

L(critdmg,critrate,λ)=critdmgcritrateλ(critconstant+critdmg+2critrate)Lλ=critconstantcritdmg2critrateLcritrate=critdmg2λLcritdmg=critrateλcritdmg=critconstant2critrate=critconstant4λ=critconstant4

We got 2:1 ratio. Yay!! but's everyone knew about it already. Bear with me thats not all. We forgot about weapons and characters themselves. Providing that we choose weapon mostly based on it's skill we can assume that it's excluded from this exchange 2:1. So now we define artifacts crit rate and artifacts crit damage and rate as

critrate=arcritrate+crcritratecritdmg=arcritdmg+crcritdmg

Where ar means artifacts and cr means character(weapon + character attributes). Lets skip boring parts. Da-da!

L(arcritdmg,arcritrate,λ)=λ(arcritconstant+arcritdmg+2arcritrate)+...(arcritdmg+ crcritdmg)(arcritrate+crcritrate)arcritdmg=arcritconstant2crcritdmg2+crcritratearcritrate=arcritconstant4+crcritdmg4crcritrate2λ=arcritconstant4+crcritdmg4+crcritrate2

This is general solution. Still we have ratio 2:1 but offset by character attributes. Now with that we can get specific solution.As example I will use my Arlecchino. She on her 90lvl has 88.4% crit dmg as her base stat. And her weapon Deathmatch gives another 36.8% crit rate

arcritdmg=0.5arcritconstant0.074arcritrate=0.25arcritconstant+0.037λ=0.25arcritconstant+0.405

Those offsets are not that big tho

Characters with special talents

Some characters have talents that boost crit or changes behavior on crit hit. Each character has complexly different way of calculating expected dmg. Let's focus on beloved Yanfei. Her talent "blazing eye" deals additional hit equal to 80% of her attack when charged hit crits. This makes dealing crits more important than crit damage. And this changes expected damage equation. We must add constant attack. For simplicity sake I don't consider her skills in this and use charged hit after third normal hit. In real world scenario I believe that ratio is closer of chared to normal attacks 1:2 or 1:3 not 1:4 but it's simplest case

expecteddmg=cratk(0.8arcritrate+0.8crcritrate)4+...1.4495cratk(arcritrate+crcritrate)(arcritdmg+crcritdmg+1)+...1.4495cratk(arcritratecrcritrate+1)

This monster is result of calculating with skill multipliers and all things mentioned above. Lagrangian function is even more awful. It's following the same rule like above. Just subtract lambda times constrain so we omit this frankenstein. And so general solution for Yanfei is this.

arcritdmg=0.5arcritconstant0.5crcritdmg+crcritrate0.0689arcritrate=0.25arcritconstant+0.25crcritdmg0.5crcritrate+0.0344λ=0.3623arcritconstantcratk+0.3623cratkcrcritdmg+0.7247cratkcrcritrate+0.05cratk

For my Yanfei (she was my first main ❤️). I have a weapon "Lost Prayer" with 33.1% crit rate bonus and i have quite generous 2255 ATK. Plugging it int my formula i get

arcritdmg=0.5arcritconstant+0.2620arcritrate=0.25arcritconstant0.1310λ=817.1556arcritconstant+653.7070

So having two crit points I should invest target crit rate on artifacts 37% and crit damage on artifacts 126% and overall crit rate keep around 70% and around 126% crit damage.

Afterword

I planned to write about since some time. After year on a uni I got to know math enough to put this into motion. This only scratching surface of optimization in genshin. Elemental reactions, artifacts farming and many more. Things are quite complicated maybe approaching them with numerical methods is better option. Wast majority of calculation were done using sympy. Script can be found on my gitlab CLICK HERE