Skip to content

Hit Rules ​

Part of the Gameplay Config (Combat). These rules decide whether an attack can miss.

These rules decide whether an attack can miss. This section is long on purpose: the hit roll has a few moving parts, and your game probably wants some of them and not others.

The idea in one minute ​

When an ability that can miss reaches an enemy, the game makes one hit roll for that ability and that enemy. The roll has three possible results:

ResultWhat happens
HitThe ability applies as usual.
Glancing hitThe ability applies, but its damage and healing are weaker. Only if you turn glancing hits on.
MissNothing of the ability reaches that enemy. The attacker sees "Miss".

The chance to hit is one number you can read at any time:

text
chance to hit = base chance (melee or ranged)
              + accuracy of the attacker
              - evasion of the target
              + the change of the level gap

and then kept between the minimum and the maximum

Everything in that line is a setting you choose, or a stat you build. You can use all of it, some of it, or none of it:

  • No misses in your game? Leave Use hit system off. Nothing in this section does anything.
  • A flat 5 % miss for everybody? Turn it on, leave the rest as it is (the default base chance is 95 %).
  • Miss chances that grow with stats (accuracy, evasion) and with the difference in level? Turn it on and build the stats, and choose a level gap mode.
  • Only some abilities can miss? Leave it off and set Hit rule to Can miss on those abilities.

The roll belongs to the ability, not to the damage

Earlier versions of the toolkit worked out a miss inside the damage calculation. Now an ability rolls to hit once, before any of its effects apply. A miss therefore also stops the debuffs, statuses and everything else of that ability on that enemy, and a composite effect or an ability with three damage effects does not roll three times: all its parts hit or all miss.

When the roll is made ​

  1. An ability is used and one of its effects reaches an enemy: the damage effect of a sword swing, the first tick of a poison, the explosion of a projectile when it lands.
  2. If the ability can miss (see Hit rule), the game rolls once for that ability use and that enemy, and remembers the result.
  3. Every other effect of the same use that reaches the same enemy uses the same result. A fireball that hits five enemies makes five rolls, one for each.
  4. On a hit or glancing hit the effects apply, and then the normal damage calculation runs: the target can still dodge, parry or block. Those are not misses; they are rolled by the target's stats in Damage Taken.
  5. On a miss the effects are rejected with the reason "Missed" and the attacker sees "Miss".

What is never rolled:

CaseWhy
Effects an ability applies to itself (a buff on the caster, a self heal)Nothing is aimed at an enemy
Anything aimed at a friend (a heal on an ally, a shield on the tank)You do not miss your friends
Effects aimed at the userThe user is not an enemy of itself
The parts of a composite effectThe composite only passes its parts on. The parts share one roll
The ticks of a damage-over-time effectThe effect rolls once when it is applied. A poison that hit does not miss on tick 3
Abilities set to Always hits, or with the hit system off and Hit rule on Project defaultThey never miss

Neutral entities (wolves that have not noticed you) can be missed. Hostile ones can. Friendly ones cannot.

Settings ​

Every field has a tooltip in the editor. These are the fields of Hit Rules:

FieldWhat it doesDefault
Use hit systemThe master switch. Off: no attack ever misses, whatever the abilities and stats say, except abilities whose Hit rule is Can miss. On: every ability rolls to hit, except those that Always hitoff
Melee rangeAn ability whose Attack style is Automatic counts as melee when its range is at most this many metres, and as ranged beyond. An ability with no range limit counts as melee5
Base melee hit chanceThe chance to hit (percent) of a melee attack before stats, the level gap and the limits. 95 is a flat 5 % chance to miss95
Base ranged hit chanceThe same for ranged attacks. Give ranged attacks a different base if you want ranged and melee to feel different95
Minimum hit chanceThe chance never goes below this, so a target is never untouchable. 0 means an enemy can be impossible to hit5
Maximum hit chanceThe chance never goes above this. 95 means even the best attacker misses one time in twenty. 100 means no limit100
Level gap modeHow the levels of attacker and target change the chance: not at all, points per level, a table, or a formula. Its own fields appear under itNone
Glancing hits enabledA failed roll can still land, weaker. See Glancing hitsoff
Glancing chanceThe share of the failed rolls that become glancing hits instead of misses30
Glancing reductionHow much weaker a glancing hit is: the percent taken off its damage and healing40
Glancing other effects applyDo the statuses, buffs and debuffs of a glancing hit still apply? Off: only damage and healing happenon

If Minimum hit chance is higher than Maximum, the lower of the two is used as the minimum.

Melee and ranged ​

Hit chance has two bases because games disagree on whether bows should miss as often as swords. An ability counts as one or the other by its Attack style:

Attack styleCounts as
Automatic (default)Melee if its range is at most Melee range, otherwise ranged
MeleeMelee, whatever its range (a spear, a whip)
RangedRanged, whatever its range (a thrown dagger, a spell with a short range)

The style also decides which accuracy and evasion effects count: you can build "+5 % accuracy with ranged attacks" with the Melee or ranged hit filter. There is no distance between the two entities involved: it is melee or ranged because the ability is, not because of how far apart they happen to stand.

Level gap ​

The level gap is a decision of your game, so the toolkit does not force one. The gap is the level of the target minus the level of the attacker: +3 is an enemy three levels above you, -2 is an enemy two levels below.

ModeWhat it doesIts fields
NoneThe levels never matternone
Points per levelEvery level the target is above the attacker takes points off the chance. Optionally, every level it is below adds points backPenalty per level, Bonus per level, Limit (the most the gap can change the chance, up or down; 0 = no limit)
TableYou write the number for each gap yourselfA list of rows: a gap of N levels or more changes the chance by X points
FormulaYour own calculation. The formula gets the gap and returns the changeA formula

