Frood AACalc Dicey / Sim / Odds Calculator: Updates and Opinions

  • '18 '17 '16 '11 Moderator

    Well, FROOD’s sending emails again.  Just hit submit 14 times and got 14 submissions to both of my inboxes. (Not good for JSP, all of them were 12-18 hits, with 4 of them at 17 hits!)

  • 2007 AAR League

    @newpaintbrush:

    @frood:

    There’s a considerable difficulty in displaying most likely COMBINED results as you are suggesting, especially in a large battle such as you describe. Each side has about 50 units, and it is reasonable that each side might survive with as many as 25 units … wait - I was going to say that you then have a possibility of 25*25 total possible outcomes,

    Haha!  I wrote an analytic calculator once that DID break down the values.  But it always crashed my browser whenever I used it for more than fifteen units because it had to do so many calculations!  Although I think I know a way to fix that nowadays.

    It isn’t 25*25 total possible outcomes with a 50 on 50 battle.  Depending on attack or retreat, it’s clearly 2^100, even if the odds for either extreme are astronomically low.  25 * 25 is only 625 outcomes.  2^100 is 1,267,650,600,228,229,401,496,703,205,376 outcomes.

    I have to wonder just what sort of “logic” your dice roller program uses . . . maybe you should stick the code on here and let us have a look-see.

    Whadjoo use to make that webpage anyways?  Quark or somethin?  All that funny formatting in the HTML . . .

    I have to say I don’t much care for your tone. It sounds like you’re slagging my math, my logic, and my HTML code. But because I’m the patient sort, I’ll respond politely, even if my flame finger is feeling itchy. I want this thread to be for improving the sim, not for flame wars.

    In terms of “logic” that my dice roller uses: it rolls the results of a battle thousands of times and tracks how often each side survives with a different number of units. It is not an analytic calculator. It gets used about 10,000 times a month and only very occasionally do I get an e-mail from someone saying the results don’t seem right. That hasn’t happened in a while. So no, you don’t get to see my source code, at least not if you can’t ask nicely.

    I think you might be stretching it with 2^100, and saying that this is “clearly” so just sounds pretentious. It sounds like anyone who can’t see that must be a cretin.

    At least without retreats, there is a range of results of maximum 100 possible outcomes, where one or both players by definition will have 0 units surviving. Allowing for retreats probably increases this by a few orders of magnitude, but not to 2^100. The possible results are limited by the order of loss and other aspects of the game mechanics. In any case, since the sim works by actually rolling the results randomly many times over, I only care about the results that happen at least once every 10,000 battles, and I can limit the display to only show results that have a significant probability. No one needs to know about a possible outcome that only happens once in 2^100 or whatever, or even only 1 in 10,000.

    As for the HTML source, I am not some quarkhead or frontpage newbie. It’s all hand-coded, and the “funny formatting” you refer to is called inline styles. Usually I control all the style with a separate stylesheet, but because the results also get e-mailed, I have to stick them in-line. Since the source is generated by a PHP script, inline styles are less of a disadvantage, because there is still a single point of control in the PHP script. Or if you mean the way the HTML itself is formatted, that’s because it is generated by a PHP script and indentation etc. is not an issue for me in the final page that is built, since I do my debugging at the PHP level.

    If you weren’t being rude, sorry if I misunderstood. You have to be careful online :)

  • 2007 AAR League

    @Jennifer:

    Actually, I was thinking since you give the amount of money lost, it might be possible to just say:  If you attack with 9 Infantry you’ll probably kill 2 infantry and loose 1 infantry to return fire.

    (LL would say 1.5 kills, rounded up to 2 hits; 0.67 kills, rounded up to 1 hits.)

    Also, I noticed that if you hit a 1 round only 5000 attempt simulation (you attack for 1 round, but it computes 5000 attempts at the same round) it doesn’t give you even an average monetary loss.  Maybe I’m just blind.  /shrug.

    Heard a complaint that it’s not emailing results anymore.  Tested a couple of tries to my own inbox, havn’t gotten results yet.  Maybe just a slow server?

    Must have been a slow server - I didn’t fix anything.

    Did you do the 5000x simulation with “No Luck” mode? Because it should show the averages just as normal.

    Switch and Jennifer, are you suggesting just stating in one line what the most likely result for the attacker is, the most likely result for the defender, and the amount they survive with and lose in that case?

  • '18 '17 '16 '11 Moderator

    It’s okay, Dan.  It was a very touchy battle that could have gone either way on round 1 and then suddenly we had no email confirmations!  Luckily I had the page still up to save time so I got a screenshot of it for confirmation, whew…

    Yes, what I am asking for is:

    Attacker attacked with X units
    Attacker remains with Y units

    Defender started with X units
    Defender remains with Y units

    Currently you show a bar graph of IPC value in attack and what’s left after the battle.  Instead of the IPC value (I think it’s IPC, maybe it’s punch, didn’t really look at it very hard) a graph for each unit and how many are left would be better, IMHO.  (Light gray for starting overlaid by dark grey for remaining would be fine.)

    After all, from that, we can determine the cash lost. (Your program rounds to the nearest decimal anyway, and since you can’t have 0.8 IPCs, you have to round anyway.  And what if that’s 0.8 of 1 infantry?  that’s really 3 IPC since you either have it or you don’t, right?)


  • @frood:

    Switch and Jennifer, are you suggesting just stating in one line what the most likely result for the attacker is, the most likely result for the defender, and the amount they survive with and lose in that case?

    Yes, IN ADDITION to the full readout.

    Just a seperate line as “Median Result” with the pecentage center result from the detailed breakdown of potential results.

  • '18 '17 '16 '11 Moderator

    I concur.  Keep the full readout.  But a listing of most likely units left vs units you started with would be greatly appreciated.


  • Even if it is just highlighting the median entry in the full table would be fine!


  • @frood:

    I have to say I don’t much care for your tone. It sounds like you’re slagging my math, my logic, and my HTML code . . .

    If you weren’t being rude, sorry if I misunderstood. You have to be careful online :)

    Seriously, who gives a damn what a crack pipe smoking owl thinks?  Unless it’s Bucky the Katt.

    ZOMG, you said I was “stretching it” with 2^100.  I don’t think I care for YOUR tone.  It sounds like you’re slagging my, um, crack pipe!  God, I shall never forget this, um, dire insult.  And if you reread your post, saying that I’m pretentious and calling people cretins, it sounds like you were real pissed.  Lawl.  So shoot me, my bad.  I am unintentionally rude a fair amount of the time, and if you take offense, that’s a shame.

    I would apologize, but I don’t think I shall after reading your edited reply.

    We can both just call it a day.

    BTW, if you have, say, an infantry and an artillery attacking a tank, here are your possible outcomes after 1 round:

    IL, AL, TL (infantry live, artillery live, tank live)
    IL, AL, TD
    IL, AD, TL
    IL, AD, TD
    ID, AL, TL
    ID, AL, TD
    ID, AD, TL
    ID, AD, TD

    That’s 2^3, or 8 results.

    Now, it’s true that usually you’re not going to kill off the artillery before the infantry, but that only adds to the complexity of the computer calculation.  And after you stick in things like retreats and playing until one side is deceased, the program becomes even more interesting to program.  But whatevs.

  • 2007 AAR League

    paintbrush - sounds like I took you a little too seriously. never mind.

    Okay, I’ve posted a beta to test at http://frood.net/aaa/ - this has highlighting on the results that are closest to the calculated average, and added to each line is a list of the units that have been lost.

    I made some changes to the overall code that I think increases the speed of the script by about 20%. Not much, but what the heck. Because of this though there may be glitches. I’d appreciate some beta testing so I don’t launch the update on the main site and then find out that suddenly subs are hitting aircraft or whatever.


  • A couple of clitches in the highlight coding…

    I ran a test battle with 10 INF, 2 ART, 8 ARM, 4 FIGs and a BOM against 16 INF, 5 ARM, 2 FIGs.

    The defender was 76% likely to have no units left, thus the median result should have highlighted this line.  It did not, it highlighted 1 line above it: 1 FIG surviving.

  • 2007 AAR League

    Switch, that glitch is intentional. I’m highlighting the average result, not the most common result. Two reasons: the most common result can be quickly identified visually because it has the longest bar graph bar. Second, the average is a better indication of what result to expect on the whole. Because the overall percentages given in the first chart describe the average outcome, and Jennifer was asking what those 24.3 units meant, ie. how can you have .3 of a tank, highlighting that line makes it a good reference point for understanding the overall results shown at the top.

    I’ve updated the beta at http://www.frood.net/aaa/ with some more enhancements to the output. It now lists the units lost by each side as well as the IPC value of those units, which makes it easy to see the relative losses and costs to be expected by either side.

    I’m now leaning away from doing combined results, eg:
    2.4% Attacker with X units and Defender with Y units
    1.8% Attacker with X and Defender with Z
    3.3% Attacker with W and Defender with Y
    0.7% Attacker with W and Defender with Z  etc.

    Ultimately I think that’s harder to understand, and in any case, if you are doing battle to the death, you can assume that the 16% of the time that you survive with X units the Defender has lost all their units.

    I’m going to do a bit more testing with the different kinds of combat to make sure I haven’t broken anything, and then I’ll launch this on the main site later tonight.


  • The MEDIAN result would be the best to highlight.

    And in the example I posted, the 50% line is still inside that 76% ‘no units’ line.

    That was all I was pointing out…

  • 2007 AAR League

    Okay, I get it now. I can highlight both and keep everyone happy!


  • LOL, fair enough :-)

    And thanks for working with us.

    Your dice program has been WELL worth my investment in it :-D

  • '18 '17 '16 '11 Moderator

    Ditto on my end.

  • 2007 AAR League

    Okay, I’ve launched the new version. It includes both kinds of result highlighting and Heavy Bombers now work properly in LHTR rules. The double rolling is not displayed (only the lower of the two dice is showed), but you’ll find that if 99 H. Bombers attack, they will score about 85-90 hits.

    Thanks for the help. Let me know if you spot any more bugs. By now there are so many configurations in which to test this program that I can’t really test for them all, so my only way of hearing about bugs is when others let me know.

  • 2007 AAR League

    He he. I wrote “is showed” - that’s not right!

    Okay, this post serves no purpose other than to inflate my post count - how much longer do I have to be a lowly infantry. Hey, can I give myself a special title in my profile? (goes to check…)


  • @frood:

    Okay, this post serves no purpose other than to inflate my post count - how much longer do I have to be a lowly infantry.

    47 as of when I type this response :-)

  • 2007 AAR League

    New feature that might be pretty cool:

    I’ve added the ability to bookmark a scenario. Also, the link to the scenario is included in the e-mail, so when someone sends you a battle result, you can click on the link and toy with the scenario, see what their odds were etc.

    Also, this will allow me to create a page of presets for certain first round attacks. I could use some help if people would set up the attacks and e-mail them to me using the dicey, then I’ll create a page with the links I get. Also, they could get posted to forums for discussion etc.: example : Link to 4 Arm v. 4 Arm

    Don’t know why I didn’t do this way back, it was pretty easy to implement.

    Example:

  • 2007 AAR League

    More changes at http://frood.net/aacalc/ :

    • Option to swap the Defender’s and Attacker’s units. This way you can see what might happen if you decide not to attack and your opponent then attacks you instead with the same forces.
    • Option to just evaluate the value of your units. Displays Unit count, punch and IPC value. May be useful as a tool in purchasing units, and with an e-mail address entered you could use this to submit unit purchases.
    • Cleaned up the form a bit.

    Now it’s time I focused on some other things…

Suggested Topics

  • 1
  • 1
  • 1
  • 3
  • 7
  • 4
  • 13
  • 2
Axis & Allies Boardgaming Custom Painted Miniatures

39

Online

17.0k

Users

39.3k

Topics

1.7m

Posts