Results 1 to 11 of 11

Thread: How Does The Game Calculate Battle Odds?

  1. #1

    How Does The Game Calculate Battle Odds?

    I have always assumed that (with the exception of an over-run) the game simply takes the attacking points and defending points, and then just works out the probability of you winning from these two figures, and then runs a random "Thingie"(TM) to determine the actual outcome, i.e.

    Attack 50, Defend 50... the odds of winning are 50:50, a coin toss. In an infinite series of battles you would win an average 50 out of every 100.

    Attack 60, Defend 50... the odds of winning are 60:50 or 6:5. In an infinite series of battles you'd win 6 out of every 11 on average.

    In other words, add the Attack and Defend points together (the total points), and then compare this total to your Attack points, for your odds of winning.

    If this is how the game does it, it would explain why, for example, you can still lose in a 3 v 1 battle. The total points are 4, and so the odds of you winning are 4:3, ie for every 4 battles, on average you'd win 3. In other words, you'd still lose 25% of the time!

    Every battle (unless the odds are 6:1[?] or better which is an "over-ride" and gives you an automatic victory) is losable.

    Even 50 v 10 means you will "only" win 50 in every 60 battles, on average.

    Is this right?

    Or are the battle odds mechanics a little more refined?

    I have definitely lost, say, a 27 attack battleship to a 9 defense cruiser before and found myself in utter disbelief, when actually, if the above battle odds system is correct, this will happen 9 in every 36 times (or 1/4 of the time) on average. I guess it's just a shock when it *does* happens, because I imagine my battleship *should* be invincible!

    So is this actually how the odds are calculated, or are the mechanics more complicated?

  2. #2
    Join Date
    Mar 2011
    Location
    New Jersey, USA
    Posts
    1,167
    Search "Guaranteed battle odds" to read 80 replies to that question...

    Many aspects of civ rev outcomes/rewards/great people have yet to be fully deciphered.

    If you play SP mode, then save the game 2 or so turns before a major battle... Then replay different moves...

    The same values will remain xx vs yy but you may lose or win based on some sort of matrix... I believe, not known to anyone on the forum...

  3. #3
    Thanks for pointing me to that thread. Me personally, I've drawn some conclusions from what I've read...

    (1) There are NO guaranteed wins, except for an over-run.
    (2) The win / lose determination system is based initially on the odds as I stated above.
    (3) The odds are then modified "behind the scenes" depending on so-called "hit points", "the overall size of the attack" and "the health of the unit".
    (4) The system then creates a random "event" (equivalent to a dice roll or a random number) to determine whether you actually win or lose.

    Here are the quotes from that thread that stood out to me...

    @elthrasher True, but that doesn't necessarily tell the whole story, even if we've got it right. There's that video of Sid talking about battle odds in which he reveals that you have better odds fighting 18-6 than you do 3-1.
    I would love to watch that video! 18-6 is the same odds as 3-1, but if Sid says you have better odds with 18-6, then clearly there is some modification to the odds system going on behind the scenes. That's why I say, based on "the overall size of the attack" in my list.

    Presumably if you're attacking with 18, you're not using "ancient" units, so the programmers have probably given extra weight to a higher attack, since such units would be more "modern".

    @asmodeios Yes, attacking with a wounded unit increases the odds that you can lose as long as you do not have overrun.
    If this is true (and it sounds very plausible to me, since a wounded unit in real life is going to be *less* effective at combat), the wounded unit's odds get further modified *down* in the background. Maybe it's calculated in terms of hit points, with the wounded unit losing hit points.

    @derekt75 I'm pretty sure that single units have a lower chance of winning if they are the favorite. I'd even say that you're more likely to beat an archer army with a modern infantry army 18 vs. 9 than you are with a single artillery 24 vs. 9. A single unit bomber attacking a 9-unit defender 27 vs 24 wins less than 50% of the time, I think.
    @dukeblue1987 We have proven the hit point theory, just not to what extent. Catapults have 2 hit points. Archers have 3.
    Is there a list of units and their equivalent hit points? (I guess it's in the manual, but I've never read it from beginning to end). If this "hit point" theory is true as suggested above, then the odds are again modified (in the background) based on those hit points.

    I don't think there is a "matrix" as such. I suspect it's still just based firstly on the raw odds you see on the screen, taking into account fortifications etc, then on some modifications behind the scenes (such as hit points), and finally on a random number which actually determines whether you win or lose. That would be the easiest to program.

    One of the days, when I have way too much free time on my hands, I might run some experiments to see if I can figure it out. If I ran 100 of the exact same battles that should give me some useful data, but (a) even that won't give perfectly reliable data as it's not actually that large a sample, and (b) man that sounds tedious!

    Also, I forgot about the Oracle which most of the first page of that thread was discussing. Again, one simple way the programmers ensure the Oracle is reliable is to simply generate the random number at the time the Oracle does its thing, so then the Oracle already *knows* who is going to win / lose. Mind you, is the Oracle 100% reliable? I don't think I've ever used it, except perhaps a long time ago. Might have to run some tests on that, too.

    Part of what inspired me to ask the initial question is that I noticed yes, you *can* weaken archer armies with legion armies, so I tried to do the same with tons of knights backed up with naval support (attack ~45), trying to break into the Russian capital where the AI had got rifleman armies and a ton of upgrades (taking its defence to 75!). My knights were just being ripped to shreds, and didn't seem to make much of a dent as every time I attacked the defense was still 75.

    Now in reality, I might have been weakening them, because when I got Leonardo's Workshop and my knights changed to Tanks, those tanks did the job, But I thought, based on the legion armies vs archer armies wounding approach, my knights would do the same. At first sight, they didn't, which would suggest that perhaps the "hit points" of the knights weren't sufficient against the superior "hit points" of riflemen.

    This would make sense, as that's what you'd expect in "real life". The idea of knights beating riflemen should be absurd.

    Anyway, I'll have to look for more information on these "hit points". Any specific threads you could recommend, where these hit points are spelled out? I'll do a search as well.

  4. #4
    Join Date
    Mar 2011
    Location
    New Jersey, USA
    Posts
    1,167
    Wow my friend,

    Lots of good insights...

    This sounds like a job for ScottieX...

    Scottie?

  5. #5
    Join Date
    Jan 2010
    Location
    Auckland, NZ
    Posts
    5,362
    My guess is that 100 vs 50 your odds will be 2-1 on each battle so 2hp vs 2hp it will be .8888 vs .1111 odds (.4444 wounded) meanwhile at 2 vs 1 the odds will tend towards .6666 vs .3333.
    Why I say that is it seemed from my testing that what the game did was just not allow you to loose in certain scenarios, eg win loose win might be banned. Or maybe it would just re roll the dice the first time this happened and it just became much less likely.

    But Im not sure...

    The oracle is reliable - except when it creates this red x that stops you attacking no matter what. But you may get stuck not switching the seed and therefore not being allowed to attack for a long time, this relates to "karma" which is a word we use to cover the fact that you tend to get luckier if you lost last time.

  6. #6
    I think that any GOTW players will say that there is some sort of predetermined odds at the beginning of each turn, hence the "seed manipulation" that we do. Because you can duplicate the same experiment over and over in GOTW you can test the various outcomes of a turn. For example, you have 3 warriors attacking 3 different BH's and one is wounded (ei; 1vs.5, 1vs.5, .67vs.5) then there's typically a way to win all three battles, you just need to find the correct sequence. You might need to attack with the wounded unit either 1st, 2nd, or 3rd but one of the orders will be the outcome you want.

    I believe this a applicable to multiplayer. I think of it as kind of a karma factor but if you sacrifice an ancillary unit before the battle that matters, you tend to get the win (unless your sacrifice gets the upset). In essence, I believe that there is an order to the battle odds given at the start of the turn (1st battle odds, 2nd battle odds, battles 3 odds) and in multiplayer every asset on the board (including your opponents) is affecting that order. In theory you could win every upset if you could see every asset and understand the battle odd sequence, you'd just have to wait to attack at the perfect moment. If only you could somehow test a controlled multiplayer game.

    Coarse, I could be way off. I think it should also be noted that before 2000BC 2:1 are guaranteed, after 2000BC all bets are off.

  7. #7
    Quote Originally Posted by ScottieX View Post
    My guess is that 100 vs 50 your odds will be 2-1 on each battle so 2hp vs 2hp it will be .8888 vs .1111 odds (.4444 wounded) meanwhile at 2 vs 1 the odds will tend towards .6666 vs .3333.
    I don't quite understand the hit point concept, so your odds didn't make sense to me. Are there perhaps any threads you recommend that cover this?

    Why I say that is it seemed from my testing that what the game did was just not allow you to loose in certain scenarios, eg win loose win might be banned. Or maybe it would just re roll the dice the first time this happened and it just became much less likely.
    Yes, I think I've noticed this, particularly with certain units ie knights versus riflemen. If the knights attack is low *enough* compared to the rifleman's defense, they don't seem to win. Then again, I haven't scientifically tested it.

    The oracle is reliable - except when it creates this red x that stops you attacking no matter what. But you may get stuck not switching the seed and therefore not being allowed to attack for a long time, this relates to "karma" which is a word we use to cover the fact that you tend to get luckier if you lost last time.
    Hmm, if it's reliable, then the program definitely creates the core variable that determines win / loss in advance. It's just a question of whether it's based on a "seed" as the poster below suggests, or is just a random number. I'm surprised if it *is* some kind of a seed, since I'd have thought a random number would be easier - but then, maybe they don't want Civ Rev to be too much like Risk, where you *can* lose 3 troops to 1 troop with a lousy dice roll

  8. #8
    Quote Originally Posted by Baconinyourface View Post
    I think that any GOTW players will say that there is some sort of predetermined odds at the beginning of each turn, hence the "seed manipulation" that we do. Because you can duplicate the same experiment over and over in GOTW you can test the various outcomes of a turn. For example, you have 3 warriors attacking 3 different BH's and one is wounded (ei; 1vs.5, 1vs.5, .67vs.5) then there's typically a way to win all three battles, you just need to find the correct sequence. You might need to attack with the wounded unit either 1st, 2nd, or 3rd but one of the orders will be the outcome you want.
    Interesting. Actually, I just had a thought. This is an important question...

    Does this only work for a *current* turn? i.e. if you restart the *same* turn, you can generate the same outcome, but not necessarily if you replay 2 or 3 turns from the save?

    In other words, can you repeat 2 or 3 turns in sequence and get exactly the same results? Or is it only 1 turn?

    I'm wondering, perhaps the program generates a random number for you at the beginning of "Turn 1", which would explain why you can duplicate exactly the same battle, on the same turn. However, if "Turn 2" after the save varies, then that's because a fresh random number has been generated for that next turn.

    It would be interesting if some of you GOTW players tested to see whether you can actually get exactly the same battle sequences for 3 turns in a row without saving / reloading. If you still can, my suggestion above is wrong... but if you're finding variations from Turn 2 onwards, then it sounds like battles are based on a random number generated for you at the beginning of each turn.

    When you save the game, you're saving the random number for that turn, so all the battles in *that* turn will be based on it. Maybe an idea worth exploring? (After 2000BC, of course.)

  9. #9
    Join Date
    Jun 2009
    Location
    Canada
    Posts
    1,279
    Quote Originally Posted by Arctica View Post
    Interesting. Actually, I just had a thought. This is an important question...

    Does this only work for a *current* turn? i.e. if you restart the *same* turn, you can generate the same outcome, but not necessarily if you replay 2 or 3 turns from the save?

    In other words, can you repeat 2 or 3 turns in sequence and get exactly the same results? Or is it only 1 turn?

    I'm wondering, perhaps the program generates a random number for you at the beginning of "Turn 1", which would explain why you can duplicate exactly the same battle, on the same turn. However, if "Turn 2" after the save varies, then that's because a fresh random number has been generated for that next turn.

    It would be interesting if some of you GOTW players tested to see whether you can actually get exactly the same battle sequences for 3 turns in a row without saving / reloading. If you still can, my suggestion above is wrong... but if you're finding variations from Turn 2 onwards, then it sounds like battles are based on a random number generated for you at the beginning of each turn.

    When you save the game, you're saving the random number for that turn, so all the battles in *that* turn will be based on it. Maybe an idea worth exploring? (After 2000BC, of course.)
    Most software systems use a so-called "pseudo random generator" code, which is basically a complex math formula that produces the next number from a current "random seed" number, while also altering the seed number in a deterministic manner. This means, that if the "seed" is fixed at the beginning, then the sequence of the "random" numbers is always the same. There are certain events (such as battles and also rewards you get from barbarians or friendly huts) that will use the random generator. Each use advances in the sequence of numebrs generated. Therefore, if you repeat the exact same sequence of your moves, then each battle outcome will be exactly the same as last time from a saved game, regardless of how many turns have passed. However, if you do different moves, then the random numbers are being used for a different purpose, so they will net you different battle results.

    Some games use some pre-randomizing technique to initialize the seed, such as the lowest bits of the running clock and may even re-initialize their seeds at certain points (such as save/load or per turn), however, CivRev does not do that -- it is using a static seed number. That is why the events are reproducible if you follow a strict order of moves.

    As for the hit-point system: it simply means that the odds are being used multiple times. Let's say the attacker has 3 hit-points while the defender has only 2. In this case if the attacker has 66% chance to win, then the battle resolution gos like this:

    1. Roll the dice, i.e. take a random number between 0 and 1, if it is below 0.66, then the attacker won and the defender lost a hit-point (down to 1), but if its above 0.66, then the defender won the first clash, so the attacker lost a hit-point.
    2. Roll the dice again and compare the number again to 0.66, reduce the hit-points of the losing side again just like in step 1. Now, if the defender lost, then it is down to 0, so it has lost the battle. Otherwise continue to step 3
    3. same again with another random number...
    ...
    This goes until one of the sides lost all hit-points and therefore lost the battle. The winning side will suffer "injury" depending on how many hitpoints it has lost during the battle resolution.

    So because of the above system, winning the entire battle is not the same probability as the direct battle-odds because its not a single evaluation but a sequence of them. Yo uget the straight battle odds only when you are using 1Hp units both sides, such as a single warrior versus another single warrior.

    Oh, and BTW, I am not a game programmer, but I did stay in the Holiday Inn last night, I am a programmer and have some experience with pseudo-random generators and also a bit playing of CivRev

  10. #10
    Join Date
    Feb 2012
    Location
    Texas
    Posts
    982
    To clarify... When we say hit points we mean for example a catapult army has 2 hit points. Meaning that if if "loses" two of its catupults (an army has 3 catupults in it) it will die. If you watch the animation of the battle your catapult army will never win the battle if two of its catapults die, therefore it has 2 hit points. Same with a horse army. If your horses are defeated down to 1 horse during a battle the army will die. Legion army on the other hand has 3 hit points. A single legion for instance has 3 legions in it but it can still win a battle after two legions die (same with a warrior). So units that have the same attack like a horse or legion really dont have the same attack because of "hit points". Hope that clarifies the question about hit points

  11. #11
    Join Date
    Jan 2010
    Location
    Auckland, NZ
    Posts
    5,362
    Quote Originally Posted by Arctica View Post
    I'm surprised if it *is* some kind of a seed, since I'd have thought a random number would be easier - but then, maybe they don't want Civ Rev to be too much like Risk, where you *can* lose 3 troops to 1 troop with a lousy dice roll
    1)they had to create the seed based logic for GOTW, why not just carry over the same logic to Multiplayer?
    2) And they definitely seem to have created a mechanism to reduce the chances of loosing against the odds several times in a row.
    3) Zso and Jappy have hit points well covered above

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •