April 29, 2024, 02:46:46 AM

Author Topic: Dice vs Armor table  (Read 30125 times)

ringkichard

  • Flightless Funpire
  • Playtester
  • Legendary Mage
  • *
  • Posts: 2564
  • Banana Stickers 18
  • Kich, if you prefer.
    • View Profile
Re: Dice vs Armor table
« Reply #30 on: February 23, 2014, 01:42:02 AM »
In libre, you've got to go Tools > Macros > Organize Macros > LibreOffice Basic  and then navigate the viewer to the creature evaluation .xlsm and work from there.
I can take the fun out of anything. It's true; here, look at this spreadsheet.

Aylin

  • Sr. Mage
  • ****
  • Posts: 494
  • Banana Stickers 4
    • View Profile
Re: Dice vs Armor table
« Reply #31 on: February 23, 2014, 04:12:38 AM »
@ringkichard

Thanks!

@fas723

I've never worked with Visual Basic before, but I think I was able to get the gist of your program. Pretty interesting, though I'd be especially interested in seeing how you delt with the rerolls. Please let me know when you get your code working properly and posted.

fas723

  • Sr. Mage
  • ****
  • Posts: 277
  • Banana Stickers 0
    • View Profile
Re: Dice vs Armor table
« Reply #32 on: February 24, 2014, 07:47:16 AM »
Okay, now I have gone through my code again. There are a few things that bugs me with this task.

First, my initial code had several errors. I had flipped constrains, looped within the wrong area and divided with the wrong probabilities. Hopefully I have it right this time.

Secondly however, I don't get my figures to match yours Aylin. I have tried to scratch my head why this is, but not come up with a good answer... Matter of fact is that we do we the same values but you have them for one Armor level higher then I have.

My approach has been to simulate all possible die rolls there is for each case (this worked out quite well for the standard table).  Generate the probability for each roll and add the results together. In the Akiro case I have done the same, but this time I made each possible roll twice. The first roll in each case is just as before, but I tracked each time the result was below the expected value. In the second roll I have simply added the probability for the first roll to fail.

First roll:
my = sum (p(x) * x(i)) over all possible rolls

where p(x) is the probability for roll i to occur and x(i) is the result of roll i.

Second roll:
my = sum (p(jj) * p(x) * x(i)) over all possible rerolls.

where p(jj) is the probability for the reroll to occur.


Maybe I have a brain freeze over here, but I can't get our numbers to match and I can't really think where mine went wrong this time... I need you to look at my figures / approach and see if / where it went wrong. Looking at your 1 die 1 Armor example Aylin my figures correspond while yours do not...

I have updated my table from before. Check there.

fas723

  • Sr. Mage
  • ****
  • Posts: 277
  • Banana Stickers 0
    • View Profile
Re: Dice vs Armor table
« Reply #33 on: February 24, 2014, 11:13:30 AM »
Short reflection (if my latest values are correct):

- Akiros favour becomes better and better the more dice you have.
- More armor reduces the efficiency of AF. Strangely in some cases when armor goes up the efficiency of AK goes up. I guess this is because the standard "my" falls over/under a integer between the two values and becomes more efficient. E.g 4 dice 0 Armor vs. 4 dice 1 Armor.
- It must also be the same reason why 3 dice 0 Armor is more efficient than 4 dice 0 Armor.

@Aylin
Were you able to reach the code now?

Aylin

  • Sr. Mage
  • ****
  • Posts: 494
  • Banana Stickers 4
    • View Profile
Re: Dice vs Armor table
« Reply #34 on: February 24, 2014, 06:03:01 PM »
@Aylin
Were you able to reach the code now?

Yes, though I won't be able to check it until Thursday evening due to some IRL stuff.

joechip90

  • New Mage
  • *
  • Posts: 27
  • Banana Stickers 2
    • View Profile
Calculating the probability of damage amounts
« Reply #35 on: May 15, 2014, 06:00:00 AM »
Dear All,

