How to calculate combat odds

Greetings. An open ‘how can I’ or ‘is it possible’ question. See pic. The 3 CW units want to attack the GE unit. Each unit is defined by prototypes as being CW and allies, and germany and axis. Each unit has a combat factor (cf) equal to the left number (the right number is movement).

I would really like something (another counter, gkc, or whatever) that would sum the cfs of each side, account for the weather the map zone they are in, calculate the odds and do some other stuff to provide the players with something that they roll dice on to decide the outcome.

Let’s presuppose that the participants in this combat are ‘selected’ (counter property), cf is a part of each counter, weather type is available.

Oh, can we do something about that inordinately low limit for a file upload?

The way I’d go about it is this – Some piece, either one of the pieces involved because I’m doing a right click on it, or else some “calculate combat odds” button because I pressed it, is going to do the following steps:
(1) Clear some global properties (e.g. AttackStrength, DefenseStrength)
(2) Send a Global Key Command “CalculateOdds”, with a matching expression for { selected == true } (or whatever you’re using to detect who’s already been selected for combat)
(3) Each piece responds to “CalculateOdds” by adding its strength to the appropriate AttackStrength or DefenseStrength property (or you can have GermanStrength and AlliedStrength or something like that)
(4) Once the GKC has run, the global properties should contain the proper sums of all selected units.
(5) So now the “originating piece” can use those values in a calculation, e.g. in a Calculated Property or whatnot, and could for example Report the odds, or even take some additional action now knowing what’s around.

Nice. I see the concept now. I’m sure the process will be a while setting up as there will likely be a few combinations and permutations involved here. Thank you.

Couple of thoughts

While I am very much for automation, it occurs to me that in a game like WIF, I don’t need the program to calculate the odds for me - I am going to know them down to the last half factor.

It seems a huge effort to code the combat system and tables, i can think of two systems that would be much easier & with maybe equal utility:

  • a layer over the top counter of each stack that tells you the total factors in that hex, to save thinking
  • a attack odds piece, which the player can put down to remember on target hexes so that they can remember what odds they have calculated for the attack
    –this might have a configurable 1-1, 2-1, etc images
    – and an optional type in of raw factors, eg 62-15
    – and maybe clicking it triggers the attack using the tables, if you really want to integrate them

regarding the upload limit, i think they will have to make a special one off exception for your baby!

hope they were worthwhile thoughts…

Martinov, a fellow WiF player by the sounds of it. A great game.

To now I have not got a ground units total counter (per hex). I did not until this week have any numerical combat factor assigned to each ground counter. I do have one for subs, scs and acft, and the mouse over viewer presents a lot of data for the stack it is on, as well as the total combat factors (and for each ground unit underneath the counter image).

I was never going to code the combat system and tables - way too big a task. There’s the 1D10, 2D10 and 3D10 combat tables for starters. Add in the actual die/dice roll totals, etc, etc. A definite not doing that.

But, you are very correct with your suggestions - KISS principle applies. All I need is the ground CF total counter. Perhaps a field for players to enter HQ support, TAC factors, SB factors, etc. I’m hoping I can actually bring in automatically the TAC factors (aircraft are in another level). I can account for flipped units and out of supply effects on flipped units. Not too sure yet of accounting for defending ARTY DIVs not stacked with another non ARTY unit. Lots of variables, but one can only but try.

You can take a look at how I managed the combat points for IMPERIUM ROMANUM II. It is not a perfect system, but is fun to play around with on its own.

IN IRII, like a lot of games, you compile the total Combat Points for each side, then determine the combat ration to determine which column to use on the combat Results Table.

I created two hot spots below the map where the attacker and the defender can place their stacks. Then by selecting the Total Combat Points Action button on the menu, the built in calculator displays the total combat points for each stack.

The attacker may then enter in the Combat Ratio they are trying to achieve and another calculator displays how many combat points are required (based on the defender’s Combat Point Total) to meet that desired Combat Ratio.

The video below demonstrates how this works. Admittedly this is the long way around the tree, especially for someone who can calculate the odds on the fly (I can’t), but it was also an experiment in “I wonder if Vassal can do this function”

Rather lengthy description of what only takes a few seconds in the module to complete.

One word of warning. the IRII module is very memory intensive and has numerous global key commands so the calculations may take 2-5 seconds depending on your computer speed. It is an experiment on the maximum capability that the automations can do within Vassal in terms of automating the games rules. Admittedly some gluttony applies here.

Wow. Thanks for the lead. Will be having a look. You do not mind if I use your methodology? I think I place some text using your forum user name in the ‘hot’ area acknowledging your contribution.

Please do. Which game are you building the module for?

The biggest issue that I had to face was:
-Vassal will not know which hexes are participating in the combat. This is why I created a hot spot to place all of the participating counters into do total the Combat points and calculate the odds.
-This can be messy as you have to remember the correct hexes to return the counters to.

-Feel free to also look at how I semi-automated the Combat Results Table. Again, this leads more to the “I wonder if I can make Vassal do this” category. Gaming experts will not see this as necessary, but as a module builder I find it fun to build a little excess in. The trick is to always allow players to play the game as-is without having to use the automations.

Good luck.

Ah, but Vassal can remember for you.

Use a ‘Send To Location’ command to send the selected units to your Hotspot and set up a ‘Send Back’ command in the Send To Location trait. When you have finished evaluating the combat, send any destroyed units to the Graveyard, then select the rest and use the ‘Send Back’ command to send them back to the hexes that they where sent from by the original 'Send to Location.

A very good idea.

There appears to be an issue with the IMPERIUM ROMANUM II module. It will not open, consumes 100% cpu time and Vassal eventually sends out of memory messages. I have 4GB of RAM for jvm max heap, so for a file that is 65MB I am rather surprised.

The module I’m working on is for World in Flames. A WW2 game by Australian Design Group. A big game.