A PC Calculator for IPCs



  • 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

    [BITBUCKET]https://bitbucket.org/kflanagan/calculatorforaanda/downloads/AnA_IPC_Calulator.7z

    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.
    German.png

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

    The file starts out like this:

    Germany;10;Germany;Germany;
    France;6;Germany;Germany;
    NorthWesternEurope;2;Germany;Germany;
    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?

    Editing:
    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:
    BasicCountryListGlobal.txt
    There’re all IPCs relevant territories included (also the NO ones without IPC value).

    Here are some maps files:
    https://www.dropbox.com/s/ona2aexfo66pxhw/Map.bmp?dl=0
    https://www.dropbox.com/s/yi80qacpzzmcfj9/MapnoTerrain.bmp?dl=0

    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:
    https://www.axisandallies.org/forums/topic/31982/tjoek-s-custom-roundels-and-tokens?lang=de&page=1

    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)?


Log in to reply
 

20th Anniversary Give Away

In January 2000 this site came to life and now we're celebrating our 20th Anniversary with a prize giveaway of 30+ prizes. See this link for the list of prizes and winners.
Axis & Allies Boardgaming Custom Painted Miniatures
Dean's Army Guys
T-shirts, Hats, and More

Suggested Topics

  • 1
  • 5
  • 6
  • 3
  • 7
  • 18
  • 15
  • 13
I Will Never Grow Up Games
Axis & Allies Boardgaming Custom Painted Miniatures
Dean's Army Guys

49
Online

14.8k
Users

35.5k
Topics

1.4m
Posts