On attack/defence Probability distributions

Having just acquired the Elemental Beta yesterday, I have been reading the beta forums.

I noticed that it seems that Stardock is planning to use a system where attack and defense rolls are a single randomly generated number between 0 and the attack rating, with every number having an equal chance.

I don't really like that system, since it is too random: You would need absolutely ludicrous amounts of defense for a powerful creature to be able to withstand to a horde of lesser ones. Brad proposed the idea of having a minimum roll of Defense/10 for defense, but that seems rather arbitrary to me, since that means a single point of extra defense could be the difference between tough and absolutely invulnerable.

I propose a more bell-shaped distribution for attack/defense rolls, instead of such arbitrary minimum rolls, similar to how master of magic did it. If you have, for example, a single defense roll for every point of defense you have, with each roll having a chance to block a single point of damage/attack, you naturally get that powerful creatures are almost impossible to harm with weak attacks, without making them too strong against normal ones. Since probabilities lower, but never get to zero, large armies of weak troops can still be a threat to a strong unique creature, without them killing it instantly.

If you have an army of a thousand archers, and an even distribution of defense/attack rolls is used, the average damage of a single archer would be very difficult to get below, say .05 per volley. That would be the equivalent of 1 attack versus 9 defense. With a thousand archers, you would still get 50 damage per volley. That means the target is killed very quickly, unless he has thousands of hitpoints/strength.

But if you use the minimum system, a single extra defense point would make it invulnerable, which is too big a change for such a small stat difference. Without a minimum defense roll, to get the damage down to a survivable, say, 5 per volley for this tough monster against the weakest archers imaginable, you would need 99 defense, which is ridiculous.

If you however, use a system of 1 roll per point of attack/defense, with each roll having a 50% chance of adding one to the total, the same monster needs a mere 7 defense in order to reduce the average damage of a single volley to 4. 8 defense, would halve that to 2, 9 halve that to 1. 2 attack versus that same 7 defense would result in 20 damage per volley however, a great improvement. That may be too steep a distribution, since it can quickly make a unit with a lot of defense very tough to harm, but this type of distribution is still, I think, a good idea. A better one than an arbitrary minimum roll I think.

 

 

29,560 views 38 replies
Reply #1 Top

I've tried for distributions for weapons, but it seems like the consensus thinks they should work on other things.  I strongly believe this is the way to go.  Or maybe they are going to implement something similar.

I thought instead of using a pure rand() statement, get rnorm(),rpoisson(),rnegbin() (normal, poisson and negative binomial) and such as few examples of different damage distributions that could be used.

 

When I look at GalCiv2, I practically never made shields on my ships because it was a pure random roll on the defense.   Say I had a defense value of 5 or something,  in a pure random setting I can roll a 0,1,2,3,4, or 5 with equal probabilities.

If it was a bell shaped it may looks something like this as an example  (in a discrete way):

10% for a 0

15% for a 1 

25% for a 2

25% for a 3

15% for a 4

10% for a 5

 

Comparision:  Pure random, I don't know what the hell I'm going to get, but in the example, at least I know it is probably not going to be a 0 and a 5.  It doesn't seem that significant in this example since i'm only using 6 values,  but using at least a normal curve system would be great.

Here are the comments I made:

https://forums.elementalgame.com/362428

Reply #2 Top

I'm not really sure which way I go on this. There is certainly a strong case to be made here. I had an example in another thread of some combat with straight random rolls, and it showed how wildly things could fluctuate.

It's not so bad with small numbers (ATT 2 DEF 1 for example isn't going to have a wide variation in results), but on units with bigger numbers (ATT 9 DEF 9) you'll see wild fluctuations in damage from hit to hit (anywhere from 0 to 9). When a unit only has 10 HP base, you're looking at going from 0 damage to near death blows.

On the other hand when the numbers use a more normal distribution, you'll see a lot of fights that consist of trading hits back and forth several times for small damage numbers until someone falls over, which might not be as entertaining.

Reply #3 Top

It's probably easy to replace one roll (0-attack) vs. (0-defense) by 2 (or even 3) rolls in the same range. This gets you a bell curve without requiring tens of dice rolls. The 2 rolls is particularly nice since on average you get your attack defense value.