There has been a lot of talk on the forums lately about the relative merits of increasing the number of attack dice vs armour piercing against heavily armoured opponents.  A lot of people have been using a basic calculation of around 1 point of damage per attack dice but, of course, this becomes more complicated in the presence of armour.  More dice mean more chance of critical hits but armour piercing strikes will allow you to make the most of each dice.

Because I am a total geek, I realised that there was a way to calculate the probability of dealing a certain amount of damage for any given number of attack dice and the armour of the defender.  I have written a small script for the R statistical platform that will perform this calculation that I have posted here.  It defines a single function 'damageProbabilities' that takes three arguments:  the first is the number of attack dice, the second is the effective armour of the defender (basic armour minus piercing), and the final argument is some text denoting the type of damage (this defaults of "normal" for normal damage type but can also be "incorporeal" or "resilient" to calculate damage for defenders with these traits).

As an illustration of this script I have attached to this post the results of an analysis of two different attacks against an opponent with 3 armour: a 4-dice attack with +3 piercing and a 6-dice attack.  I ran this using the following calls of the 'damageProbabilities' function: damageProbabilities(4, 0, "normal") and damageProbabilities(6, 3, "normal").  The function will then provide the probability of dealing a certain amount of damage to the defender and the 'expected' amount of damage (which is sort of analogous to the mean amount of damage you'd expect from the attack, see information about expected values).  I have attached a figure with the probability mass distribution for the 4-dice +3 piercing attack given in red and the probability mass distribution for the 6-dice attack given in blue.  The expected damage for the two attacks is shown by the dotted lines in the corresponding colours.  You can see from this analysis that the expected damage for the 4-dice piercing attack is 4 whereas the expected damage for the 6-dice attack is only 3.74.  This means that if you're up against a knight of westlock with a timber wolf then you're much more likely to do more damage by casting 'piercing strike' (2 mana) than revealing a bear strength enchantment (3 mana + original casting cost).

Feel free to use the script how you like for lots of different types of attacks.  I can also post a description of the mathematics behind the calculation if people are interested.
Looking for an opponent in Bergen?  Check out my BGG profile and feel free to get in touch

fas723

  • Sr. Mage
  • ****
  • Posts: 277
  • Banana Stickers 0
    • View Profile
Re: Calculating the probability of damage amounts
« Reply #36 on: May 15, 2014, 09:10:36 AM »

joechip90

  • New Mage
  • *
  • Posts: 27
  • Banana Stickers 2
    • View Profile
Re: Calculating the probability of damage amounts
« Reply #37 on: May 15, 2014, 09:16:03 AM »
Ooh no maybe not...  Didn't see that post.  Thank you for the heads up.  I'll check my results against the table but from the first few lines it looks like we have exactly the same answers.
Looking for an opponent in Bergen?  Check out my BGG profile and feel free to get in touch

lettucemode

  • Guest
Re: Calculating the probability of damage amounts
« Reply #38 on: May 15, 2014, 09:20:06 AM »
You can see from this analysis that the expected damage for the 4-dice piercing attack is 4 whereas the expected damage for the 6-dice attack is only 3.74.

This is a cool find, thanks for sharing it. Now that I look at fas723's table again I see that it has the same information in there but I didn't notice it back then.

In your example, we can see that piercing is better than +2 dice, cool. But if you go down to a 2 dice attack with +3 piercing vs. 4 dice, both against 3 armor, the 4 dice comes out ahead.

A graph that shows when piercing is better than +2 dice for many combinations of dice and armor would be very helpful to this discussion. Tables of numbers are great but it can be hard to see patterns in them.
« Last Edit: May 15, 2014, 09:25:41 AM by lettucemode »

joechip90

  • New Mage
  • *
  • Posts: 27
  • Banana Stickers 2
    • View Profile
Re: Calculating the probability of damage amounts
« Reply #39 on: May 15, 2014, 10:17:52 AM »
I'm just trying to get a little app set up on my webpage that will allow people to put in any combination of piercing, armour, attack dice and defensive traits (such as 'incorporeal' and 'resilient') and then check out the probabilities of the different damage values themselves.  That should reduce the need to print out a series of tables that still won't cover some eventualities.

Hopefully I'll be able to report back soon with the functioning app.

EDIT:  In the meantime I've set up a webpage here where you can try out your own combinations without having to install any software.  Click the 'run code' button on the website and then simply type the following into the *bottom* console 'plotDamage(#attack dice, #net armour, #trait)' replacing '#attack dice' with the number of attack dice, '#net armour' with the amount of armour after piercing (i.e. base armour - piercing) and '#trait' with either the value "normal" (include quotation marks) for standard damage calculation, "incorporeal" for damage to incorporeal creatures, and "resilient" for resilient creatures.  It will produce a graph of the probabilities of the damage in the top-right corner and then display the expected damage and the probabilities in the console.  I'll try a more elegant solution soon but this should be a fix in the meantime.

EDIT:  I've coded up a much better solution that can be found >>here<<.  It is a simple webform where you can simply put in the relevant attacker and defender information and click 'calculate'.
« Last Edit: June 09, 2014, 04:36:04 AM by joechip90 »
Looking for an opponent in Bergen?  Check out my BGG profile and feel free to get in touch

Shad0w

  • Playtester
  • Legendary Mage
  • *
  • Posts: 2934
  • Banana Stickers 0
    • View Profile
Re: Calculating the probability of damage amounts
« Reply #40 on: May 15, 2014, 01:04:37 PM »
"Darth come prove to meet you are worthy of the fighting for your school in the arena and not just another scholar to be discarded like an worn out rag doll"


Quote: Shad0w the Arcmage

sIKE

  • Playtester
  • Legendary Mage
  • *
  • Posts: 4172
  • Banana Stickers 18
  • Ugh
    • View Profile
Re: Calculating the probability of damage amounts
« Reply #41 on: May 15, 2014, 01:40:26 PM »
  • Favourite Mage: Malakai Priest

Wise fool

  • Jr. Mage
  • **
  • Posts: 52
  • Banana Stickers 0
    • View Profile
Re: Dice vs Armor table
« Reply #42 on: May 15, 2014, 03:00:59 PM »
Cross the streams?

Shad0w

  • Playtester
  • Legendary Mage
  • *
  • Posts: 2934
  • Banana Stickers 0
    • View Profile
Re: Calculating the probability of damage amounts
« Reply #43 on: May 16, 2014, 04:31:09 PM »
Any different from this?
http://forum.arcanewonders.com/index.php?topic=13562.0

I am merging the threads  8)
You are going to make Gozer mad


Does not matter same / similar topics get merged to lower forum clutter
"Darth come prove to meet you are worthy of the fighting for your school in the arena and not just another scholar to be discarded like an worn out rag doll"


Quote: Shad0w the Arcmage

joechip90

  • New Mage
  • *
  • Posts: 27
  • Banana Stickers 2
    • View Profile
Re: Dice vs Armor table
« Reply #44 on: June 08, 2014, 08:34:44 PM »
Apologies in resurrecting this thread but I have finally got a little web programming side-project finished that allows anyone to calculate the probabilities of dealing different amounts of damage in various different circumstances.  This is much cleaner than my previous interim attempt and instead implements everything within a standard webform.  You simply put in your basic melee attack dice number along with any modifiers (such as attack bonuses and multiple attacks) and the armour/traits of the defending creature, press 'calculate', and you are given a table of damage probabilities.  The output damage table show the probability of scoring a particular amount of damage but also the probability of scoring at least a certain amount of damage: allowing you to work out if it is probable that you next attack with kill a creature or whether it is worth doing an Akiro's favour attack die re-roll.

I've sorted the algorithm so that it now applies +melee modifiers correctly when making multiple attacks (i.e. only applying them for the first attack).  I've also added some code for incorporating the effect of veteran's belt, resilient and incorporeal defensive traits.  If anyone is interested in the mathematics behind it then I'd be happy to post that somewhere (it involves generating functions and polynomial rings).

The webform can be found >>here<<.  It probably could do with being made to look a little prettier but hopefully the functionality is all there.  Feel free to try it out and let me know if you spot any errors.
Looking for an opponent in Bergen?  Check out my BGG profile and feel free to get in touch