User:Siddhant/Tangling Grasp Hit Calculation

From The Urban Dead Wiki
Jump to navigationJump to search

Defining the Problem

Grasp + Claws

We have a 50% chance of hitting a person for 3 damage. Upon hitting the person, we grasp the person. Further claw hits will land at 60% probability, with a 20% chance of missing and losing the grip, and a 20% of missing and retaining the grip. We need to find the average damage inflicted on the person on a long run.

Grasp + Bite

We have a 50% chance of hitting a person for 3 damage. Upon hitting the person, we grasp the person. Further bites will land at 40% probability, infilicting 4 damage. We also have a 30% chance of missing and losing the grip, and a 30% of missing and retaining the grip. We need to find the average damage inflicted on the person on a long run.

Solving the Problem

We have two states, State 1 being the lack of tangling grasp and State 2 having tangling grasp active. We calculate the probability of staying in a state for n number of hits, and find the value to which it tends to.

Grasp + Claws

A B C D E F
Attack # Probability of staying in State 1 Probability of staying in State 2 Chance of a hit from State 1 Chance of a hit from State 2 Total Damage inflicted on hit
A = A n-1 + 1 B = (B n-1 * 0.5) + (C n-1 * 0.2) C = (B n-1 * 0.5) + (C n-1 * 0.8) D = (B n * 0.5) E = (C n * 0.6) F = 3 * (D n + E n)
1 1 0 0.5 0 1.5
2 0.5 0.5 0.25 0.3 1.65
3 0.35 0.65 0.175 0.39 1.695
4 0.305 0.695 0.1525 0.417 1.7085
5 0.2915 0.7085 0.14575 0.4251 1.71255
6 0.28745 0.71255 0.143725 0.42753 1.713765
7 0.286235 0.713765 0.1431175 0.428259 1.7141295
8 0.2858705 0.7141295 0.14293525 0.4284777 1.71423885
9 0.28576115 0.71423885 0.142880575 0.42854331 1.714271655
10 0.285728345 0.714271655 0.142864173 0.428562993 1.714281497
11 0.285718504 0.714281497 0.142859252 0.428568898 1.714284449
12 0.285715551 0.714284449 0.142857776 0.428570669 1.714285335
13 0.285714665 0.714285335 0.142857333 0.428571201 1.7142856
14 0.2857144 0.7142856 0.1428572 0.42857136 1.71428568
15 0.28571432 0.71428568 0.14285716 0.428571408 1.714285704

Grasp + Bite

A B C D E F
Attack # Probability of staying in State 1 Probability of staying in State 2 Chance of a hit from State 1 Chance of a hit from State 2 Total Damage inflicted on hit
A = A n-1 + 1 B = (B n-1 * 0.5) + (C n-1 * 0.3) C = (B n-1 * 0.5) + (C n-1 * 0.7) D = (B n * 0.5) E = (C n * 0.4) F = (3 * D n) + (4 * E n)
1 1 0 0.5 0 1.5
2 0.5 0.5 0.25 0.2 1.55
3 0.4 0.6 0.2 0.24 1.56
4 0.38 0.62 0.19 0.248 1.562
5 0.376 0.624 0.188 0.2496 1.5624
6 0.3752 0.6248 0.1876 0.24992 1.56248
7 0.37504 0.62496 0.18752 0.249984 1.562496
8 0.375008 0.624992 0.187504 0.2499968 1.5624992
9 0.3750016 0.6249984 0.1875008 0.24999936 1.56249984
10 0.37500032 0.62499968 0.18750016 0.249999872 1.562499968

Emperic Testing

This simple C# program was run multiple times to verify the above calculated values. The results were as expected.

Random r = new Random();
int hits = 0;
for (int i=0; i<Convert.ToInt32(textBox1.Text); i++)
{
	int nextRnd = r.Next(0,100);
	if (state == 1)
	{
		if (nextRnd < 50)
		{
			state = 2;
			hits += 3;
		}
	}
	else if (state == 2)
	{
		if (nextRnd < 60)
		{
			state = 2;
			hits += 3;
		}
		else if (nextRnd >= 60 && nextRnd < 80)
		{
			state = 2;
		}
		else if (nextRnd >= 80)
		{
			state = 1;
		}
	}
}
textBox2.Text = hits.ToString();

Conclusion

As we can see, the probability of Grasp + Claws tends an average DPS of 1.71429.
On the other hand, the probability of Grasp + Bite tends to an average DPS of 1.5625.

Thus, it's better to use claws to grasp and keep clawing.

Result for all Combinations

Well, I decided to go the full monty and finish all the possible combinations of Tangling Grasp and n skills. They are compiled here. The xls on which I did all the calculations will be put up on my site soon.

Skills Method of Attack Damage / AP
Vigour Mortis + Tangling Grasp Bite 0.95
Vigour Mortis + Tangling Grasp Claw 0.824857
Vigour Mortis + Neck Lurch + Tangling Grasp Bite 1.184615
Vigour Mortis + Rend Flesh + Tangling Grasp Claw 1.218
Vigour Mortis + Death Grip + Tangling Grasp Claw 1.142857
Vigour Mortis + Rend Flesh + Neck Lurch + Tangling Grasp Bite 1.346154
Vigour Mortis + Death Grip + Neck Lurch + Tangling Grasp Bite 1.375
Vigour Mortis + Rend Flesh + Death Grip + Tangling Grasp Claw 1.714286
Vigour Mortis + Rend Flesh + Death Grip + Neck Lurch + Tangling Grasp Bite 1.5625