Points per level, with a penalty of 2, a bonus of 0 and no limit, against a base chance of 95:

Target level against yoursGapChangeChance to hit
Equal0095 %
3 levels above+3-689 %
5 levels above+5-1085 %
10 levels above+10-2075 %
5 levels below-5095 %

With a Bonus per level of 1 the last row becomes +5 (100 %), and a Limit of 6 stops the table at -6 and +6.

Table. A gap uses the row with the largest gap that is not above it. A gap below every row changes nothing. A table like the one World of Warcraft used to have looks like this:

Row: gap ofChangeSo a gap of ... uses it
-5+10-5 to -1
000 to 2
3-53 and 4
5-205 and up
(no row)0-6 and lower

Formula. The formula receives the gap as its number and returns the change in points. A Linear formula of -3 per point is "3 points off per level above, 3 points on per level below". Formulas can use level scaling, so you can make a gap hurt more at high levels, or add diminishing returns so the first levels count most.

The editor shows a small table of the change for a few gaps, so you can check your choice without playing.

Accuracy and evasion ​

Stats change the chance with the Hit Chance Effect, one of the stat effects:

FieldWhat it does
SideAccuracy raises the chance of the attacks of whoever has the stat. Evasion lowers the chance of the attacks aimed at whoever has the stat
ValueA number of points of hit chance. A Linear formula of 0.1 per point of the stat is a tenth of a percent per point
Hit filtersLimit it to melee or ranged attacks, a school, some abilities, direct hits or ticks
ConditionsLike any stat effect: "only against Undead", "only while in combat"

An Accuracy of 20 points on the attacker and an Evasion of 10 points on the target, against a base of 50, give 50 + 20 - 10 = 60 %. The two sides read their own stats: the target's accuracy and the attacker's evasion do not count in this attack.

The demo has two: Defense carries an Evasion effect, and the proficiency One-Handed Weapons carries an Accuracy effect that only works while a one-handed weapon is held. Recipes are on Stat recipes.

Glancing hits ​

A game with misses sometimes finds them frustrating: a whole ability, wasted. A glancing hit is the softer failure. When the roll fails, a share of the failures become glancing hits: the attack lands, but weaker.

text
roll to hit ..... succeeds ........................... Hit
       |
       fails ... roll again against Glancing chance
                  succeeds ........................... Glancing hit
                  fails .............................. Miss

With a base chance of 80 %, a glancing chance of 30 % and a reduction of 40 %:

ResultHow oftenWhat happens
Hit80 %Full damage and healing
Glancing hit20 % x 30 % = 6 %60 % of the damage and 60 % of the healing
Miss20 % x 70 % = 14 %Nothing
  • The glancing chance applies only to failed rolls, so turning it up never lowers the chance to hit.
  • Glancing reduction 100 makes a glancing hit do nothing (but its other effects still apply, if you let them). 0 makes it the same as a hit.
  • Glancing other effects apply decides what happens to the rest of the ability. On (default): a glancing hit still stuns, slows or poisons in full, and only the damage and the healing are weaker. Off: only damage and healing happen, so the debuffs are lost.
  • Dodges, blocks and critical strikes still work on a glancing hit.
  • The floating text reads "42 (glancing)" and the combat log says the attack "glancingly hit".

Per ability: Hit rule and Attack style ​

The Abilities editor has a Hit roll box with two fields:

FieldOptions
Hit ruleProject default: it can miss when Use hit system is on. Always hits: it never misses, whatever the project says (a spell that cannot be dodged, a trap, an execution). Can miss: it rolls even when Use hit system is off
Attack styleAutomatic, Melee, Ranged, as above
Hit ruleHit system offHit system on
Project defaultnever missescan miss
Always hitsnever missesnever misses
Can misscan misscan miss

The editor tells you what the ability does with the current settings. Can miss with the hit system off is how you make a game where only a few abilities (a sniper shot, a dangerous gamble) can miss.

The same hit rule is what ends the old question "should the hit chance be a calculation?": there is no hit chance in the damage calculation any more, the ability decides.

What the player sees ​

ResultFloating textCombat log
Hitthe damage"X hit Y for N"
Glancing hit"N (glancing)""X glancingly hit Y for N"
Miss"Miss""X's Ability missed Y"

Recipes ​

You wantSettings
No misses at allUse hit system off, and no ability with Can miss
A flat 5 % miss chance for everyoneUse hit system on, base chances 95, Minimum 5, no stats
Spells that never miss, weapons that canUse hit system on, and Hit rule Always hits on the spells
Only a sniper shot can missUse hit system off, Hit rule Can miss on that ability, base ranged chance as you like
Bows miss more than swordsBase melee 95, Base ranged 85
Higher level enemies are harder to hit, old-schoolLevel gap mode Table or Points per level with a penalty
Gear and skills raise your chance to hitBuild an Accuracy stat. A proficiency can carry one
Enemies you can never be sure to hitMaximum hit chance 95
A target nobody can hitMinimum 0 and an Evasion above the base chance
Misses that sting lessGlancing hits on

For programmers ​

The chance is one function, so a tooltip or an AI can ask for it without rolling:

gdscript
var chance: float = HitRules.get_chance(attacker, target, ranged)        # 0 to 100
var outcome: HitRules.Outcome = HitRules.roll(attacker, target, ranged)   # HIT, GLANCING or MISS

An ability instance answers can_miss() and is_ranged_attack(). See Advanced > Entity Stats > the hit and heal pipeline.