219 Open Daily games
2 Open Realtime games
    Pages:   1   (1 in total)
  1. #1 / 5
    They see me rollin' IRoll11s
    Rank
    Private
    Rank Posn
    #1534
    Join Date
    Nov 09
    Location
    Posts
    632

    So when I originally did the History stat tab for the WF script, I was stymied by my inability to find the odds for non-standard dice rolls.  Every mention I could find online for the regular 6-sided dice odds either did not give the algorithm used to determine them or were blatantly brute-force methods.

    Some discussions or scripts I found dealt with probabilities of taking over a country with the standard dice... how many you would need to have a 50% chance of capturing a territory with 20 defenders, for instance.

    The websites I did find that dealt with dice modifiers were simulation based and not deterministic, and would return a probability curve of how many armies you would lose on X rolls.

    Last week I decided to figure it out for myself.  After 3 days of digging myself deeper into a rabbit hole of Markov chains, ! notation and increasingly esoteric mathematical insanity I almost had an aneurysm.

    Then I did something I haven't done in about 15 years, picked up a few pieces of paper and pencil and started writing stuff down.  I know, how 20th century!  In any case it took me about 3 hours until I finally noticed the patterns involved, and about 2 hours to write a script.

    Here is the output for 1 to 20 sided dice where attacker and defender are both using the same number of sides.  It is not limited to this and will happily calculate three 12 sided dice vs. two 7 sided dice, for instance.  The numbers are exact and not approximations.  The best part is that it runs in O(n) time, where n is the product of the number of sides.*

    The table shows the expected number of losses for 100 rolls.  I forgot to add the Attacker and Defender headings... first column under each vs. heading is attacker and second is defender.

    I will release the script in some format so that mapmakers can get a better idea of what odds are involved in choosing dice modifiers.

    probabilities.png

     

    * If you don't understand that don't worry, I don't fully understand big O notation either.


  2. #2 / 5
    Moderator...ish. Cramchakle
    Rank
    Private
    Rank Posn
    #3022
    Join Date
    Nov 09
    Location
    Posts
    1182

    http://forums.warfish.net/viewtopic.php?f=6&t=494

    For those not in the know, Reich there is me here. Anyway, Hugh pwned my understanding of math in this thread, but it's nicely related to your work here, Rolls.

    Edited Sun 22nd Nov 12:51 [history]

  3. #3 / 5
    They see me rollin' IRoll11s
    Rank
    Private
    Rank Posn
    #1534
    Join Date
    Nov 09
    Location
    Posts
    632

    The .pdf paper linked from that thread is one of those examples of aneurysm inducing terminology. Although the 5 equations on page 3 are the same ones I wound up using in my script, just without the fancy sub-super-script vector nonsense. The relevant ones being 3j-2 and 6j-3. He mentions you can get those through 'straightforward techniques of enumeration.' I wonder if that is fancy math term for writing shit down and counting it out?

    I'm also fairly sure I avoided 'Tan's Mistake' as referenced in the paper.


  4. #4 / 5
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Very nice. I tried to figure a formula for that, but instead ended up doing it brute force. Well actually I made the computer do it brute force for me. I have that brute force calculator along with a simulator at:
    http://prestopnik.com/warfish/

    The calculator (right side) lets you set dice sides for offense and defense separately, and gives a couple other useful #s in addition to the ones in your table. The simulator (left side) is one I have mentioned on the warfish forums before, but it's had a couple bugs removed since then.

    Even brute force it is reasonably fast - d16 vs. d16 takes about 20 seconds (on chrome on my computer), smaller dice are much faster. IE reputedly has a very slow javascript engine, so it might be quite a bit slower.

    Edited Sun 22nd Nov 21:08 [history]

  5. #5 / 5
    Standard Member Hugh
    Rank
    Lieutenant General
    Rank Posn
    #12
    Join Date
    Nov 09
    Location
    Posts
    869

    Very nice Iroll11s! (I just noticed this thread)


You need to log in to reply to this thread   Login | Join
 
Pages:   1   (1 in total)