Reply #4 Top

Trading hits back and forth has less to do with the random distribution, but more with the amount of hitpoints/strength troops have. Lots of hitpoints/strength will result in troops hitting eachother until one dies, very few will result in short brutal combat.

The distribution is more about the effect and reliability of differences between attack and defence.

 

Reply #5 Top

It's probably easy to replace one roll (0-attack) vs. (0-defense) by 2 (or even 3) rolls in the same range. This gets you a bell curve without requiring tens of dice rolls. The 2 rolls is particularly nice since on average you get your attack defense value.
End of quote

No, I don't think that will get the desired effect. Let's say you use the two roll system:

Again, we have 1000 archers, with 1 attack. With a 2 roll system, the 9 defense monster will take on average 14 damage per salvo.

Let's say this is too much, and we want a survivable 5 damage per salvo. The monster needs 15 defense for that. But what if we face 10000 archers, how many defence do we need to reduce the damage of that salvo to 5?

50 Defense. The creature would need 50 defense. As you can see, with the two roll system having nigh immunity against worthless troops is also nigh-impossible. And we want that behaviour. Which is why Brad proposed the minimum damage system.

In the as many dice as attack/defense system, if you face 10.000 archers instead of 1000 with 1 attack each, you would need about 10 defense instead of 7. Which makes nigh-invulnerability against weak troops possible.

 

 

Reply #6 Top

If you're using say ATT 10 DEF 9 units, when the rolls are using a more normal distribution what you're going to see is more cases where the numbers are similar, which means 1 damage in this case. With wider variation in the rolls, you'll see more zeros (anytime DEF roll > ATT roll) and more 10 damage turns (since the only case this can happen is when ATT roll = 10 and DEF roll = 0, it's really unlikely on a normal distribution).

I'm still on the fence as to if thats a good thing or not.

Reply #7 Top

perhaps soldiers, dragons, n soveriegn could use bell-curve, while heroes and adventurers use flat-random? (or weighted towards maximums)

Reply #8 Top

Tatertot, isn't the appropriate time to use a poission distribution when the event relates to TIME or SPACE (as in location)?  This might not be the case in attack/defense rolls, so perhaps the poission should be taken out of the discussion.

Reply #9 Top

If you're using say ATT 10 DEF 9 units, when the rolls are using a more normal distribution what you're going to see is more cases where the numbers are similar, which means 1 damage in this case. With wider variation in the rolls, you'll see more zeros and a lot more 10 damage turns.
End of quote

The amount of zeros you will see in both systems are approximately the same: 50%. While the average damage in the lots-of-dice system will be about 1, you will also see 2 and 3 damage quite a bit. Higher than that will indeed be unlikely.

What I like about such a system, is that every extra point of defense is significant. If you get 1 extra defense, increasing it to 10, the average damage 10 ATT will do will go from 1.1 to 0.8, a significant decrease. 11 defense, 0.68 damage average. Each point is a significant help. With the flat system, or static amount of dice system, every extra point of defense will help less and less, until you needs an insane amount of defense to reduce damage taken by a tiny bit:

With the flat system, no minimum, 10 ATTACK:

9 DEF -> 2 DAM, 10 DEF -> 1.8 DAM, 11 DEF -> 1.66 DAM, 12 DEF -> 1.54 DAM, 13 DEF -> 1.43 DAM, 14 DEF -> 1.33 DAM, 15 DEF -> 1.25 DAM, 20 DEF -> 1 DAM, 40 DEF -> 0.5 DAM, 100 DEF -> 0.2 DAM.

AS you can see, defense helps, but every extra point becomes more and more insignificant.

 

 

 

Reply #10 Top

Quoting cleflar, reply 8
Tatertot, isn't the appropriate time to use a poission distribution when the event relates to TIME or SPACE (as in location)?  This might not be the case in attack/defense rolls, so perhaps the poission should be taken out of the discussion.
End of cleflar's quote

 In real life it is hard to model behaviors with a Poisson, because such few things actually follow the distribution.  Most likely if you were planning to use a passion to to model an effect or behavior, the negative binomial will produce a better fit model.  

For this discussion, It really doesn't matter where these distributions are suppose to be used, because we are not trying to explain anything.  We would just use it as a way to distribute the damage itself. 

