# What is an alternative to scratch damage to solve combat deadlocking?

Scratch damage is a game mechanic whereby any successful attack always does some minimal amount of damage. This is often used in subtractive combat systems, where the defense is subtracted directly from the damage done by an attacker. Therefore, the target will always take some minimal damage.

The downside of such a system, for me at least, is that it's a hack. It takes a simple formula like Damage = Attack - Defense and turns it into a (slightly) more complex one: Damage = max(Attack - Defense, 1).

I also feel that it detracts from a player's skill in developing their character/etc. No matter how many defense bonuses they get, every attack will do some small damage. So why get your defense so high, if it won't mean anything?

Furthermore, this now encourages the use of larger numbers for Hp and damage, so that the scratch damage is truly negligable. After all, if the minimum damage is 1, and you only have 10 Hp, that's still 10% of your health. Even with 20 Hp, that's 5%. And I would rather avoid using larger numbers like that unless it's absolutely necessary.

However, there is one very important upside of scratch damage: it solves the deadlock problem.

Deadlock happens when neither side is able to do damage to the other. If you invest all of your resources into defense, and few into attack, then your character may not take damage, but they won't be able to deal very much either. Thus, you could come upon an encounter where neither side will be able to inflict damage, so battle continues forever. This is especially if you don't have random mechanics like critical hits (which I also hate).

At least with scratch damage, someone will eventually win. It may only be the one with the most Hp or highest number of attacks, but the battle will end.

So I like having a combat system where there will always be an outcome. But I don't like having scratch damage. What are my alternatives?

Alternatives that don't involve rolling random numbers; I want combat to be 100% deterministic. If the same battle is fought, the exact same outcome must happen.

If you want specifics on the gameplay, think in terms of turn-based combat, where battle can be automated (you design your forces, then pit them against others).

You could implement a fatigue/stamina system. As more and more attacks are done the player becomes increasingly fatigued meaning they are unable to maintain such a good defense (that shield arm suddenly starts feeling really heavy after swinging the sword 50 times) as fatigue increases, defense falls. This means a player who has developed a good character won't take damage in quick encounters but longer drawn out combat will result in increasing damage preventing a deadlock.

