ID:121284
 
Keywords: cbd, combat, design
We're going to start with a slightly different approach than most of you have probably taken... we're not going to start with any attributes! No weapons! No armor! Flat rates for everything, no modifiers or nuffin'. Creatures will have health, and in combat, they will do a flat amount of damage, at a flat rate of attack.

Before we even decide what we want these numbers to be, I'm going to decide something else. I want combat to last only 10 seconds. So two creatures, completely equal, will kill one another in 10 seconds flat.

So, now that we have that single parameter, let's get some figures to use. If we assume mobs have 100 health, there are only so many formulas we can use to ensure combat ends in 10 seconds. We could do 10 hits/second for 1 damage, 5 hits/second for 2 damage, 1 hit/second for 10 damage, 0.5 hits/second (1 hit every 2 seconds) for 20 damage, and so on. In the interest of simplicity, we're going to use 1 hit per second, 10 damage a hit. Simple, no? I think everyone can follow this.

So now, considering we have designed all of the elements that go into combat, combat should always, always look something like this:

Mob A attacks Mob B for 10 damage.
Mob B attacks Mob A for 10 damage.
...1 second...
Mob A attacks Mob B for 10 damage.
Mob B attacks Mob A for 10 damage.
...1 second...
[repeat 8 more times]
Mob A kills Mob B!

Wallah. We have our basic combat with no attributes. It works perfectly according to plan -- combat ends in 10 seconds (that's my story and I'm sticking to it), and nothing ever happens that we can't really predict.

Some smarty pants might have noticed that this isn't actually 10 seconds. It's 9 seconds. Or maybe more accurately, 9.001~ seconds. Basically, only 9 delays occur (only 9 delays have a chance to occur), but 10 attacks occur. This is because we are attacking at the instant a second begins.

To demonstrate this point, here's a pretty awesome graph:

Basically, the problem is that we are attacking before a second actually passes. Because of this, we are attacking, essentially, twice within a second. If you start counting from 0, we are attacking at the first instant of 0, and the first instant of of 1. The difference between the exact instance 0 ends and the exact instance 1 begins is something you can't really differentiate, so we can call it something like two hits per 1.001~ seconds.

This will even out exactly every time a second ends. It's something that is unavoidable. So for the sake of consistency in this text, we're going to ignore this fact, and say 10 hits with a 1 second delay is 10 seconds. We'll just secretly count out the rest of the second in our heads, so combat never ends at 9.001~ seconds, only 10.


Now let's start adding attributes that tweak the mechanics a bit. Not too much, just a bit. For starters, let's add a strength attribute. One point in our strength attribute accounts for 2 damage for our attacks. Therefore, everyone starts with 5 strength, to make it consistent with our system. On top of that, let's add vitality, which will give us 20 health per point. If you noticed the pattern, that means we're going to start with 5 vitality, to remain consistent with our combat mockup.

So now all mobs start with 5 strength -> 10 damage, and 5 vitality -> 100 health. With our system in play, we can safely say every point of strength decreases combat length by 20%-ish, and that every point of vitality increases the length of combat by 20%-ish. With this system in play, you can pretty much just compare two fighter's attributes, and we know how long a fight will last, and who will win depending on who hits first (sometimes not at all depending on who hits first).

Here are some simulations:


If you want to run a few simulations yourself, it's not too hard. You can grab the snippets from the previous entry, make a little combat loop that makes two mobs attack, based on our rules, with the proper delays. See if you can accurately predict the outcomes.
I really enjoyed reading this, even if it didn't serve that much of a purpose.
Please make more of these posts.
Hopefully it helps some "game designers" determine why their combat isn't what they want it to be and help them understand how they can make it so.

Mostly I just wanted to talk about it and get other people's ideas on it. :)
@Keeth: Yeah, I really like it!
Minimalist design is the best design in my opinion. Keep it up! (:
Very simple, very easy, very cool of you Keeth. I liked how simple the article was so it was easy to breeze through it. Neat to see someone contributing to help others, keep it up!