There are tons of distributions, each with an equation, but more importantly a mean and variance that distinguish one from another.

For those of you who have not seen any of these distributions, this is what they would look like.

For the system as it stands, it is a uniform distribution:

 

 

So here is an example of normal distribution:

 

Poisson (Notice how as the mean gets larger it starts to resemble a normal bell curve): 

 

Negative Binomial:  (Looks the same as a Poisson right?  It is very much different in discribing the variablity of whatever we are interested in, in this case damage generation). 

 

There are many more which can be used Chi-squared, Gamma, whatever...

 

Again these are merely ideas, I'm buying the game regardless, because it is going to be sweet, the question is do you want to damage distributions to look like the uniform distribution

 

Reply #11 Top

A reasonably simple system that would still allow more variation might use something like two six-sided dice.  Rolling these dice would allow a range of outcomes from 2 to 12 with the probability of the outcomes being a bell curve.  Three or more dice would give the same curve, of course, with a greater range and standard deviation.

If a high roll provided more damage and a low roll less damage, the attributes of the weapons and armor could be expressed as an addition to or subtraction from the dice roll.  Leather armor might provide a -1, improved leather a -1.5, chain -2, plate -3 and so forth.  A simple sword a +1, a high temper steel sword a +2, an expeirenced unit might get a +.5 on attack and a -.5 on defence (with more on higher levels of experience). 

The earlier discussion of more experienced units having more hit points (rather than a modifier in my example here) really would work out to the same result.  The more experienced unit would fare better in combat.  It would have more opportunities to benefit from healing magic.

I strongly suspect that our game developers are experts in these things and will come out with a very good workable system.

Reply #12 Top

Well, having a negative Binomial would probably lend the "randomness" of the game to be more architectured into being parts of strategic and tactical probability. Now, HP will already do much of that, although I think having a distribution (like neg Binomial) would also lend strategic probability to the aquisition of better weapons and armor, instead of simply numbers and HP.

In the end I think a bell-curved system would prove to balance equipment specialization with numbers/HP specialization

Reply #13 Top

I am still confused quote"Having just acquired the Elemental Beta yesterday, " I pre-ordered on Oct 18, Pre-order page still says not avaible till after the Fall. Am I missing something? Enabled all demos and Pre releases and still no love. What hoops do I have to jump through to get in on the Beta?
 

 

 

 

Reply #14 Top

The next beta does not come out until around Christmas, which is what I hear (maybe mid-December)

Reply #15 Top

Quoting jeffaflord, reply 13
I am still confused quote"Having just acquired the Elemental Beta yesterday, " I pre-ordered on Oct 18, Pre-order page still says not avaible till after the Fall. Am I missing something? Enabled all demos and Pre releases and still no love. What hoops do I have to jump through to get in on the Beta?
 
End of jeffaflord's quote

Most likely Climber pre-regged back in the summer and just didn't download it until yesterday. Beta access is currently closed, it'll re-open before Christmas according to the most recent info. You'll be able to download it then. :)

 

