• I wrote some code for a calculator to keep track of IPC during a board game of Axis and Allies 1942, Second Edition. As an amateur coder and new to this board game I need feedback, please. (Got a lot of help from my friend Rainer. Thanks ‘Reg’)

    see it on YouTube: https://youtu.be/d1heYfO4ME4

    There is a link to download the code below. It is not a PC game. The idea is it will run on your PC, (laptop, desktop or PC tablet), with a mouse. Boot it up when you start a board game and keep track of each nation’s IPC totals by clicking a radio button in a territory on the map to change ownership. Watch the IPC totals update as territories change ownership.

    2020-04-12 09_08_25-Window.png

    2020-04-12 16_05_18-Window.png


    Download the file. (It comes from bitbucket, a password protected code repository but have your security software scan it in any event for security.) Use 7-zip to unpack it in a new folder on your hard disk. Click on the AsixAndAlliesCalculator.exe file to run the code. Let me know what I did wrong. Thanks.

    5/2/2020 — I have updated the code to deal with the capture and liberation of a nation’s capital. It will zero out the income and then return it on liberation.

    2020-05-02 10_23_07-.png

  • I just updated the download link above. My database had New Guinea twice and this could have given incorrect totals. This issue is fixed. Please delete and redownload the calculator if your download file was named other than “AnA_IPC_Calulator.7z”.

    I have also added the capture and liberation of the capital to zero out or return income.

  • Good idea. Thanks.

  • Great work! Is there also an IPC calculator for Global 😉
    One think: If a capital is captured the allied forces can’t gain IPCs for liberating territories which belong to that capital’s force. E.g. UK or US liberates Karelia after Germany/Japan occupied Russia

  • Thanks fasthard. That is just the kind of help I needed. The code to correct that will be coming in an update to the download.

    As for making a version for Global, yes that is possible. I would need some help though.

    Images: I used my cell phone to take two pictures of each half of the 1942 map and photoshopped ( or gimp, a free photo editor) the two images into one map image. This is the background map you see in the PC program. Can you do that or do you know someone that can? The final image is a massive 4741 by 2800 pixels but could be smaller. ( you just lose some of the zoom depth) I would also need 300 by 300-pixel images of the insignias of the additional nations in the game.

    Support Files:
    There would also need to be an updated version of this text file to reflect the territories on the map.

    The file starts out like this:

    Norway;2;Germany;Germany; …

    Each new line is a territory in the game. The information in each line is in the order of name, IPC, current owner, original owner. Someone would need to provide a list like that for the global game. Do you have, or do you know, someone with Excel spreadsheet skills?

    After creating these supporting files there will be a process of creating and editing the location of all the radio buttons on the map. I will be glad to show you how that is done.

    Thanks again.

  • Hi kennethofborg,
    you’re welcome.

    I’ve done a global IPC tracker with MS Excel (https://www.dropbox.com/scl/fi/qj1ukd81mhwvhwu9ajbo3/AxisAndAllies_GLOBAL_1940_2nd_Initial_20200312.xlsm?dl=0&rlkey=ndesbxts7ih1pcqknz2vriu6l), therefore I’ve got some preparation lists I can easily adjust:
    There’re all IPCs relevant territories included (also the NO ones without IPC value).

    Here are some maps files:

    Loooking forward testing the calculator 😉

    Best regards

  • Very good!

    I was able to cut out the map image and covert it. It is fewer pixels than for 1942 but this will likely not be important.

    Do you have images for the nation insignias other than the German, Japanese, USA, UK and USSR images I already have?

    The .txt file looks good too.

    I just need to ask three stupid questions.

    First, because the current code is a calculation of total IPC it does not include territories with zero value. There is no reason to put the radio buttons for a zero IPC territory on the map. The button function is to exchange ownership of IPC values. Is there some other feature to Global that is different than for 1942? If not I can just remove those zero IPC lines.

    Second, what is the “n” owner in Global? Is that no owner but there could be?

    Third, what is “nAllies” and “nAxis” owner in Global? Is this some alliance of neutrals? (Sounds like there may be a need for new code logic to deal with a complicated set of rules.) This will take more work.

    Also, regarding your original observation about the capture of capital: There currently is no accounting for the loss of a nation’s capital in this code.

    The question:
    Would I correctly follow the board game rules if I have the nation’s IPC income turn to zero when the capital territory falls to an opposing nation? If the capital territory was liberated by the original owner nation or a friendly nation, it would again show the total IPC income of that nation. (program already keep track of liberated territory returning IPC to the original owner)

    To be clear, this program just adds up a nation’s IPC total income from territories to determine income for that turn. It does not keep track of cash held by any nation, player.

  • HI kennethofborg,

    1. The zero value territories are necessary if you want to calculate some of the additional National Objectives.
      e.g. the Soviet Union gains 3 extra IPCs if they occupy an original axis/pro axis territory even if it’s worth zero IPC: Sardinia, Sicily, Italien Somaliland;
      or the United Kingdom Europe gains 5 IPCs if it controls all of they original territories: Alexandria is worth nothing but UKE won’t get the NO’s 5IPCs if they don’t control it.
      But if you only want to calculate the territories IPCs you can delete (or comment for futher versions ;-)) these rows.

    2./3. “n” means “neutral”: There are neutral, neutral pro axis and neutral pro allies territories in Global40.

    For the insignias: Mr @Tjoek has created some roundels:

    Best regards

  • The extra IPD conditions will require more code logic to build into a global calculator. I could give it a go but would ask for a commitment on your part. To complete the project I would like to teach you how to position the buttons correctly on the map. alt text

    I will take on getting the code working to create the buttons and calculate while you place the buttons. Would you be willing to spend some time on Skype with me, install an editor and let me show you how xaml code (the top of the image above) works to place the buttons on the map ( the bottom part of the image)?

Suggested Topics

Axis & Allies Boardgaming Custom Painted Miniatures