• 2007 AAR League

    I’m working on patch for AACalc to include the changes from AA50.

    I’m currently being a little lazy and overwriting the values from the Revised game with those for AA50  (as you can still use the original frood.net simulator for Revised).

    Note: I haven’t actually played AA50 (and thus am not familiar with all the rules), but I’m hoping to do it soon.

    This is the “quick and dirty” version.  I haven’t tested it much.
    http://www.campusactivism.org/aacalc/

    Changes so Far
    -Added cruiser unit
    -Changed IPC values for units
    -Changed SUB defense to ‘1’
    -Changed TRA defense to ‘0’
    -Put transport last in the OOL
    -Put cruiser in OOL (Attacking default - CRU is after FIG,  Defending it is before FIG)
    -Added Cruiser bombardment
    -Changed attack/defend values for SSubs and JFighters
    -Let defenders killed in bombardment fire back
    -There was a bug with cruisers not dying, but I think I fixed it.

    Changes Left to Do
    -Figure out subs
    (Updated based on suggestions)

    Bugs
    -Battleships don’t act like they have two hits.  I broke this. It works fine in the frood.net version.  Try one battleship versus another.

    Testing
    -Sea battles need testing.

    Things you Need to Do to Make Sure it Works
    -keep transport last in ool, or just take it out completely of the battle
    -make sure bombardments is equal or less than number of land units

    What else do I need to do?

    Previous Thread on this issue:
    http://www.axisandallies.org/forums/index.php?topic=14976.15


  • Great work. I am looking forward to this.

    Some things that need to be dealt with:

    • There is all the techs of course.
    • air can not hit subs wo destroyer present.
    • defending subs are given the option to dive before battle starts (I think)

    checks for input data:

    • one can not include more bombarding ships than land units landed to the battle
    • altering the OOL so that trns comes before anything else should not be permitted

    I’ll let you know if anything more comes to my mind.

    Can we expect this roller to stay up for a while. A friend of mine and myself are trying to find the time for an pbem-game, and might “beta”-test this for you.

  • 2007 AAR League

    So defending subs can dive before the battle begins.  Does an attacking destroyer stop this ability?


  • Yes, subs can never dive with enemy destroyer present (as I interpret it).

    Also, if subs make surprise attack (both defender and attacker, as I interpret it) units hit does not get to return fire. So maybe you need a entirely separate surprise-attack section, in addition to opening fire.

    As with any new A&A rules there is always something that is subject to interpretation. So a bit of careful reading to make up your own mind might be needed. You are probably aware of the fact that the rulebook is available online: http://www.wizards.com/AvalonHill/rules/AxAl-AnEd_Rules.pdf

    Maybe other readers have opinions on these matters, as well.

  • 2007 AAR League

    Aaron - I just checked out your page. You should probably remove the text in the middle that refers to game id and such since those features are not enabled in your version and also it is signed “froodster”.

  • 2007 AAR League

    I removed those parts.

    I didn’t get much feedback/interest, so anyone should note that it makes a bunch of mistakes (ex. battleships).

  • Customizer

    i have an idea:

    why not just make the entire thing open?

    why have something called a cruiser at all?

    why not just have something called “rolls at 3”

    make it completely open, have units called:

    rolls at 1
    rolls at 2
    rolls at 3
    rolls at 4
    rolls at 5
    rolls at 6

    and to account for behavior you need attachments:

    aagun
    antifirststrike (destroyer ability)
    firststrike (sub ability)
    supports (artillery ability)
    supported (infantry ability)

    and then have something called “can absorb X hits”
    this is separate from unit attachments, since it will always get filled first it doesn’t have to be attached to anything
    it will take care of the battleships, but will also allow for games where you have things like bunkers that absorb hits, etc.

    so for example, if you have (with aa50 rules)
    attacking force: 3 submarines, 1 carrier, 1 fighter, 1 battleship
    defending force: 1 submarine, 2 destroyers, 1 cruisers, 1 carrier

    then it would look like this input:
    (you could do the input like text also btw)
    attacking: 3@2 firststrike, 1@1, 1@3, 1@4, absorb 1
    defending: 1@1 firststrike, 2@2, 1@3, 1@2

    you could program it to take the casualties in the order they are put in, or in order of the smallest number first (a simple toggle or checkbox to switch modes)

    there is no reason to hard code this stuff,
    hard coding is simply wasting your time, because the calc will be out of date before you even finish coding

  • 2007 AAR League

    Well whether you call it hard-coding or not, you’d still be doing something special only for subs (and another rule only used by destroyers, and another rule only used by battleships (2 hits), a rule that only applies to inf+art, and perhaps others).  And as AA comes up with new rules you have to add them.  So you’ve still got a lot of complexity.  It isn’t that hard to write a simulator, and I’d be very likely to get it done if I wasn’t programming for my day job - or if I get super committed to playing this game (or if there was more interest expressed in this thread).

    I probably ought to write one form scratch, as figuring out someone else’s code is tough.
    This is mostly a hatchet job - see if I could make Frood’s simulator useful, and it works well for landbattles (and there are some fixes that give good approximations for sea battles).


  • One difficulty easily overlooked when approaching the problem of AA-simulators is the automatic assignment of hits. When you have combinations of units which make only some units legal targets for some other, one has to make sure that the attacker gets the maximal number of hits for his rolls. I’ve been thinking of this as a bipartite matching problem and think it can be rigorously solved through that approach. If you see a simpler solution to that I would be much interested in hearing about it.

    Like yourself I program for a living and am very enthusiastic about the game, but my job and family situation makes it hard to get some playing done, and even harder to contribute to excellent initiatives like this.

  • '12

    Veqryn you have some good ideas but there are some problems.  Not all 3’s or 1’s are the same when it comes to automated order of losses.  For a navy battle, you’d like to assign 2 hits to the 2 battleships right away to those 4s are different from the fighters 4 on defense.  When attacking peal harbour you might want the second hit on the third fighter rather than the sub as the extra fighter cannot stay, whereas the sub can.  (the first hit on the battleship).  The rules have to be hardcoded.  You could in theory create a generic engine that would accept a dynamic run-time file containing all the rules and values.  It would be completely open and would be awesome.  It would also add so much more complexity and be a complete rewrite.

    Any system that can be written on paper can be coded into a program that is the easy part.  Exhaustively and thoroughly documenting every rule, scenario and exception and what course of action to take for each is actually the hard part.

  • Moderator

    For simplicity I would consider “ignoring” some naval special situations.  What I mean is, it doesn’t seem essential for subs/dds to work in terms of determining an OOL for a correct simulation.  First and foremost naval battles can be tough for humans to work out considering OOLs can be real screwy and are so game/strategy dependent.

    I would suggest a simple default OOL, with no special circumstances taken into account for the battles.

    IE:  sub, dd, ac, ca, ftr, bom (if attacking), bb.

    Which is based soley on best defensive roll.  Afterall if you are using the calc, most of the time you want to see “what happens if I fight to the death” and any time you do this you should be assuming your opponent isn’t an idiot and will use the best defenders possible.  In terms of the sim it really doesn’t matter if you remove a DD before an AC if attacking subs are left b/c they both defend at 2.

    I think it is safe to assume any human player that goes through the trouble of finding and using the AACalc, will know that you need a dd to negate the subs first strike etc.

    You can also run the battle one round at a time and manually remove the losses as you see fit, if you want to try and see different scenerios play out.  But you could get an overall look at odds and see what happens if you stay till the end of battle and your opponent always kept his best defenders.

    I would think a Disclaimer like this might work:

    “For Naval battles AACalc assumes no special abilities and uses a default OOL of lowest defender to highest.  For more detailed results that take special abilities into account run the battle one round at a time and manually remove the units you see fit before proceeding to the next rd of battle.”

    Again, I think A&A players are pretty smart when we work out when to attack or not attack at sea and how we take losses, so I don’t think it is necessary to go through an immense amount of trouble trying to code for the crazyness of naval battles.  IMO, you only need a ball park figure.  And if you are counting on your opponent to make poor OOL choices then I don’t think you’ll need AACalc to help you win the game.

    I’d keep all slots for units, but the only thing I’d code would be the Inf + RT connection.  Everything else the player can pretty much do.

    Edit:

    Oops, I’d also account for 2-hit BBs if that wasn’t assumed in my post.  So OOL would be:

    1 hit BB, sub, dd, ac, ca, ftr, bb

  • Customizer

    all i’m saying is this:

    what if i have super subs tech?

    what if i am playing house rules where we have a new unit, called “partisan”, that is 3/2/1 and can do a first strike ON LAND, and we also have “spies” that cancel out the partisan’s special ability on land?

    by doing it the “open” way, where you are attaching things separately from the name of the unit, you are allowed to put things in however you want


  • All this complexity is for odds calculation, so no manual intervention can be done. For simple rolling one need not include automatic hit assignment, and the problem could be much simplified and made to include arbitrary units (like self-defined ones).

  • '12

    Veqryn, an open system whereby you can add new rules via an input file of some sort again good idea but would require a complete rewrite as all the rules are no-doubt in code rather than in data.  It’s realy far from trivial.  Just a guess but I bet AACalc has 100s of manhours in it, perhaps 1000s when dealing with constraints/workaround of legacy solutions/code.  I couldn’t even imagine how you would program a dynamic system whereby something like a partisan unit with first strike abilities and spies that would cancel it could be predicited and implemented.  A unit property called ‘First strike’ and ‘First strike negation’ would have to be programmed for beforehand, then a runtime file containing a set of records comprising the list of units and unit abilities/stats could be then used.  I just don’t see how runtime rules could easily be implemented.  This coming from a guy who writes genetic learning algorithms……

  • Customizer

    well….
    i prefer modular open-ended object oriented design to something closed off.
    as far as attachments go, it is actually not that hard

    TripleA uses attachments to units, so that I can do such things as calculate a battle between two-hit elephants vs spearmen, or against x-wings and the death star, not just axis and allies stuff

  • '12

    Objected-oriented design or not has nothing to do if the system is open or not, and I am not familiar with the term open-ended system other than when clients think the contract is open-ended and they can keep asking for free changes :-).  If an elephant is going to be a 2 hit unit, the ‘property’ of having 2 hit points must be coded.  Then facilities must be hard coded to allow units to have properties, how many properties?  If the cardinality is greater than 1 then datastructures must be created to implement this and some hardcode to access this date must be created.  If the hit point property were to be truly open, then you would have to hard code for N hit points and a field would have to be created and read by the program to determine if the unit has 1 or 5 or N hit points.  It’s actually probably the way to go for a complete rewrite.  You would have a static list of unit properties (again how could you write a program to deal with properties that are unknown at compile time) and a file that would describe a list of N units each of which has a set of properties ie, Name, Offense, Defense, Number of Hit points, Cost and then a pointer to a relator table to set up the Many to Many relationships between units and more unique properties such as first strike attack as in subs and partisans and first strike neutralization of subs and anti-partisans.  Special coding would have to be there to handle AA guns, they would be treated more like a regular unit with a property called AA which in this case means the unit cannot be a casualty in the battle and has a first strike ability of sorts.  This is all fairly doable, and from a clean sheet design would probably have been the way to go.  Depending on how the data was represented it still might not be too difficult to retrofit onto the existing program.

    Programmers almost never have the luxury of seeing what the program should finallly be in the end when doing the initial design work.  Most often, we are given the task of creating a chevette, and over the years are instructed to constantly upgrade it towards being a corvette, had we been told to begin with we were going to build a corvette different design choices would have been initially used.

    Now, how to handle dynamic rules or new properties……  That is the tricky part.  How would you handle dynamically say a unit that reflects 20% of the hits in a battle back to the attacker?  This property of damage reflection would never have been coded nor anticipated.  In theory its simple, just add 20% of the attackers hits to the defenders return hits, but how to make a program do that when it was never design to do something like that?

  • Customizer

    while what you said is awesome,

    i do think we can draw the line at a couple things. (at least for now)

    things like reflecting hits back, etc, are not known properties.  I’d say we can limit the engine to known properties (the properties that matter during combat that is)
    this includes:

    attack
    defense
    bombard
    aa
    air
    sea
    double dice rolls (heavy bomber)
    double dice rolls pick the best of them (heavy bomber larry harris rules)
    first strike (sub)
    anti-first-strike (destroyer)
    two hit
    gives support (artillery)
    supportable (infantry-like)
    can not hit air (like sub)
    can not be hit by air (like sub)

    so… take all those properties, and apply them to:

    x number of units rolling at 1
    x number of units rolling at 2
    x number of units rolling at 3
    x number of units rolling at 4
    x number of units rolling at 5
    x number of units rolling at 6

    and there you have basically what the engine should look like (and what triplea is already capable of doing).
    hard-coding that there is something called submarine, and that is rolls at 2 attack and 1 defense is dumb.
    what if i get super subs? what if i get larry harris super-subs?
    what if it is a two-hit land elephant that attacks at 4 and defends at 5?

    there are the properties I would code, and i don’t believe there are any more within the axis and allies world that apply to combat

  • '12

    Yup, that sounds pretty good.  It would be sweet if the input file was text, say comma delimited for all the units and properties.  A public template would be available, one could then modify it for house rules/new units etc.  or even modify it for foreign languages for unit names.

  • 2007 AAR League

    I noticed that I made a change that stopped my modified version of AACalc from working a couple months ago.

    This is back to working (with several exceptions previously listed still applying - ex. heavy bombers and battleships):
    http://www.campusactivism.org/aacalc/

    Gives great results for land battles.

  • 2007 AAR League

    Thanks to a patch from Greg Massaro, he fixed the bugs that I had with subs and battleships.  So now both should work for the AA50 simulator:  http://www.campusactivism.org/aacalc/

    (Originally designed by Dan Rempel who did almost all of the work)

    If there are any bugs, let me know.

Suggested Topics

Axis & Allies Boardgaming Custom Painted Miniatures

31

Online

17.0k

Users

39.3k

Topics

1.7m

Posts