Announcement

Collapse
No announcement yet.

Ai / dice rolling combat?

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

  • #46
    Originally posted by cgrecu77


    0.03% is 1 in 3300, which looks small but it's actually huge.
    oops typo, in my original post I did say the odds are 99.7%, which is 0.3%, and correctely 1 in 330.

    Comment


    • #47
      A couple of things:

      1. a bug has been identified and solved, which will lead to wrong combat odds in a very specific case: when both units have first strike chances. So, an archer with 1-2 fs vs a longbow with 2-4 fs does not show the correct odds. Everything else (e.g. where one unit has 1 fs and the other 2-4 fs, or simply with one unit some fs, the other not) works corerctly.

      2. With barbs, the level bonusses are indeed not taken into account in the calculation. That's a conscious design decision... For lower levels, you will get a much increased odd of winning rounds in case of the first few battles (freeWinsVsBarbs() ). Don't use barb warriors to test out any odds calculations

      3. there are some roundings at work, which will be most noticeable near 100% or 0%. the calculation should be over 0.5% accurate, though: if you get 100%, the real odds (calculated without the memory restrictions of games) should be at least 99.5%. 100% is of course not possible in CIV: whatever the odds, there is always some chance of winning, even if that chance might be 1 in a trillion.

      DeepO

      Comment


      • #48
        But the chances, for me at least, are incredibly too comonly favoring the lucky win.

        last night with china i beelined machinery and started cranking chokunus.

        I invaded greece and had montezuma declare war just as it ended. In that time i had captured 4 20% defence cities. and attacked 1 0% defence city 2 times.

        the first 20% went down easily as expected, as he had archers and phalanxes. 2 chokunus killing 2 units as the odds where greatly in my favor.

        Now it gets stupid frustrating. more chokunus online so now i have 4 or more for the next city. 3 defenders in it, 2 archers 1 phalanx. 20% tile defence. First fight would be close to even as 1 archer has city defense 1, so i use a weaker xbow to soften it up and do collateral damage to the others expecting to loose my xbow. I loose the unit but weaken the toughest archer and both other units, Now i attack with a +25% archery promoted unit, against a weakened archer, odds greatly in my favor 6.8 to 5.?... I loose again. 3rd xbow attacks the double collateraled phalanxe with anti melee promotions giving me 100% over 2 to 1 odds. I loose again. Ok bad luck of the RNG it sucks, but not a big deal. This happened TWO MORE TIMES in this same war, not game reloads but different cities different units etc.

        Now for the war against monty, i send xbows against him, he has a jaguar attack a xbow, straight out no tile defense, and he wins. /sigh ok whatever. I have 1 xbow sitting next to a 0% town so i figure i can attack kill 1 unit and run off. I loose, when odds again greatly in my favor. Another xbow comes up a couple turns later, try again. same result.

        this is not staying within the parameters on the laws of probability. this is me loosing most of the fights when i should be winning most, if not all, of them.

        it was only slavery wich won me that war, not better units. quantity has a quality all its own.
        --------------------------------------------------------------------------------------------------------------------------------------------------
        The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Amzanig huh?...So with that said: if you can not read my post because of spelling, then who is really the stupid one?...

        Comment


        • #49
          this kind of discussions always appear on online poker sites. The truth is luck is very unpredictable and streaks always happen. On the other hand you have to realise that an absolutely random number is tough to generate on a computer (it's actually impossible to generate a random number, but you can get very close ...).

          The problem with humans is that they tend to associate weightings to different combats. Let's take this scenarion: you attack somebody with 1 cannon and 5 grenadiers and they defend with some upgraded longbows. the first cannon attacks with 12 + 45% and the bow defends with 6 + 100% (hills, culture, promotions) , you have a slightly better chance of winning - but you lose! The problem here is that strategically that battle was very important for you, because if the cannon wins then:
          1. all the other troops are even more affected by the splash damage (I think)
          2. your cannon gets an upgrade making it even more powerful

          So if you lose the cannon and then attack with the grenadier and the odds are now in the computer's favor but you win two in a row you will more likely remember that you lost that very important cannon.

          The truth is it always seems to me that the more promoted a unit is the more chances to lose it has - and I definitely think that there is a very likelyhood to lose the first unit in the first attack on a city. Maybe there's a hidden bonus for the AI for the first attack? Unless I have a decisive advantage (2 to 1 or more) I tend to lose my first unit most of the time.

          In the end, the only way to know is if the developers of the game reveal the secret, one thing is for sure, other than bugs in adding bonuses and such, I'm pretty sure that the actual generator is not buggy and that the number are random enough.

          Comment


          • #50
            Originally posted by Hauptman
            the first 20% went down easily as expected, as he had archers and phalanxes. 2 chokunus killing 2 units as the odds where greatly in my favor.
            Like I said, a bug has been identified, and solved when both units have fs chances. Archers start out with 1 fs chance, chokonu's with 2? it basically goes wrong right there.

            chokonu's vs spears are no problem, though. That code is correct, and whatever little streak of bad luck you might have doesn't proof anything at all. It's simply is not in the code, so I'd turn to a psychic to remove the ghost in your pc if you really are getting so many bad results.

            Same works for poker too

            DeepO

            Comment


            • #51
              Originally posted by Yosh
              The quirkiest thing is that it seems to be most consistent when the combat odds say anything between 73-81% or so. I can almost gurantee (no, really - it's that consistent) that if I attack when I have those odds, I will lose the unit!
              I've noticed a similar thing: While I haven't done any testing, it seems to me that I lose an inordinate number of fights that are listed in the neighborhood of 78% in my favor. While I understand that those are by no means overwhelming odds, I would expect to win more than i lose (3 times more actually). In reality, I lose more than I win.
              The undeserving maintain power by promoting hysteria.

              Comment


              • #52
                Originally posted by DirtyMartini


                I've noticed a similar thing: While I haven't done any testing, it seems to me that I lose an inordinate number of fights that are listed in the neighborhood of 78% in my favor. While I understand that those are by no means overwhelming odds, I would expect to win more than i lose (3 times more actually). In reality, I lose more than I win.
                First week of school, and I'm already staying late in the lab.

                Anyhow, I will hopefully do more tests this weekend. Is there a Civ4 "to-hit" calculator somewhere? Or at least the formula?

                Like I said in a previous post, the problem may be in the random number generator itself. However, further tests need to be done (ie. units of equal strength attacking each other).

                There may be a problem, also, if smaller sample sizes do not correlate with the general trend.

                Comment


                • #53
                  Like I said in a previous post, the problem may be in the random number generator itself. However, further tests need to be done (ie. units of equal strength attacking each other).
                  I'm not so sure that the problem is in the RNG, cal. As DeepO mentioned, there was a calculation issue involving FS chances, which apparently has been fixed. What we're seeing, IMHO, is errors in the way that odds are calculated when there are multiple modifiers on both sides.

                  Comment


                  • #54
                    Originally posted by cal_01

                    There may be a problem, also, if smaller sample sizes do not correlate with the general trend.
                    this problem was raised before (the issue with combat being too streaky). In my opinion this is not worth the time to investigate. If we detect that the general picture is not flawed then it's very likely that the smaller sample sizes are correct, unless it's a cracy coincidence where the errors in small samples annihilate each other to result in a correct big picture.

                    Of course, there is the possibility that the big picture is correct but smaller sizes exhibit weird flaws (like the first battle in a big attacking stack - the human player loses very often). If that happens then it must be the result of a programmatic behaviour - intended or not by the developers ...

                    Comment


                    • #55
                      Originally posted by Yosh


                      I'm not so sure that the problem is in the RNG, cal. As DeepO mentioned, there was a calculation issue involving FS chances, which apparently has been fixed.
                      First strike Chances. I can't reiterate that enough... a unit with 1 fs vs a unit with 1-2 fs will calculate correctly. You need chances on both sides: so 1-2 fs vs 1-2 fs let's you run into the bug.

                      It has been solved, but not released yet. The bug is present in v1.52.

                      What we're seeing, IMHO, is errors in the way that odds are calculated when there are multiple modifiers on both sides.

                      Sorry, but I find it very hard to believe I wrote a bug in that particular piece of the code. The reason is simple: I copied the code from the battle routine... whatever is used there, is used in the odds calculator.

                      As to the formula: I'm certainly not going to release the code before the SDK... I 'gave' it to Firaxis. I don't want to run into copyright issues, whatever small the chance is. You will find some of my early work in the combat thread, but it has changed in v1.52 wrt the 'wounded strength'. Just some patience, please.

                      DeepO

                      Comment


                      • #56
                        Ugh. Just had 5 losses in a row with 70% or better chances.

                        One attack the enemy unit wasn't injured at all! Didn't lose a single fricken hit point!

                        Now he has a big stack sitting outside my city and I just inexplicably lost half the units I was hoping to bring them down with. Fricken great.
                        Captain of Team Apolyton - ISDG 2012

                        When I was younger I thought curfews were silly, but now as the daughter of a young woman, I appreciate them. - Rah

                        Comment


                        • #57
                          Make that 6 in a row. 79%!!!!! aaaahhhh!!!!
                          Captain of Team Apolyton - ISDG 2012

                          When I was younger I thought curfews were silly, but now as the daughter of a young woman, I appreciate them. - Rah

                          Comment


                          • #58
                            Originally posted by Yosh


                            I'm not so sure that the problem is in the RNG, cal. As DeepO mentioned, there was a calculation issue involving FS chances, which apparently has been fixed. What we're seeing, IMHO, is errors in the way that odds are calculated when there are multiple modifiers on both sides.
                            I'm not entirely sure, either; that's why I plan to do that one test on equal strength.

                            Simply put, I'm trying to narrow it down to one of three possibilities:

                            1) RNG
                            2) To-hit is borked since it produces several streaks
                            3) Odds is messed up, like you said

                            Moreover, I don't think it's merely isolated to first strike chances. I've been playing some Naval combat maps, and simply put, the current system is either unfair or heavily bugged; 80% odds is almost a guaranteed loss, and a win would give you either a severely damaged or untouched ship.

                            While I still am open to the idea that there is no bug, combat streaks (usually 3-4+) and unusual outcomes continue to make me skeptical.

                            Ideally, I would downgrade my verson and check if combat streaks were still present before. However, school is taking up a bunch of time.

                            Comment


                            • #59
                              Originally posted by cal_01
                              Ideally, I would downgrade my verson and check if combat streaks were still present before. However, school is taking up a bunch of time.
                              While I appreciate any good report on something not working correctly, please don't invest time in checking if the streaks are present in several versions. Use it for school, or play in stead I'll make it easier for you: anything to do with distributions has not changed over versions, AFAIK nobody touched it. The RNG behaves the same...

                              While it wouldn't be the first time a RNG is biased (e.g. it is more likely to generate numbers between 0.1 and 0.2 than it is to generate numbers between 0.4 and 0.5), and this might lead to streaks. I doubt that, though... I'm reading reports on both very good, as very bad results. I'm reading people who thing the first unit in a stack is different. I'm reading all sorts of things, the average of which seems to be everything is working as planned, but some seem to get (un)lucky.

                              DeepO

                              Comment


                              • #60
                                Ok I'm at work, so I had time to run a test...

                                I did not run any 50 - 50 tests, as others have already done that, these are "real" fights with unfair unit matches.

                                Unit vs Unit - showed % - test 1 - test 2 - test3

                                axe vs spear 98.8 100 100 100
                                axe vs sword 74.9 80 100 80
                                spear vs axe 1.2 0 0 0
                                sword vs axe 24.9 30 30 30
                                pike vs knight 72.8 40 60 70
                                knight vs pike 27.0 40 40 10


                                "porcupine" stacks, when attacking you should loose all fights, as you attack your counter unit. units include Knight pike xbow and maceman

                                Test 1 -- 2 units killed both by knights
                                test 2 -- 1 unit killed by knight
                                test 3 -- 3 units killed, 2 knight 1 mace.

                                Everything except Knights vs pikemen went as expected, The knight vs pike % falls into the "soft spot" that people have been complaining about. So maybe, there is a small bug at that 72% mark?
                                Attached Files
                                --------------------------------------------------------------------------------------------------------------------------------------------------
                                The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Amzanig huh?...So with that said: if you can not read my post because of spelling, then who is really the stupid one?...

                                Comment

                                Working...
                                X