Skip to content

Combat: Melee Attacks, Hitting, Critical Hits, Dodge, and Defense

Zachary Adam-MacEwen edited this page Jan 20, 2018 · 2 revisions

Let's consider the melee attack - likely to be the staple of any TT game, given that melee weapons are more plentiful and intended to be programmed in as more powerful, plus the Unmitigated Coolness FactorTM.

Melee combat is governed by the Melee Combat Check, which itself consists of a series of internal sub-checks, before yielding damage output. We'll look at each in turn.

Initial To-Hit Check

When resolving a melee attack, the following calculation is used:

def rolltoHit():
 rateToHit = weaponSkill + luck
 if rand(0,1) =< rateToHit:
    return True
 else:
    return False

Where weaponSkill is the character's skill in the currently attacking weapon's type, and luck is their luck score value, a small fudge-factor.

Assessing Criticality

If an attack hits, the game must next check to see if the associated hit was critical. In the event of a critical hit, skip directly to the damage calculation. As in most systems, this will also affect damage output.

def rollCrit():
 if rand(0,1) =< chanceCrit:
    return True
 else
    return False

Defender's Roll to Dodge

If hit by a non-critical attack, the defending character has a chance to mitigate the damage using a dodge - the dodge chance is a special chance derived from their overall agility score, which is bounded between 0% and 25% and determined logarithmically. As before, a random floating point number between 0 and 1 is generated, and if it is less than the dodge chance the dodge was successful and damage is fully mitigated.

Defender's Roll for Defence

A defender then rolls for another random floating point number between 0 and 1. This amount compared against some logarithmic expression of their Defence Factor. If the roll was less, the attack is blocked, the damage is reduced by factDef, and, if implemented, any armour with a durability score takes durability damage.

Overall Note on Mititgation Chance

If a player with the maximum weapon skill of 99 attacks a player with the maximum dodge and defence values of 25% and 50%, the total chance of the attack being blocked is on the order of 37%, unless the attacking player has an elevated luck score. As a note, the chanceDef value is not hard capped at 50% - some games may include armour items that raise the value beyond that point.

Rolling for Damage

Rolling for damage is somewhat easier - a logarithmic formula is used to derive damage bonus from strength and any existing attributes, including bonuses or attributes attached the weapon. This damage bonus is then applied to a damage number generated in the range between the upper and lower bounds of that weapon's damage range, and applied to the target.

In the event of a critical, the damage roll is executed twice separately - criticals are not "double damage" but two damage strike opportunities.