Difference between revisions of "Melee Hit Chance"

From RimWorld Wiki
Jump to navigation Jump to search
m (Stat Category)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Stub|reason=Add effect of [[light]] and biological age {{BiotechIcon}} and [[Combat in darkness]] precept (if it applies to the stat/pawn directly andisn't applied elsewhere)}}
+
{{stub|reason= [[Children#Stats]] - not just what is there, but how it applies in the order of operations. }}
 
{{Stat
 
{{Stat
 
| default base value = 0
 
| default base value = 0
Line 5: Line 5:
 
| to string style = PercentZero
 
| to string style = PercentZero
 
| description = Chance to hit a target in melee. The target can still dodge even if we would've hit.
 
| description = Chance to hit a target in melee. The target can still dodge even if we would've hit.
 +
| category = PawnCombat
 
}}<ref>See MeleeHitChance in ''Rimworld/Data/Core/Defs/Stats/Stats_Pawns_Combat.xml''</ref>
 
}}<ref>See MeleeHitChance in ''Rimworld/Data/Core/Defs/Stats/Stats_Pawns_Combat.xml''</ref>
  
== Base score ==
+
== Calculation ==
 +
=== Base score ===
 
The base score starts at 0 and is affected by the following things:
 
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. For pawns without skills (e.g. animals): {{+|4}}
 
* [[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
 
** <code>offset = 12 x ((IF ''sight'' < 150% THEN ''sight'' ELSE 150%) - 100%)</code> e.g. {{+|6}} at 150% sight.
 
** <code>offset = 12 x ((IF ''sight'' < 150% THEN ''sight'' ELSE 150%) - 100%)</code> e.g. {{+|6}} at 150% sight.
Line 21: Line 23:
 
* [[Mechlord helmet]] {{BiotechIcon}}: {{--|0.5}}
 
* [[Mechlord helmet]] {{BiotechIcon}}: {{--|0.5}}
  
== Post-processing curve ==
+
=== 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.
 
The ''melee hit chance'' is then calculated with the following ''post-processing curve''. As you can see increasing the ''base score'' has diminishing returns.
  
Line 41: Line 43:
 
  }}
 
  }}
 
|}
 
|}
 +
 +
=== External offset ===
 +
The [[combat in darkness]] precept {{IdeologyIcon}} offsets the ''melee hit chance'' based on the [[light|light level]] of the ''targeted'' pawn (not the attacking pawn!) by {{--|10}} (lit) to {{+|10}} (dark){{Check Tag|Details needed|Exact formula unclear. Probably linear from -10 at 0% light to +10% at 100% light.}}. Other than that the light level has no effect on the ''melee hit chance''.
  
 
== Examples ==
 
== Examples ==
Line 280: Line 285:
  
 
== Version history ==
 
== Version history ==
* [[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. Note: Default hit chance is 0.6 for pawns without skills. This equals the chance of a pawn with melee skill 6. (''This has been reverted again at some point.'')
  
 
== References ==
 
== References ==
Line 286: Line 291:
  
 
{{Nav|stats|wide}}
 
{{Nav|stats|wide}}
 +
{{Verified|1.4.3704}}

Latest revision as of 20:02, 6 September 2024

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]

Calculation[edit]

Base score[edit]

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

Post-processing curve[edit]

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

External offset[edit]

The combat in darkness precept Content added by the Ideology DLC offsets the melee hit chance based on the light level of the targeted pawn (not the attacking pawn!) by −10 (lit) to +10 (dark)[Details needed]. Other than that the light level has no effect on the melee hit chance.

Examples[edit]

Melee skill and brawlers[edit]

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[edit]

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[edit]

  • 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. Note: Default hit chance is 0.6 for pawns without skills. This equals the chance of a pawn with melee skill 6. (This has been reverted again at some point.)

References[edit]

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