This seems like a very open-ended question. Solutions (that aren't already mentioned) to prevent deadlocks:

• Allow for deadlocks as a viable end result. This is the least expected or typical solution. In an RTS game, for example, this might be an uneasy cease-fire, or tense but low-key conflict in a violent balance.
• A time limitation with ties allowable
• A time limitation wherein the first hit/score/point after the limit wins (sudden death/overtime)
• Random dangers in the system (a la bombs in Super Smash Bros). This changes the focus of the situation from offense to defense.
• Any external factor to imbalance the system (e.g. a third agent with high damage and low armor, an agreement by both sides to "duel" without all that armor)
• Defense as a % reduced (probably the simplest solution, as long as the defense is capped)
• Skills or tactics which alter the dynamics of gameplay (choices that don't result in damage, such as a Cloak/Invisibility skill)
• Means of doing much higher damage (classic critical hits, stealth bonuses, height bonuses, terrain bonuses, an ability that turns random portions of ground into lava)
• Means of damaging or lowering armor, or causing a damage directly targetted to high-defense characters (skill that inverses armor in the calculation, so agents with lower defense receive less damage)
• Limited use items or skills (e.g. bombs, powerful but draining abilities). Only useful if there are long-term goals beyond the deadlock with which to balance limited use
• End combat artificially (classic "Flee" option)

As variant, you may add wound accumulation. Surely, giant copper axe will not penetrate heavy steel armour, but it will do some blunt damage, and may even break bones. The same is true for bullets and vests.

Every time a character is hit, convert part of piercing and slashing damage into blunt damage, which accumulates. After certain threshold (that depends on endurance, for instance), the accumulated damage will interfere with the character's combat skills. Some options here:

• Armor could be less efficient when taking hits in the same body parts.

• Significant wounds: periodic damage, weakness due to pain.

• Severe wounds: short-term loss of consciousness (rendering the character very vulnerable).

• Extreme wounds: permanent stat loss (if character manages to survive).

• I was going to suggest giving every weapon bludgeoning damage that cannot be blocked by armor. Swords and daggers would have small bludgeoning capacity, but axes and maces would be very effective. – jmegaffin May 5 '13 at 21:01

Implement different types of damage, with armors that only protect against some types of damage. For example, kinetic damage, acid damage, fire damage, etc. No armor should protect against each type of damage.

Users could layer their armors to protect against all damage types, but they couldn't protect against all damage types at the same time. This implements some strategy into battles as well, where players have to switch damage types to get through the various layers of armor.

You could just not have a defence stat and just give bigger enemies bigger hp. I know you want to avoid gigantic numbers, but if you want a deterministic, turn based game where attacks aren't based on the players input directly (there is no chance of human error messing the attack up) the defence stat seems a little pointless as well.

If you are worried about the presentation aspect you could break HP down into Hearts or Health pips EG 100 hp = 1 heart. Hearts start to go black as a character loses HP, then disappear entirely. That way it's easier for the player to understand than 129301239103123hp, but you don't have to worry about balancing some magic equation.

If you are worried about realism, you could always have it animated to look like the attack's target successfully blocks or is only lightly scratched until the killing blow.

• "if you want a deterministic, turn based game where attacks aren't based on the players input directly [...] the defence stat seems a little pointless as well." Defense is not based on the concept of "chance-to-miss". It's more like damage reduction in D&D, not THAC0 (or whatever they're calling it these days). Defense means that a 40 damage attack can be reduced to 10 damage if you have 30 defense. I don't see how that can ever be "pointless. – Nicol Bolas May 4 '13 at 15:39
• I know the math is a little different, but really there isn't a huge amount of difference in terms of game-play between just giving a character a proportionate amount of health instead and having damage be reduced by a certain amount. Not if there must always be some way of dealing damage to a target. EDIT: That's assuming there aren't any special attacks that ignore defence, or other gameplay modifiers. – Lewis Wakeford May 4 '13 at 15:44
• Having a subtractive defense stat gives you something more than just Hp (in addition to all of the things you except, like special attacks or modifiers). It creates stratification between damage-over-time users and high-damage users. A character that attacks multiple times but with lower damage will run afoul of a high defense character, while a slower, high-damage character will be doing more damage-over-time. Mere hit-points will not create this stratification. – Nicol Bolas May 4 '13 at 15:52

Add a wear-down mechanic for defense. Make every attack slightly reduced the defense of the target.

Eventually even a weak attack will wear down the targets defense enough to inflict actual damage.

If you are OK with stepping out from the world of integers and willing to spice up subtraction system, you can use damage reduction algorithm from Warlords Battlecry III:

damage = attack

while DR > 0:
usedDR = DR
if DR > damage
usedDR = damage
damage = damage - usedDR * 0.5
DR = (DR - usedDR) / 2

HP = HP - damage


This is the function that behaves very similar to the above pseudocode:

damage(attack, DR) = attack * 2 ^ -(DR/attack)


When DR is smaller than attack (incoming damage), it behaves like attack - k*DR where k is 0.693 (ln(2) to be exact). When DR is close to or bigger then incoming damage than the damage is halved DR/attack times. For example for DR = 30 and attack = 10, damage would be 1.25 (attack halved 3 times).

It may look like more complicated and harder for human to evaluate but it is hack free and changes in both parameters are relevant. If attacker gains bonus attack power or defender gains or loses DR by even small amounts, the resulting damage will change.

Use floats.

Even if you present integer HP to the player, use float for hp and float for damage.

I am using fractional armor classes now, where armor of 1.0 is invincible and armor of 0.0 means "takes full damage". Damage is reduced as:

float hpReduction = hp - dmg*(1.f - armor) ;


This formula has the effect of allowing "double damage" by setting armor to -1.

I have classified damage into categories as well, see Starcraft's concussive/explosive damage types, or Eve's damage type system for an example.

So now, a little imp scratching at your .99 class armor will eventually Cherry Tap you to death, but the attacks will appear to do no damage to the player (he will remain at 1 hp as he goes from 1.15 hp to 1.1499 hp the next attack..)

A skill graph could put some damage-dealing skills as prerequisites for higher-level defensive skills to reduce a player's ability to make highly asymmetrical builds.

Critical hits can get some damage through as long as one's defense is not absurdly high. If you make them periodic rather than random, you still have deterministic combat.

After a number of failed hits, you might automatically reduce attack speed in favor of higher hit chance and damage. Your super-fast scratch character was doing ten attacks per second; now, after fifteen attacks doing no damage, it gets three attacks per second at +50% to hit and +200% damage. This is similar to critical hits, but it's faster for this sort of situation.

You could use percentage based damage reduction from armor, but to make it more interesting than another way to buff your maximum HP, you could have the reduction percentage be greater for weaker hits. For instance, 90% reduction for 1-20hp of damage, 60% for 20-30, and 30% for everything else.

Finally, don't worry about large numbers. They give you a much finer degree of control than small ones. Having a level 1 character start off with 100 hit points means you can have something that kills them off in seven hits but not five. It means you can have poison damage and other damage over time effects that aren't outrageously devastating (as well as some that are, if you like). If you don't like displaying large numbers, find a way not to display them.

You say you want there to always be a resolution, but does that have to be a victory?

Consider the approach used by Dominions--on turn 50 the attacker automatically routs. On turn 75 the defender automatically routs. (A rout doesn't automatically work--some units are immune to routing and even if an immobile unit routs it can't actually leave.) On turn 100 everything left is killed.

While I disagree with the exact way it functions (there are situations where it simply takes too long to kill the other side) the basic idea remains valid.

What I would suggest:

Look at some measure of the power of each side. (Hit points are an obvious starting point but be careful, Dominions has a problem in this regard where hit points "loss" that isn't meaningful is being counted--shapechanging, summons etc. resulting in armies routing due to casualties when they didn't even take any.) Keep track of the minimum value reached and note how many turns it has been since a new minimum has been set. If it goes too long without a new minimum being set you have a deadlock of some kind and the attacker should retreat.

An alternative I haven't seen yet is that as your armour value makes the attack negative you could add a little RNG for a true block:

const stratchDamage = 1;
var armour = 10;
var blockCount = 0;

function registerAttack (incomingAttack)
{
var incomingDamage = incomingAttack - armour;

// Nothing unusual, deal damage
if( incomingDamage > 0 )
{
dealDamage(incomingDamage);
}

// Armour cancels out attack, deal scratch damage
else if( incomingDamage == 0 )
{
dealDamage(scratchDamage);
}

// Armour over attack value, check if can block
else
{
var trueBlockChance = armour - incomingDamage;

// blockCount starts at 0, will always block first attack
if( trueBlockChance  > blockCount )
{
// Can technically do nothing, or trigger block animations etc
block();
blockCount ++; // Increment block so they can't block forever
}
else
{
dealDamage(stratchDamage);
blockCount = 0;
}
}
}


The higher the deficit of damage after armour is taken into account, the more attacks the character can block before taking another bout of scratch damage.

This provides a little extra scale for defensive stats whilst not making them invulnerable, also allows attacks to get through this block mechanic should you want them to and naturally will prevent deadlocks.

Fights might take a long time if you have stacked stats in your defence over offence, but it'll get there in the end.

• Quote from OP: I want combat to be 100% deterministic. This does not allow for 100% deterministic combat. – Charanor Jul 20 '17 at 13:20
• Then the block can be turn based too, for each level of trueBlock over an attack, the enemy must attack that many times to achieve scratch damage. Same idea can apply. – Tom 'Blue' Piddock Jul 20 '17 at 13:24
• @Charanor - adjusted the answer to be 100% deterministic. – Tom 'Blue' Piddock Jul 20 '17 at 13:44

Lots of 3D fighting games avoid scratch damage. Examples are Tekken and Soul Calibur 2. They avoid this by making it difficult to have a perfect defense. Some attacks are simply too fast to react to. I think it's a pretty good solution.

I think reducing the effectiveness of Defense is not a good option. Depowering a player leads to a bad game experience. Why not go the other way around?

Why not powering up the Attack as time goes by. This makes scratch damage increase with time, reducing the incentive of blocking. In mid-late game, a character can kill another while wailing on him while he's defending.

Some pnp rpgs implement a "tension mechanism". Each turn tension increases by one. All the rolls have the added modifier of the tension value, pushing the battle towards an end.

Another idea, coming from Fighting games, is an attack that goes through defense. I don't know if your game is turn based or real-time, but this attack could also open the opponent to a combo or disable him or some of his abilities temporarily.

I believe the trick is not to undepower defense. Make other options just as good as defense, or reduce the times where defense is a good option.