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:

  1. Always hit, assuming you could. That is, you’re close enough, you’ve taken a swing and there’s no shenanigans going on.
  2. 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:

  1. Deal constant damage: Every time you hit, you inflict the same damage.
  2. 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.

Trackback

3 comments until now

  1. I like the D&D style, at least as a start. There should be more consequenses for aimed attacks though. Imagine copping a huge hit on your arm, and having that arm break. Firstly ouch, and secondly how to react. Sword arm? Hide. Shield arm? Rig a splint, but still, fat chance of continuing the fight. Casting arm? Learn some Still Spells. Main thing is you’ll be alive but you’ll regret going from 40,000HP to 5HP and back again.

    I wish. Can’t see that working though. It will make group play much more important, and judging by WoW players these days not many have the patience to look after the infirm. *snigger*

    I also like the Operation Flashpoint way of coping with hits – one shot one kill. Or perhaps two or three shots if armed with an M16. When the same also applies to yourself, it makes sneakiness much more important. That kind of thing should be fine in a Kung Fu game. One chop one kill (or lacerated limbs etc) and lots of blood! I’m thinking along the lines of Thief (good game – fairly underrated – oldish but a goodie – but that’s my opinion).

  2. Funny, I was actually thinking about this aspect of combat mechanics the other day, specifically in terms of alternative methods for allowing “levelling” or improvement in the player’s abilities. Allowing the player to improve would suggest that it needs to increase either damage output or likelihood of increasing damage, or both.

    It also raises the issue of the player’s power curve if you allow continually improvement. Should the player ever be able to effortless defeat enemies? Should they be able to overcome a horde of enemies who individually cannot hit them but whom they can overpower without breaking a sweat?

    I’m actually a fan of variance (aka luck) in combat mechanics, even though potentially it can result in “unfair” situations because it means encounters won’t turn out exactly the same each time. Unless you’re operating a purely twitch-based combat mechanic where that is the primary focus of the gameplay, a lack of skill or keyboard/mouse/gamepad agility can stop the player’s progress and result in aggravation (though admittedly so can bad luck in a system involving random rolls). This isn’t to say that there should not be skill or challenge involved, far from it, but I think it comes down to determining what the focus of the gameplay is to be. For example, I can’t imagine minecraft would benefit from having difficult and involved combat mechanics, but Tekken would be pretty horrible if your punches occasionally just did more/less damage for no reason except pure luck.

    Gordo: Thief was/is a fantastic game and I’m certainly looking forward to the fourth installment in the series.

  3. @Gordo
    Part of the game design is making it fun for the players, so it really depends on whether it’s worth it to add in massive damage, crippling injuries or high degrees of danger. If you’re spending more time recovering and doing boring stuff rather than having fun adventures, then you may want to rethink your design.