Difference between revisions of "Melee Hit Chance"

From RimWorld Wiki
Jump to navigation Jump to search
(updated. automation. short explanations)
Line 1: Line 1:
{{rewrite|reason=Outdated and not enough information on how the chance is calculated}}
+
{{Stub|reason=Add effect of [[light]] and biological age {{BiotechIcon}} }}
{{stub}}
 
 
{{Stat
 
{{Stat
| default base value = 1.00
+
| default base value = 0
| min value = 0.01
+
| min value = 0
 
| to string style = PercentZero
 
| to string style = PercentZero
| description = Base chance to hit a target in melee.
+
| description = Chance to hit a target in melee. The target can still dodge even if we would've hit.
}}
+
}}<ref>See MeleeHitChance in ''Rimworld/Data/Core/Defs/Stats/Stats_Pawns_Combat.xml''</ref>
  
== Factors ==
+
== Base score ==
 +
The base score starts at 0 and is affected by the following things:
 
* [[Skills#Melee|Melee]][[Skill::Melee| ]] skill: {{+|1}} per level
 
* [[Skills#Melee|Melee]][[Skill::Melee| ]] skill: {{+|1}} per level
 
* [[Sight]]: [[Sight Importance::12|12x]] importance,  no allowed defect. [[Sight Limit::1.5|150%]] limit
 
* [[Sight]]: [[Sight Importance::12|12x]] importance,  no allowed defect. [[Sight Limit::1.5|150%]] limit
Line 15: Line 15:
 
** <code>offset = 12 x ((IF ''manipulation'' < 150% THEN ''manipulation'' ELSE 150%) - 100%)</code> e.g. {{+|3}} at 125% manipulation.
 
** <code>offset = 12 x ((IF ''manipulation'' < 150% THEN ''manipulation'' ELSE 150%) - 100%)</code> e.g. {{+|3}} at 125% manipulation.
 
* [[Brawler]] trait: {{+|4}}
 
* [[Brawler]] trait: {{+|4}}
* [[Ideoligion#Melee specialist|Melee specialist role]]{{IdeologyIcon}}: {{+|8}}
+
* [[Ideoligion#Melee specialist|Melee specialist role]] {{IdeologyIcon}}: {{+|7}}
* [[Ideoligion#Melee specialist|Melee specialist's Beserk Trance]]{{IdeologyIcon}}: {{+|8}}
+
* [[Ideoligion#Melee specialist|Melee specialist's Beserk Trance]] {{IdeologyIcon}}: {{+|8}}
* [[Ideoligion#Leaders|Leader's Combat Command]]{{IdeologyIcon}}: {{+|3}}
+
* [[Ideoligion#Leaders|Leader's Combat Command]] {{IdeologyIcon}}: {{+|3}}
* [[Mechlord suit]]{{BiotechIcon}}: {{--|0.5}}
+
* [[Mechlord suit]] {{BiotechIcon}}: {{--|0.5}}
* [[Mechlord helmet]]{{BiotechIcon}}: {{--|0.5}}
+
* [[Mechlord helmet]] {{BiotechIcon}}: {{--|0.5}}
  
 
== Post-processing curve ==
 
== Post-processing curve ==
{{Stub|section=1|reason=compare [[Melee Dodge Chance]]}}
+
The ''melee hit chance'' is then calculated with the following ''post-processing curve''. As you can see increasing the ''base score'' has diminishing returns.
== Chance to hit ==
+
 
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;"></div>
+
{| class="wikitable"
 +
! Base score to Melee hit chance
 +
|-
 +
| {{Graph:Chart
 +
| width = 300
 +
| height = 300
 +
| type = line
 +
| xAxisTitle = Base score
 +
| yAxisTitle = Melee hit chance
 +
| x =  -20, -10,  0,  10,  20,  40,  60
 +
| y = 0.05, 0.1, 0.5, 0.8, 0.9, 0.96, 0.98
 +
| yAxisFormat = %
 +
| yAxisMax = 1
 +
| xGrid = 10
 +
| yGrid = 0.1
 +
}}
 +
|}
 +
 
 +
== Examples ==
 +
=== Melee skill and brawlers ===
 +
Assuming no other offsets to the ''base score'', the [[Skills#Melee|melee]] skill and the [[brawler]] trait results in the following ''melee hit chance'':
 +
 
 
{| {{STDT| c_12 text-center}}
 
{| {{STDT| c_12 text-center}}
! colspan="6" style="text-align: center;" | '''Chance to hit'''
+
! colspan="6" style="text-align: center;" | '''Melee hit chance'''
 
|-
 
|-
!Skill Level
+
! Skill Level
!Standard
+
! Standard
!Brawler
+
! Brawler
!Skill Level
+
! Skill Level
!Standard
+
! Standard
!Brawler
+
! Brawler
 
|-
 
|-
!0
+
! 0
|50%
+
| {{%|{{Melee Hit Chance/curve|0}} }} || {{%|{{Melee Hit Chance/curve|0+4}} }}
|62%
 
 
! -
 
! -
| -
+
| - || -
| -
 
 
|-
 
|-
!1
+
! 1
|53%
+
| {{%|{{Melee Hit Chance/curve|1}} }} || {{%|{{Melee Hit Chance/curve|1+4}} }}
|65%
+
! 11
!11
+
| {{%|{{Melee Hit Chance/curve|11}} }} || {{%|{{Melee Hit Chance/curve|11+4}} }}
|81%
 
|85%
 
 
|-
 
|-
!2
+
! 2
|56%
+
| {{%|{{Melee Hit Chance/curve|2}} }} || {{%|{{Melee Hit Chance/curve|2+4}} }}
|68%
+
! 12
!12
+
| {{%|{{Melee Hit Chance/curve|12}} }} || {{%|{{Melee Hit Chance/curve|12+4}} }}
|82%
 
|86%
 
 
|-
 
|-
!3
+
! 3
|59%
+
| {{%|{{Melee Hit Chance/curve|3}} }} || {{%|{{Melee Hit Chance/curve|3}} }}
|71%
+
! 13
!13
+
| {{%|{{Melee Hit Chance/curve|13}} }} || {{%|{{Melee Hit Chance/curve|13+4}} }}
|83%
 
|87%
 
 
|-
 
|-
!4
+
! 4
|62%
+
| {{%|{{Melee Hit Chance/curve|4}} }} || {{%|{{Melee Hit Chance/curve|4+4}} }}
|74%
+
! 14
!14
+
| {{%|{{Melee Hit Chance/curve|14}} }} || {{%|{{Melee Hit Chance/curve|14+4}} }}
|84%
 
|88%
 
 
|-
 
|-
!5
+
! 5
|65%
+
| {{%|{{Melee Hit Chance/curve|5}} }} || {{%|{{Melee Hit Chance/curve|5+4}} }}
|77%
+
! 15
!15
+
| {{%|{{Melee Hit Chance/curve|15}} }} || {{%|{{Melee Hit Chance/curve|15+4}} }}
|85%
 
|89%
 
 
|-
 
|-
!6
+
! 6
|68%
+
| {{%|{{Melee Hit Chance/curve|6}} }} || {{%|{{Melee Hit Chance/curve|6+4}} }}
|80%
+
! 16
!16
+
| {{%|{{Melee Hit Chance/curve|16}} }} || {{%|{{Melee Hit Chance/curve|16+4}} }}
|86%
 
|90%
 
 
|-
 
|-
!7
+
! 7
|71%
+
| {{%|{{Melee Hit Chance/curve|7}} }} || {{%|{{Melee Hit Chance/curve|7+4}} }}
|81%
+
! 17
!17
+
| {{%|{{Melee Hit Chance/curve|17}} }} || {{%|{{Melee Hit Chance/curve|17+4}} }}
|87%
 
|90.3%
 
 
|-
 
|-
!8
+
! 8
|74%
+
| {{%|{{Melee Hit Chance/curve|8}} }} || {{%|{{Melee Hit Chance/curve|8+4}} }}
|82%
+
! 18
!18
+
| {{%|{{Melee Hit Chance/curve|18}} }} || {{%|{{Melee Hit Chance/curve|18+4}} }}
|88%
 
|90.6%
 
 
|-
 
|-
!9
+
! 9
|77%
+
| {{%|{{Melee Hit Chance/curve|9}} }} || {{%|{{Melee Hit Chance/curve|9+4}} }}
|83%
+
! 19
!19
+
| {{%|{{Melee Hit Chance/curve|19}} }} || {{%|{{Melee Hit Chance/curve|19+4}} }}
|89%
 
|90.9%
 
 
|-
 
|-
!10
+
! 10
|80%
+
| {{%|{{Melee Hit Chance/curve|10}} }} || {{%|{{Melee Hit Chance/curve|10+4}} }}
|84%
+
! 20
!20
+
| {{%|{{Melee Hit Chance/curve|20}} }} || {{%|{{Melee Hit Chance/curve|20+4}} }}
|90%
 
|91.2%
 
 
|}
 
|}
  
 
+
=== Detailed post-processing curve ===
 
 
 
{| class="wikitable"
 
{| class="wikitable"
|-
+
! Base score !! Post-Processed<br/>Melee Hit Chance || Increase From<br/>Previous Value
! Melee Hit<br>Chance Value !! Post-Processed<br>Melee Hit Chance %<ref>Rimworld/Data/Core/Defs/Stats/Stats_Pawns_Combat.xml MeleeHitChance</ref> || Increase From<br>Previous Value
 
 
|-
 
|-
 
| -20 || {{%|{{Melee Hit Chance/curve|-20}}|1}} || -
 
| -20 || {{%|{{Melee Hit Chance/curve|-20}}|1}} || -
Line 285: Line 282:
 
* [[Version/0.17.1546|0.17.1546]] - Removed post-process curve from melee hit chance so it uses the simple level-by-level tuning. It’ll be much harder to hit things now at low melee skills.
 
* [[Version/0.17.1546|0.17.1546]] - Removed post-process curve from melee hit chance so it uses the simple level-by-level tuning. It’ll be much harder to hit things now at low melee skills.
  
{{nav|stats|wide}}
+
== References ==
 +
<references/>
 +
 
 +
{{Nav|stats|wide}}

Revision as of 11:36, 24 April 2023

Melee Hit Chance is a stat: Chance to hit a target in melee. The target can still dodge even if we would've hit. Its minimum allowed value is 0%. Its default value is 0%.[1]

Base score

The base score starts at 0 and is affected by the following things:

Post-processing curve

The melee hit chance is then calculated with the following post-processing curve. As you can see increasing the base score has diminishing returns.

Base score to Melee hit chance

Examples

Melee skill and brawlers

Assuming no other offsets to the base score, the melee skill and the brawler trait results in the following melee hit chance:

Melee hit chance
Skill Level Standard Brawler Skill Level Standard Brawler
0 50% 62% - - -
1 53% 65% 11 81% 85%
2 56% 68% 12 82% 86%
3 59% 59% 13 83% 87%
4 62% 74% 14 84% 88%
5 65% 77% 15 85% 89%
6 68% 80% 16 86% 90%
7 71% 81% 17 87% 90.3%
8 74% 82% 18 88% 90.6%
9 77% 83% 19 89% 90.9%
10 80% 84% 20 90% 91.2%

Detailed post-processing curve

Base score Post-Processed
Melee Hit Chance
Increase From
Previous Value
-20 5% -
-19 5.5% 0.5%
-18 6% 0.5%
-17 6.5% 0.5%
-16 7% 0.5%
-15 7.5% 0.5%
-14 8% 0.5%
-13 8.5% 0.5%
-12 9% 0.5%
-11 9.5% 0.5%
-10 10% 0.5%
-9 14% 4%
-8 18% 4%
-7 22% 4%
-6 26% 4%
-5 30% 4%
-4 34% 4%
-3 38% 4%
-2 42% 4%
-1 46% 4%
0 50% 4%
1 53% 3%
2 56% 3%
3 59% 3%
4 62% 3%
5 65% 3%
6 68% 3%
7 71% 3%
8 74% 3%
9 77% 3%
10 80% 3%
11 81% 1%
12 82% 1%
13 83% 1%
14 84% 1%
15 85% 1%
16 86% 1%
17 87% 1%
18 88% 1%
19 89% 1%
20 90% 1%
21 90.3% 0.3%
22 90.6% 0.3%
23 90.9% 0.3%
24 91.2% 0.3%
25 91.5% 0.3%
26 91.8% 0.3%
27 92.1% 0.3%
28 92.4% 0.3%
29 92.7% 0.3%
30 93% 0.3%
31 93.3% 0.3%
32 93.6% 0.3%
33 93.9% 0.3%
34 94.2% 0.3%
35 94.5% 0.3%
36 94.8% 0.3%
37 95.1% 0.3%
38 95.4% 0.3%
39 95.7% 0.3%
40 96% 0.3%
41 96.1% 0.1%
42 96.2% 0.1%
43 96.3% 0.1%
44 96.4% 0.1%
45 96.5% 0.1%
46 96.6% 0.1%
47 96.7% 0.1%
48 96.8% 0.1%
49 96.9% 0.1%
50 97% 0.1%
51 97.1% 0.1%
52 97.2% 0.1%
53 97.3% 0.1%
54 97.4% 0.1%
55 97.5% 0.1%
56 97.6% 0.1%
57 97.7% 0.1%
58 97.8% 0.1%
59 97.9% 0.1%
60 98% 0.1%

Version history

  • 0.17.1546 - Removed post-process curve from melee hit chance so it uses the simple level-by-level tuning. It’ll be much harder to hit things now at low melee skills.

References

  1. See MeleeHitChance in Rimworld/Data/Core/Defs/Stats/Stats_Pawns_Combat.xml