Announcement

Collapse
No announcement yet.

combat program?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • combat program?

    has anyone written a program to give the percentage chance of victory for any given battle, that will run at the same time as Civ (as in AC)? i was thinking of doing it myself but there's no point in re-inventing, well anything really.

  • #2
    I've written one for Excel, altho it would need a bit of tweaking before I'd send it out in public. Basically, it would need some more rows of calculation added, and some touch-up. It's fast, all you do is type in the two units' attack, defense, HP, and FP, et voila, the probability of the attacker winning pops up in another cell. It does not work for 0-defense units, tho (division by zero errors).

    For everything the collective apolyton mind knows about combat, see the oft-linked (usually by me) thread Info: Combat (GL).

    ------------------
    "There is no fortress impregnable to an ass laden with gold."
    -Philip of Macedon
    [This message has been edited by Marquis de Sodaq (edited May 20, 2001).]
    The first President of the first Apolyton Democracy Game (CivII, that is)

    The gift of speech is given to many,
    intelligence to few.

    Comment


    • #3
      sounds good! are you going to post it when its finished? also does it allow for terrian types? also with divide by zero errors could you set to defense strengh to something like 0.0000000000000001 when zero was entered and round the answer to (say) 2 decimal places so the probabiltity will be the same.

      i've got to learn to use a programmable calculator (TI 84) as part of a maths course i'm doing and i thought this might be a good exercise.

      Comment


      • #4
        I suppose if there is interest, I'll finish it. I'd whipped it together for calculating odds while testing. The zero-defense unit problem might work with a small number, I've not tried that. The attack and defense values to be entered are already modified (terrain, vet status, etc) - I've only written it for one input number. I'd thought about making a VB program that had checkboxes for all possible modifications, but I just don't have the time for that. I'll let you know when I get around to finishing it...
        The first President of the first Apolyton Democracy Game (CivII, that is)

        The gift of speech is given to many,
        intelligence to few.

        Comment


        • #5
          I might just give VB a try after I emerge from under 200 exam scripts ...

          ------------------
          Scouse Git[1] -- git1@scousers.net

          "Staring at your screen in horror and disbelief when you open a saved game is one of the fun things of a succession game " - Hueij
          "The Great Library has been built!"
          "A short cut has to be challenging,
          were it not so it would be 'the way'."
          - Paul Craven
          "Our words are backed by empty wine bottles! - SG(2)
          "One of our Scouse Gits is missing." - -Jrabbit

          Comment


          • #6
            The VB idea is good because it can spew out the final probability more neatly than Excel. The spreadsheet takes a sum of each combination's probabilities - each one taking up a row. There are dozens of possible HP/FP combos to take into account, each needing its own summary cell. A VB program could simply pop in the high and low of the range to reach the same number. If that doesn't make sense, nevermind. Just trust me that VB would not be anywhere near as messy.

            Edit: The zero-defense units might be given a 1/8 defense in calculation, considering the situations in which they win. Others have suggested other values, but I'd like to see the .125 put to the test.
            ------------------
            "There is no fortress impregnable to an ass laden with gold."
            -Philip of Macedon
            [This message has been edited by Marquis de Sodaq (edited May 21, 2001).]
            The first President of the first Apolyton Democracy Game (CivII, that is)

            The gift of speech is given to many,
            intelligence to few.

            Comment


            • #7
              i was looking thru the GL for information on the combat equation when i came accoss a program by a guy called Mark Wagner writen 1999 that gives the probabilty of an attacker winning a given battle, its appears to use something very close to the SUMn(COMB) equation as it gives results identical to the ones posted by the Marqis in the GL. i emailed Mark and he confirmed this "but with a slight modification". it's a great program small, neat and inobtrusive you can download it from
              Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


              has anyne done any more predicted results for the SUMn(COMB) equation? i'd like to run a few through the program to see what i get.

              Comment


              • #8
                I downloaded that program a while ago, but it doesn't do the same math as the Sum/Comb formula. I've started making a VB program to do the full formula - I'll probably finish right before Civ3 comes out... Actually, I'll plug away at it as I have free time.
                The first President of the first Apolyton Democracy Game (CivII, that is)

                The gift of speech is given to many,
                intelligence to few.

                Comment


                • #9
                  Originally posted by Marquis de Sodaq
                  Edit: The zero-defense units might be given a 1/8 defense in calculation,

                  might? must be given a 1/8 defense. IMHO.
                  Civ2 "Great Library Index": direct download, Apolyton attachment

                  Comment


                  • #10
                    Sorry, to clarify, might get a 1/8 - instead of 1/16 or .00001 or anything at all other than zero...

                    Okay, I've done all the easy work in VB (making the interface). Now I have to code all the math behind the gray box. This might take some time, as I'm only a novice at VB programming. I could write it in an hour in the proprietary language I use at work. Alas, this cannot be translated into common code...
                    The first President of the first Apolyton Democracy Game (CivII, that is)

                    The gift of speech is given to many,
                    intelligence to few.

                    Comment

                    Working...
                    X