Blog5 min read
Dev log: THAC0 combat and honor
How a swing is resolved on the server, with a worked d20 roll, plus the honor rules that make PvP farming pointless.
Early on, combat in The Living World was a flat coin flip, and nobody’s stats mattered. This dev log covers what replaced it. It is the THAC0 system from second-edition AD&D, resolved on the server, plus the honor reward for PvP kills.
The to-hit roll
Every attacker has a THAC0, short for “To Hit Armor Class 0”. It is the d20 roll you need to hit a target with armor class 0. The lower your THAC0, the better you are. Targets with a higher armor class are easier to hit and targets with a lower one are harder.
The server computes the number you need like this:
needed = THAC0 − target AC − Strength to-hit bonus
Then it rolls a d20. You hit if the roll is at least needed.
A worked example
Take a level 1 fighter with 16 Strength. Fighters start at THAC0 20. A Strength of 16 gives no bonus to hit but adds +1 to damage. The fighter swings at a player with no armor, which is AC 10.
- needed = 20 − 10 − 0 = 10
- The d20 comes up 14. That is 10 or more, so it is a hit.
- The fighter’s weapon die is a d8, which rolls 5. Add the +1 Strength damage bonus for 6 damage.
Now the same fighter swings at a bandit, who has AC 8. The target number is 20 − 8 − 0 = 12, so the fighter needs a 12 or better, a forty-five percent chance. Against AC 10, that was fifty-five percent. Armor matters.
A level 1 mage has THAC0 20 too, but a d4 weapon die. The mage will hit just as often, and hurt a lot less. That is why mages cast spells.
Crits and fumbles
The natural die overrides the math:
- A natural 20 always hits, even if the target number is above 20.
- A natural 1 always misses, even if the target number is 1 or lower.
Damage is the weapon die plus the Strength damage bonus, with a floor of 1 on any hit. A hit always does at least something. The die comes from the weapon you have equipped: a dagger rolls a d4, a long sword a d8 and a great axe a d12. Armor sets your armor class in the same way, with leather at AC 8, chain mail at AC 5 and plate mail at AC 3, so gearing up changes both how hard you hit and how often you get hit.
We should be honest that we do not yet have a separate critical-hit damage multiplier. A natural 20 is a guaranteed hit and not a double-damage bonus. We may add one later, and if we do it will be in a post like this.
How THAC0 improves
Warriors (fighter, ranger, barbarian) lose one point of THAC0 per level: at level 10 it is 11. Rogues improve one point every two levels, reaching 16 at level 10. Mages improve one point every three levels, reaching 17 at level 10. The gap is part of class identity.
The trace
Every swing writes an entry to the server’s combat debug log. An entry looks like this, for a level 1 fighter with 17 Strength (a +1 to hit and +1 damage bonus) swinging at an unarmored player:
Bram->Mira d20=14 need=9 (thac0 20 -ac 10 -str 1) HIT 7 18->11
The parenthesis shows the three terms of the target number, and the last two numbers are the victim’s hit points before and after.
When someone asks why they missed, we can answer with the numbers.
Honor: a reward that resists farming
When one player kills another, the killer gets honor. It is a separate per-character score and not experience. The formula is deliberately simple:
award = floor( victim level × 50 × gap factor × 0.5^(prior kills of that victim) )
The pieces:
- Base. A level 1 victim is worth 50, a level 4 victim 200.
- Level gap. The gap factor falls linearly from 1 to 0 as you get higher than your victim. A level 3 attacker killing a level 1 victim earns 60 percent of the base, 30 honor. At five levels above the victim, the reward is zero, so nobody gets rich bullying beginners.
- Repeat kills. Each earlier kill of the same victim halves the reward. The first kill of a level 1 player pays 50, the second 25, the third 12.
Some cases pay nothing at all:
- Same account. If both characters belong to one account, the award is zero. That closes the alt-farming loophole outright.
- Spawn camping. A victim who respawned in the last five seconds is worth nothing, so camping the spawn point earns no credit.
Honor is saved to the character. When you earn some, a +N ⚜ floats up from your player frame and the badge pulses.
What is next
Right now everyone is early in their careers, so the level gap rarely bites. It is correct and it is running on every kill, and it will start to matter as people level. Next up is loot, more gear and consumables, which will make both weapon dice and armor class far more interesting to chase.
By The Living World team