1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Combat Explained....

Discussion in 'Civ4 Strategy Articles' started by Arathorn, Nov 4, 2005.

  1. Vol

    Vol Sophist

    Joined:
    Nov 19, 2001
    Messages:
    349
    Does anyone think that the "jump point" distribution of combat odds was intentional by Firaxis? It seems so flawed and unintuitive compared to the rest of the game. I genuinely think that they never stepped back and did the math, realized what the effect of all of the rounding and floor functions might do. I have to believe that smooth curve is what the designers wanted, they just failed in the implementation, and lacked time to do a full analysis like Arathorn has.

    Hopefully they'll come to their senses and fix it in a patch so that the combat system is as simple and intuitive as the rest of the game.
     
  2. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    Weird hypothesis: Maybe the number of first strikes aren't substracted but are also based on the chance to hit the opponent. So the tank has a 90.4% chance to get its first strike against the archer and the archer has a 9.6% chance to get its fourth first strike against the tank. But somehow the people at Firaxis screwed up and switched the percentages and the tank gets the 9.6% and the archer the 90.4% chance to get its first strike.

    This weird hypothesis is based on the number of times that the archer gets 4 first strikes (close to 90,4%) and the number of times it gets 3 first strikes (close to 9.6%). It's a very weird hypothesis, I know. But the results are weird, so a weird hypothesis is in order. Of course the exact number of first strikes that the archer gets is not clearly visible.

    Good luck with any further tests. :thumbsup:
     
  3. DaveMcW

    DaveMcW Deity

    Joined:
    Oct 8, 2002
    Messages:
    6,489
    I think attacker and defender first strikes cancel out, and only the remaining ones deal damage.
     
  4. Zombie69

    Zombie69 Emperor

    Joined:
    Nov 22, 2005
    Messages:
    1,898
    I believe the archer is safe for the first 4 rounds and the tank is safe for the first round only. This would make sense, right? If as you say the attacker's first strikes don't show up in the log, this would explain the results shown in the post above, if we assume that the archer got the first hit. This would mean :

    Round 1 : archer hits, tank uses first strike to avoid taking damage, doesn't show up in the log (like all instances where attacker uses first strike).
    Round 2 : tank hits, no damage (archer's first strike).
    Round 3 : archer hits.
    Round 4 : tank hits, no damage (archer's first strike).

    Whatever happens, tank's first strike can't work after round 1, while archer's first strike can't work after round 4.
     
  5. Arathorn

    Arathorn Catan player

    Joined:
    Jan 10, 2002
    Messages:
    3,778
    Location:
    Illinois
    Zombie69, thanks. That makes a certain degree of sense. It kind of corresponds to the suggestion Roland was making, too. In 90+% of the cases, the tank wins the first round and so the hit is visible. In the <10% of the cases the archer wins, the tank's first strike gives it immunity, but it's not visible (assuming our hypothesis about attacker first strikes is correct). That one does work exactly like you'd think. A combat round where neither side can be damaged is just as good as no combat round at all. And the calculation time is invisible. That should be testable fairly easily, once we are certain attackers DO get first strikes and they just don't show up unless they hit.

    Welcome to CFC, too! Quite a first post! :)

    @Vol: I highly doubt it was intended. Whether it gets changed in a patch or not is an open question for which I have no answer. I would like to see it changed to be more intuitive, yes. I'm not entirely convinced Poisson distributions are the way to go, but some way of smoothing the curve seems logical to me.

    Arathorn
     
  6. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    I agree with Zombie69 's hypothesis. It's a good explanation and clearly not on the level of intelligence of a Zombie, so I suggest taking a different name! :goodjob:
     
  7. KrikkitTwo

    KrikkitTwo Immortal

    Joined:
    Apr 3, 2004
    Messages:
    12,334
    so that basically means the "First Strikes" are merely "rounds of immunity" Which makes sense.
     
  8. Vol

    Vol Sophist

    Joined:
    Nov 19, 2001
    Messages:
    349
    If we want Firaxis to fix the "jump points" in the resulting probabilities, we should make it easy on them by identifying exactly what needs to be done. Would just removing the floor() functions from the damage calculation make the end result smooth? I suppose fractional HPs would also have to be stored throughout the combat for that to have an effect.
     
  9. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    The only way to get rid of the jump points is by making the amount of damage variable (with an average amount of damage equal to the present value).

    The reason for jump points is that you need 5 hits of 20-24.999 damage to kill a unit and 4 hits of 25-33.333 damage to kill a unit. It's far more probable that a unit succesfully hits 4 times (or more) than that it succesfully hits 5 times (or more).
     
  10. Zhukov

    Zhukov Chieftain

    Joined:
    Jan 17, 2001
    Messages:
    13
    Location:
    Vancouver, BC, Canada
    I really do wonder if it was intentional, because the 50%->64% jump point has a huge effect on gameplay - IMO a pretty good one too. It makes it so that he who best manages bonuses can wipe the floor with the other guy since even a .001 advantage in strength can tide the odds in your favor.

    Makes war a lot more strategic - especially vs humans.
     
  11. Beamup

    Beamup Higgs boson

    Joined:
    Jun 8, 2001
    Messages:
    1,318
    Location:
    Boston
    There are other ways. Replacing the round-based mechanic with a differental equation-based, approximately continuous, method would be one (much more complicated, but it would do the job).

    Variable damage would be the simplest route, but certainly not the only route.

    Another easy approach which has its own advantages would be to recalculate R for each round, based on current HP. What makes this particularly appealing IMO is that, currently, a 100-HP Rifleman facing a 50-HP Grenadier can be completely different depending on whether the Grenadier lost those HP in this battle or the previous one. It's not entirely based, right now, on the current status of the units.

    With this approach, there would still be discontinuities, but there would be a very large number of very small discontinuities instead, so they would not be important.
     
  12. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    I liked this (basic) combat model presented by Krikkitone a month ago:

    It's simple and produces the combat effects that I would like to see. Maybe it can be modded in Civ4, but I suspect that it might be difficult to make the AI use it correctly.

    edit: maybe it is not directly clear, but there are no chances to hit in this model. But a stronger unit does more damage.
     
  13. Beamup

    Beamup Higgs boson

    Joined:
    Jun 8, 2001
    Messages:
    1,318
    Location:
    Boston
    Trouble is that it makes jump points even more important and greatly reduces the power of being stronger than the enemy. You're not going to have "spearman beats tank," it's true, but you'll have a LOT more "spearman badly damages tank" than the current system.
     
  14. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    The part about differential equations is a bit vague, but you're right in the general assesment that there are different ways to reach the continuous function we want to see. But every (increasing) continuous function representing the chances of victory against the ratio of attack and defense can be reached by a combat formula based on some form of variable damage. So in essence the variable damage way is the only way ;) (just joking)

    Let's stop the mathematical discussion before we scare every reader away. :D
     
  15. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    What I also liked about that model (next to the stopping of spearman beats tank) is that a strength 6 unit was twice as strong as a strength 3 unit. Something that is not true in the present model. The model should be refined a little so that the damage is continuously variable. How badly a spearman damages a tank is completely dependent on the actual values you give the spearman and the tank, not the combat model.

    That post (112) was not in response to your previous post (111). I can't type that much and find that post of Krikkitone in 2 minutes.
     
  16. Beamup

    Beamup Higgs boson

    Joined:
    Jun 8, 2001
    Messages:
    1,318
    Location:
    Boston
    I realized that. I just also wanted to respond to it!
     
  17. Zombie69

    Zombie69 Emperor

    Joined:
    Nov 22, 2005
    Messages:
    1,898
    Thanks for the welcome. You can call me Zombie by the way (but that nick was taken).

    I'd been reading this forum for a couple days and when i came across this, the solution struck me as obvious so i wanted to help out if i could to keep the discussion going, so i created an account.

    I must say that i've liked all that i've read about this game so far. I'll definitely go out and buy it asap, probably later this week.

    Do you guys think this game is playable on a 800 MHz machine, on tiny maps if necessary? RAM is not a problem and videocard should be ok. I don't feel like buying a new computer right now just for one game. Please reply by PM if you can (is there even such an option on this forum?) because i don't want to hijack this thread anymore than i already have.

    Back on topic, i agree that adding a small random element would be ideal. All other strategy games i know (Warcraft, Starcraft, Heroes of Might and Magic) already have this included in their combat calculations. Plus, Civ4 combat already has some random element as well (to decide who gets a hit), so it's not like this would be sacrilege or anything like that.
     
  18. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    Not entirely sure, no (at least I'm not :lol:). The XP testing was very quick and didn't involve combat with injured units. I'll throw this on my list of things to play with when I'm bored.

    Edit: Should have linked the entire thread, not the single post.
    http://forums.civfanatics.com/showthread.php?t=139534
     
  19. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    Without a doubt. Between the log dump and a modified xml file, running a few hundred (or thousand) combats can be done very quickly.

    Can't say for the initial tests, but where the bulk test 7 is concerned, I am 100% certain of the testing conditions as no unit modifications were made in the world builder (set in the xml, which I have a copy of).

    Hinting at something? ;)
     
  20. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    Bulk run.... (for those curious, the archers lose all 445 combats)

    Test 3: Archer, Drill 1-4 (4-7 FS) vs Tank

    http://sio.midco.net/snepp/civ4/firststrike/test3.zip

    Here's one interesting result:

    Snepp's Archer (3.00) vs Bismarck's Tank (28.00)
    Defender Odds: 90.3%
    Bismarck's Tank is hit for 8 (92/100HP)
    Bismarck's Tank is hit for 8 (84/100HP)
    Bismarck's Tank is hit for 8 (76/100HP)
    Bismarck's Tank is hit for 8 (68/100HP)
    Bismarck's Tank is hit for 8 (60/100HP)
    Snepp's Archer is hit for 47 (53/100HP)
    Snepp's Archer is hit for 47 (6/100HP)
    Snepp's Archer is hit for 47 (0/100HP)
    Bismarck's Tank has defeated Snepp's Archer!
     

Share This Page