The To-Hit mechanic I
Across many genres we have the following dilemma for the game designer: I want the player to attack someone, but how do I model that? While people are instinctively familiar with the main solutions, we often don’t think about the different choices and what it means for the game. I thought I might jazz a bit on the taxonomy of the “to-hit” mechanic to explore the idea. Note that we don’t necessarily have to be modelling combat, but it’s the most common example with an easy-to-use vocabulary. This sort of stuff applies equally to fishing in a social game, many board game mechanics, making items in a MMORPG, sweet-talking someone or just gambling.
The way I see it, there are two basic choices you can make on how to modelling hitting and two basic choices to model the damage. First up, modelling hitting we can have:
- Always hit, assuming you could. That is, you’re close enough, you’ve taken a swing and there’s no shenanigans going on.
- Maybe hit, based on a pre-determined probability. While your animation shows you swiping a sword through the other guy’s chest, the computer rolls a random number, checks it against your probability to hit and declares it a hit or not.
Note that in both situations, there may be dynamic conditions that block or reduce your chance to hit. Many first-person shooters are “always hit” in that if the bullet looks like it’d hit them (and everyone was honest ) then it does. Role-playing games tend to default to “probability to hit” mechanics and may not have the animation budget to animate both hits and misses, so while it looks the same, you have to watch the numbers to see if a strike hits or not.
Next up, modelling damage can be done in two grossly simplified ways:
- Deal constant damage: Every time you hit, you inflict the same damage.
- Deal a variable amount of damage: The damage you deal is randomly chosen from a range to simulate the millions of different things that could affect how you deal damage like angle of attack, what they’re wearing, how they’re moving, how much force you’ve applied…
In both we allow modifiers that increase or decrease your damage in a fixed way. Basically the difference is that in the former the amount of damage you’re guaranteed is the same as what you could expect, whereas in the latter case, the two can be quite different.
Let’s have a look at a bunch of games that fall under different categories under this breakdown.
|Constant damage||Variable damage|
|Always hit||Chess, fighting games||Crafting in MMORPGs|
|Probability to hit||Arkham Horror or Civilization||Classic D&D|
Chess and many fighting games like Tekken or Virtua Fighter say “if you can hit, you do and it does a fixed amount of damage”. In the chess example, you take that piece which you could imagine dealing infinite (or sufficiently high) damage. Having damage output constant and reliable means a focus on skill elsewhere (strategy for chess, strategy and reflexes for fighting games).
Crafting in MMORPGs have the game mechanic that you always make something, but there is a rare chance that you make something awesome (called a critical success). The “damage” in this could be the value of the item produced. Team Fortress 2 is also of the type “Always hit/Variable damage”. They’ve moved away from the usual shooter model and applied a little bit of randomness to damage, though the actual mechanics involved are a little complicated. Damage output depends on a whole bunch of things like distance, but in the heat of the battle (and the vagaries of the server/client prediction through lag) you can’t be assured you’ll deal the same damage each time. They also include “criticals” in that you have a probability that your damage is tripled. All in all your damage output is extremely variable. Valve did this to break up stalemates and introduce a little bit of random momentum to games. It seems to work quite nicely.
In Arkham Horror, the usual mechanic for testing success is rolling six-sided dice and seeing if the number that turn up 5 or 6 beats some goal number. A really easy bad guy might take only one success, where a tougher one may require four successes. In combat each success deals one damage, so I’m arbitrarily considering that “fixed damage” (fixed on the number of successes that ensured the hit), but I wouldn’t argue against anyone who thought Arkham Horror was in the Probability to Hit/Variable damage slot.
Civilization is interesting in that for many iterations (unsure if it’s still the case with Civ IV or V) they had a random ballot mechanic. Suppose we have a measly warrior up against a tank. The warrior has one vote to win whereas the tank may have nine. In theory they are shuffled together randomly and the adjudicator picks out a victor. Nines times out of ten (90% of the time) the tank will beat the warrior, but every so often (10% of the time) the warrior will fluke a win. I’m not sure if these are the relative values but you get the idea. It was infuriating to have mere phalanx warrior defeat a battalion of robot soldiers just because of some rotten luck. I’ll talk more about “luck” in the next post, but it’s interesting to note that if your random number generator was biassed, it may strongly bias the game to the AI or something like that. A small technical deficiency could have a strong influence on the feel of your game.
And we get to the classic Probability to Hit, Variable Damage model that D&D made famous. The specific mechanic has changed over the years, but currently you roll a d20, add bonuses and subtract penalties and match it against a challenge rating. If you’re trying to hit someone with a sword it’s against their Armour Class (a measure of how hard they are to hit which includes but is not limited to their armour). If you hit, you roll how much damage you inflict. There are a vast number of modifications to this idea in actual play (criticals, damage reduction, what type of damage etc) but we’ll ignore them. What’s interesting is that people are encouraged to not necessarily understand a failure to hit to be a straight out miss, but perhaps it was blocked, dodged, you hit but fail to get through the armour, the sun gets in your eyes… A major peculiarity with the system is that you can have a spectacularly great to-hit roll but a terrible damage output.
So that’s the basic breakdown of choices, as I figure it. Next time I’ll talk a bit about luck, which will involve a smattering of probability and a raft of funky graphs.