(Believe us, you're not missing a lot right now.)

Reply #16 Top

Quoting jeffaflord, reply 13
I am still confused quote"Having just acquired the Elemental Beta yesterday, " I pre-ordered on Oct 18, Pre-order page still says not avaible till after the Fall. Am I missing something? Enabled all demos and Pre releases and still no love. What hoops do I have to jump through to get in on the Beta?
 
End of jeffaflord's quote

No, you are not missing something. I acquired the game/beta through special circumstances, not through pre-order.

Reply #17 Top

Thanks for the clarification, Thought I overlooked a radio button or just failed to read some fine print somewhere.

Reply #18 Top

I am thinking you are right Tridus, looking through the post on this thread alone. String Bubble contengent theory is less complex, still I do like complex problems and am kicking my self for not preordering in Sept.With any luck this game will break the foundation of deep games and save PC gaming. I for one am sick of FPS based PC games and think theyneed to be left to platform systems. I still love My Fallout 3 and Half Life though!

Reply #19 Top

The problem of 1000 archers rolling vs. A 9 defense means you're rolling 10 rolls  for each shot. That's going to be 10000 rolls. I think reducing the numbber of rolls will be important in terms of performance, but that's a totally wild guess.

Another option to get bell-curves while retaining flat randoms is to just put the bell somewhere else: Square the defense and attack: A 1 attack vs. 9 defense would actually be 1 vs 81. This makes extra defense points much better than early defense points without requiring a quadratic number of rolls.

Reply #20 Top

The number of rolls is hardly an issue. As a test, I made a single-threaded c# application. 1 billion dice rolls took 24 seconds.

So those 10 thousand rolls will take .24 milliseconds. Hardly excessive. You must not forget computers are fast nowadays.

 

Reply #21 Top

The currently proposed attack/defense certainly seems quite clunky. When things make huge jumps for a single stat point, you start playing a game of maths with your battles (i.e. tuning everything around these important discontinunities in the statistics) than just playing the game.

 

At this point I'd be inclined to survey how other games do it (AoW, Civ, HoMM, etc.) and borrow or modify the mechanics to taste.

Reply #22 Top

How other games do it?

Master of magic used the one-dice for every point of attack/defense I described.

Age of wonders used an difference between attack/defense determines to hit chance, damage stat determines damage system, with damage being a separate roll.

Civilization is hardly relevant, being a game without tactical combat.

Heroes of might and magic gave every unit a damage interval, with the difference between attack and defense giving a (capped) percentage bonus/malus on the rolled damage.

In the age of wonders system, monsters could not become as powerful as some are supposed to be in Elemental, since there could be at most 8 soldiers in a stack.

In the Heroes of might and magic system, units always did damage, so powerful monsters only win due to having huge amounts of hitpoints, and killing lots of fodder per attack.

 

Reply #23 Top

I'd like to mention that Age of Wonder's system did not work well at all, and made the combat frustrating.  And as mentioned above, Gal Civ II's system (which was somewhat similar) also did not work well, such that giving ships more than one point of defense was usually pointless.  I really hope the attack/defense formulas are moddable, because I fear that they will be the simple flat distributions that I don't like.

Rather than statistical distributions with fancy names, I think dice are good, since most people can understand them, yet they're powerful enough to do most of what is needed.  For example, the sum of two (or more) dice gives a roughly bell-shaped distribution.  Dominions' formulas worked quite well and I think would adapt nicely to Elemental - those typically involved rolling two pairs of 6-sided dice, open-ended (meaning that rolling a 6 allows you to re-roll and accumulate).

An attack basically works like this:

Attacker: Attack 10, strength 12.

Defender: Defense 11, protection 7.

The attack hits if ((attack + 2d6) > (defense + 2d6)), which has a probability of around 45%.

The damage dealt is ((strength + 2d6) - (protection + 2d6)), which averages to 5.57 expected.

(I got those numbers from the tables here: http://forum.shrapnelgames.com/showthread.php?t=17160)

 

As protection (armor) and/or defense (dodge) increase, the expected damage taken drops very rapidly, since the distributions are bell-shaped.  But because of the open-ended rolls, it's always theoretically possible for anything to hit, and even brutalize, anything else - and similarly, always possible for an ancient dragon-god to attack a sleeping, crippled peasant and miss or leave him unhurt (perhaps the dragon got a leaf in his eye at the wrong time).  But this sort of thing would be extremely rare, rather than very common as it would be with a flat distribution.  The disadvantage of this system is that you can't calculate things in your head easily.  But people who actually care about the underlying formulas probably would not be scared of consulting tables, anyway.

Master of Magic's approach is also fine, though it does not make a distinction between absorbtion and evasion.  Regardless of that, it WORKED, which is important.  However, it's even harder to calculate in your head.

Bottom line - if the combat formulas are moddable, and the UI allows room for additional stats on units and items, then I'll rework the formulas and numbers to make them fun and balanced, whether they are initially or not.  If these modding capabilities are not present, then I'll just hope that the team uses a better combat model than in GalCiv II.

Reply #24 Top

Good post SaberCherry! :thumbsup:

Reply #25 Top

I have always preferred the linear probability models for combat, because combat is where crazy and unlikely stuff should happen. Having played with both GURPS (3d6) and DnD (d20) quite a bit, I can say that the d20 model makes for much more satisfying combat and the 3d6 model is just far too consistant.